From a05b4abdf767291bd143cecd685bb30847d308d5 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Tue, 10 Jun 2025 08:37:41 -0700 Subject: [PATCH] Fix clang-tidy modernize-use-bool-literals warnings in headers --- src/Func.h | 2 +- src/analyzer/protocol/http/HTTP.h | 2 +- src/analyzer/protocol/smtp/SMTP.h | 2 +- src/broker/Data.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Func.h b/src/Func.h index 6aefeb877e..3b47057d98 100644 --- a/src/Func.h +++ b/src/Func.h @@ -351,7 +351,7 @@ public: protected: BuiltinFunc() { func = nullptr; - is_pure = 0; + is_pure = false; } built_in_func func; diff --git a/src/analyzer/protocol/http/HTTP.h b/src/analyzer/protocol/http/HTTP.h index 1b2ec9d597..35d264bfeb 100644 --- a/src/analyzer/protocol/http/HTTP.h +++ b/src/analyzer/protocol/http/HTTP.h @@ -44,7 +44,7 @@ public: bool Undelivered(int64_t len); int64_t BodyLength() const { return body_length; } int64_t HeaderLength() const { return header_length; } - void SkipBody() { deliver_body = 0; } + void SkipBody() { deliver_body = false; } const std::string& FileID() const { return precomputed_file_id; } protected: diff --git a/src/analyzer/protocol/smtp/SMTP.h b/src/analyzer/protocol/smtp/SMTP.h index 5d6667ec05..6dd57ee455 100644 --- a/src/analyzer/protocol/smtp/SMTP.h +++ b/src/analyzer/protocol/smtp/SMTP.h @@ -50,7 +50,7 @@ public: void ConnectionFinished(bool half_finished) override; void Undelivered(uint64_t seq, int len, bool orig) override; - void SkipData() { skip_data = 1; } // skip delivery of data lines + void SkipData() { skip_data = true; } // skip delivery of data lines static analyzer::Analyzer* Instantiate(Connection* conn) { return new SMTP_Analyzer(conn); } diff --git a/src/broker/Data.h b/src/broker/Data.h index 4114aac27b..e7bb016195 100644 --- a/src/broker/Data.h +++ b/src/broker/Data.h @@ -323,7 +323,7 @@ public: /** * Converts the value to a Boolean. */ - [[nodiscard]] bool ToBool(bool fallback = 0) const noexcept { + [[nodiscard]] bool ToBool(bool fallback = false) const noexcept { if ( auto val = broker::get_if(value_); val ) { return *val; }