mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Turn MAX_LOGLEVEL into a true constant (and fix self-comparison warning)
This replaces the MAX_LOGLEVEL define with a constexpr variable in order to fix self-comparison warnings in the logging macros when compiling with Clang. (Without this change, the log level check in the logging macros is expanded into something like this: `if (LINFO <= LINFO)`, which triggers a tautological compare warning.)
This commit is contained in:
@ -315,7 +315,7 @@ static void VLogInfo(std::string_view format, fmt::format_args args)
|
||||
return;
|
||||
|
||||
const bool use_internal_log = s_use_internal_log.load(std::memory_order_relaxed);
|
||||
if (MAX_LOGLEVEL < Common::Log::LINFO && !use_internal_log)
|
||||
if (Common::Log::MAX_LOGLEVEL < Common::Log::LINFO && !use_internal_log)
|
||||
return;
|
||||
|
||||
std::string text = fmt::vformat(format, args);
|
||||
|
@ -804,7 +804,7 @@ static int ParseAttribList(u8* attrib_id_list, u16& start_id, u16& end_id)
|
||||
const u8 type_id = attrib_list.Read8(attrib_offset);
|
||||
attrib_offset++;
|
||||
|
||||
if constexpr (MAX_LOGLEVEL >= Common::Log::LOG_LEVELS::LDEBUG)
|
||||
if constexpr (Common::Log::MAX_LOGLEVEL >= Common::Log::LOG_LEVELS::LDEBUG)
|
||||
{
|
||||
DEBUG_ASSERT(sequence == SDP_SEQ8);
|
||||
(void)seq_size;
|
||||
|
Reference in New Issue
Block a user