mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 08:38:20 +00:00
Fix another gcc7 warning.
Warning is: /home/johanna/bro/master/src/Type.cc: In member function 'virtual bool IndexType::DoUnserialize(UnserialInfo*)': /home/johanna/bro/master/src/Type.cc:548:60: warning: enum constant in boolean context [-Wint-in-bool-context] indices = (TypeList*) BroType::Unserialize(info, TYPE_LIST); ^ /home/johanna/bro/master/src/Type.cc: In member function 'virtual bool FuncType::DoUnserialize(UnserialInfo*)': /home/johanna/bro/master/src/Type.cc:868:61: warning: enum constant in boolean context [-Wint-in-bool-context] args = (RecordType*) BroType::Unserialize(info, TYPE_RECORD); ^ /home/johanna/bro/master/src/Type.cc:872:62: warning: enum constant in boolean context [-Wint-in-bool-context] arg_types = (TypeList*) BroType::Unserialize(info, TYPE_LIST); This one is a really nice catch in my opinion. GCC is completely correct - the 2nd argument to Unserialize is a bool. This means that all these calls always evaluate to Unserialize(info, true). Which is equivalent with the default, so I just removed the type from the call. This was probably caused by someone thinking of BroVal::Unserialize, which needs the type as the 2nd argument.
This commit is contained in:
parent
7c03f4dec0
commit
bfe94641cf
1 changed files with 3 additions and 3 deletions
|
@ -545,7 +545,7 @@ bool IndexType::DoUnserialize(UnserialInfo* info)
|
|||
DO_UNSERIALIZE(BroType);
|
||||
|
||||
UNSERIALIZE_OPTIONAL(yield_type, BroType::Unserialize(info));
|
||||
indices = (TypeList*) BroType::Unserialize(info, TYPE_LIST);
|
||||
indices = (TypeList*) BroType::Unserialize(info);
|
||||
return indices != 0;
|
||||
}
|
||||
|
||||
|
@ -865,11 +865,11 @@ bool FuncType::DoUnserialize(UnserialInfo* info)
|
|||
|
||||
UNSERIALIZE_OPTIONAL(yield, BroType::Unserialize(info));
|
||||
|
||||
args = (RecordType*) BroType::Unserialize(info, TYPE_RECORD);
|
||||
args = (RecordType*) BroType::Unserialize(info);
|
||||
if ( ! args )
|
||||
return false;
|
||||
|
||||
arg_types = (TypeList*) BroType::Unserialize(info, TYPE_LIST);
|
||||
arg_types = (TypeList*) BroType::Unserialize(info);
|
||||
if ( ! arg_types )
|
||||
return false;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue