diff --git a/.clang-tidy b/.clang-tidy index 7c590c811b..897b30f2ab 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -8,6 +8,7 @@ Checks: [-*, modernize-pass-by-value, modernize-redundant-void-arg, modernize-return-braced-init-list, + modernize-use-bool-literals, # Enable a very limited number of the cppcoreguidelines checkers. # See the notes for some of the rest of them below. diff --git a/src/analyzer/protocol/ftp/functions.bif b/src/analyzer/protocol/ftp/functions.bif index 1a7dafe901..09525df9ba 100644 --- a/src/analyzer/protocol/ftp/functions.bif +++ b/src/analyzer/protocol/ftp/functions.bif @@ -80,7 +80,7 @@ static zeek::RecordValPtr parse_eftp(const char* line) std::string s(line, nptr-line); // extract IP address struct in6_addr result; - good = zeek::IPAddr::ConvertString(s.c_str(), &result) ? 1 : 0; + good = zeek::IPAddr::ConvertString(s.c_str(), &result); if ( good ) addr = zeek::IPAddr(result); } diff --git a/src/analyzer/protocol/smb/smb1-com-negotiate.pac b/src/analyzer/protocol/smb/smb1-com-negotiate.pac index 2a42dbf05c..57529a507f 100644 --- a/src/analyzer/protocol/smb/smb1-com-negotiate.pac +++ b/src/analyzer/protocol/smb/smb1-com-negotiate.pac @@ -147,7 +147,7 @@ refine connection SMB_Conn += { type SMB_dialect = record { buffer_format : uint8; # must be 0x2 for dialect - name : SMB_string(0,0); + name : SMB_string(false, 0); }; type SMB1_negotiate_request(header: SMB_Header) = record { diff --git a/src/script_opt/ZAM/BuiltIn.cc b/src/script_opt/ZAM/BuiltIn.cc index c7b07d60ee..5a2c9983d6 100644 --- a/src/script_opt/ZAM/BuiltIn.cc +++ b/src/script_opt/ZAM/BuiltIn.cc @@ -269,7 +269,7 @@ bool SortZBI::Build(ZAMCompiler* zam, const NameExpr* n, const ExprPList& args) auto comp_func = comp_val->AsNameExpr(); auto comp_type = comp_func->GetType()->AsFuncType(); - if ( comp_type->Yield()->Tag() != TYPE_INT || ! comp_type->ParamList()->AllMatch(elt_type, 0) || + if ( comp_type->Yield()->Tag() != TYPE_INT || ! comp_type->ParamList()->AllMatch(elt_type, false) || comp_type->ParamList()->GetTypes().size() != 2 ) return false; diff --git a/src/script_opt/ZAM/ZInst.cc b/src/script_opt/ZAM/ZInst.cc index 3911f557dc..b9bfe5c451 100644 --- a/src/script_opt/ZAM/ZInst.cc +++ b/src/script_opt/ZAM/ZInst.cc @@ -26,7 +26,7 @@ void ZInst::Dump(FILE* f, const string& prefix, const string& id1, const string& const string& id4) const { fprintf(f, "%s ", ZOP_name(op)); // fprintf(f, "(%s) ", op_type_name(op_type)); - if ( t && 0 ) + if ( t && false ) fprintf(f, "(%s) ", type_name(t->Tag())); switch ( op_type ) { diff --git a/src/spicy/manager.cc b/src/spicy/manager.cc index a850aa4684..37ae792956 100644 --- a/src/spicy/manager.cc +++ b/src/spicy/manager.cc @@ -532,7 +532,7 @@ void Manager::analyzerError(file_analysis::Analyzer* a, const std::string& msg, reporter->PopLocation(); if ( a ) - a->SetSkip(1); // Imitate what AnalyzerError() does for protocol analyzers. + a->SetSkip(true); // Imitate what AnalyzerError() does for protocol analyzers. } void Manager::analyzerError(packet_analysis::Analyzer* a, const std::string& msg, const std::string& location) {