mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Switch some internal enum values to unsigned
This commit is contained in:
parent
3ab16e7adc
commit
c2caa9e6a1
3 changed files with 12 additions and 6 deletions
|
@ -142,9 +142,7 @@ bool CompositeHash::RecoverOneVal(const HashKey& hk, Type* t, ValPtr* pval, bool
|
|||
zeek_int_t i;
|
||||
hk.Read("int", i);
|
||||
|
||||
if ( tag == TYPE_ENUM )
|
||||
*pval = t->AsEnumType()->GetEnumVal(i);
|
||||
else if ( tag == TYPE_BOOL )
|
||||
if ( tag == TYPE_BOOL )
|
||||
*pval = val_mgr->Bool(i);
|
||||
else if ( tag == TYPE_INT )
|
||||
*pval = val_mgr->Int(i);
|
||||
|
@ -164,6 +162,8 @@ bool CompositeHash::RecoverOneVal(const HashKey& hk, Type* t, ValPtr* pval, bool
|
|||
|
||||
case TYPE_PORT: *pval = val_mgr->Port(u); break;
|
||||
|
||||
case TYPE_ENUM: *pval = t->AsEnumType()->GetEnumVal(static_cast<int>(u)); break;
|
||||
|
||||
default:
|
||||
reporter->InternalError("bad internal unsigned int in CompositeHash::RecoverOneVal()");
|
||||
*pval = nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue