Switch some internal enum values to unsigned

This commit is contained in:
Evan Typanski 2024-09-17 10:41:21 -04:00
parent 3ab16e7adc
commit c2caa9e6a1
3 changed files with 12 additions and 6 deletions

View file

@ -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;