From acf8dba51b93f16c2d3c10bfd4e4ea1f648b5fa5 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 17 Dec 2025 15:00:40 -0500 Subject: [PATCH] Avoid FILE * implicitly converting to bool. --- Outputs/Log.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Outputs/Log.hpp b/Outputs/Log.hpp index b614ce15c..68731b82a 100644 --- a/Outputs/Log.hpp +++ b/Outputs/Log.hpp @@ -202,8 +202,7 @@ struct AccumulatingLog { template struct LogLine: private AccumulatingLog { public: - explicit LogLine(bool is_info) noexcept : - is_info_(is_info) {} + explicit LogLine(const bool is_info) noexcept : is_info_(is_info) {} ~LogLine() { if(output_ == accumulator_.last && source == accumulator_.source && is_info_ == accumulator_.is_info) { @@ -262,7 +261,7 @@ private: template struct LogLine { - explicit LogLine(FILE *) noexcept {} + explicit LogLine(bool) noexcept {} template auto &append(const char (&)[size], Args...) { return *this; } @@ -279,8 +278,8 @@ public: static constexpr bool InfoEnabled = enabled_level(source) == EnabledLevel::ErrorsAndInfo; static constexpr bool ErrorsEnabled = enabled_level(source) >= EnabledLevel::Errors; - static auto info() { return LogLine(stdout); } - static auto error() { return LogLine(stderr); } + static auto info() { return LogLine(true); } + static auto error() { return LogLine(false); } }; }