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:
Tim Wojtulewicz 2020-03-11 10:41:46 -07:00 committed by Robin Sommer
parent 3c470ffe13
commit fd5e15b116
145 changed files with 1288 additions and 1331 deletions

View file

@ -34,7 +34,7 @@ void TopkVal::Typify(BroType* t)
HashKey* TopkVal::GetHash(Val* v) const
{
HashKey* key = hash->ComputeHash(v, 1);
HashKey* key = hash->ComputeHash(v, true);
assert(key);
return key;
}

View file

@ -45,17 +45,17 @@ function hll_cardinality_add%(handle: opaque of cardinality, elem: any%): bool
if ( ! cv->Type() && ! cv->Typify(elem->Type()) )
{
reporter->Error("failed to set HLL type");
return val_mgr->GetBool(0);
return val_mgr->GetFalse();
}
else if ( ! same_type(cv->Type(), elem->Type()) )
{
reporter->Error("incompatible HLL data type");
return val_mgr->GetBool(0);
return val_mgr->GetFalse();
}
cv->Add(elem);
return val_mgr->GetBool(1);
return val_mgr->GetTrue();
%}
## Merges a HLL cardinality counter into another.
@ -82,7 +82,7 @@ function hll_cardinality_merge_into%(handle1: opaque of cardinality, handle2: op
! same_type(v1->Type(), v2->Type()) )
{
reporter->Error("incompatible HLL types");
return val_mgr->GetBool(0);
return val_mgr->GetFalse();
}
CardinalityCounter* h1 = v1->Get();
@ -92,10 +92,10 @@ function hll_cardinality_merge_into%(handle1: opaque of cardinality, handle2: op
if ( ! res )
{
reporter->Error("Cardinality counters with different parameters cannot be merged");
return val_mgr->GetBool(0);
return val_mgr->GetFalse();
}
return val_mgr->GetBool(1);
return val_mgr->GetTrue();
%}
## Estimate the current cardinality of an HLL cardinality counter.