mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
The Great Embooleanating
A large number of functions had return values and/or arguments changed to use ``bool`` types instead of ``int``.
This commit is contained in:
parent
3c470ffe13
commit
fd5e15b116
145 changed files with 1288 additions and 1331 deletions
12
src/Dict.cc
12
src/Dict.cc
|
@ -284,7 +284,7 @@ void* Dictionary::Lookup(const void* key, int key_size, hash_t hash) const
|
|||
}
|
||||
|
||||
void* Dictionary::Insert(void* key, int key_size, hash_t hash, void* val,
|
||||
int copy_key)
|
||||
bool copy_key)
|
||||
{
|
||||
if ( ! tbl )
|
||||
Init(DEFAULT_DICT_SIZE);
|
||||
|
@ -524,7 +524,7 @@ void Dictionary::Init2(int size)
|
|||
}
|
||||
|
||||
// private
|
||||
void* Dictionary::Insert(DictEntry* new_entry, int copy_key)
|
||||
void* Dictionary::Insert(DictEntry* new_entry, bool copy_key)
|
||||
{
|
||||
if ( ! tbl )
|
||||
Init(DEFAULT_DICT_SIZE);
|
||||
|
@ -623,13 +623,13 @@ int Dictionary::NextPrime(int n) const
|
|||
return n;
|
||||
}
|
||||
|
||||
int Dictionary::IsPrime(int n) const
|
||||
bool Dictionary::IsPrime(int n) const
|
||||
{
|
||||
for ( int j = 3; j * j <= n; ++j )
|
||||
if ( n % j == 0 )
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dictionary::StartChangeSize(int new_size)
|
||||
|
@ -669,7 +669,7 @@ void Dictionary::MoveChains()
|
|||
|
||||
for ( int j = 0; j < chain->length(); ++j )
|
||||
{
|
||||
Insert((*chain)[j], 0);
|
||||
Insert((*chain)[j], false);
|
||||
--num_entries;
|
||||
--num;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue