From fb11c74d62726ba9d488eb10af2b823430e22090 Mon Sep 17 00:00:00 2001 From: Andrea Date: Fri, 17 Feb 2023 17:18:29 +0000 Subject: [PATCH] Avoid a couple of warnings. (PR #1180) --- source/CPU.cpp | 4 +++- source/Debugger/Debugger_Symbols.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/CPU.cpp b/source/CPU.cpp index a7212ae3..1cb014a8 100644 --- a/source/CPU.cpp +++ b/source/CPU.cpp @@ -728,7 +728,9 @@ void CpuSetupBenchmark () if ((++opcode >= BENCHOPCODES) || ((addr & 0x0F) >= 0x0B)) { *(mem+addr++) = 0x4C; - *(mem+addr++) = (opcode >= BENCHOPCODES) ? 0x00 : ((addr >> 4)+1) << 4; + // split in 2 lines to avoid -Wunsequenced and undefined behvaiour + const BYTE value = (opcode >= BENCHOPCODES) ? 0x00 : ((addr >> 4)+1) << 4; + *(mem+addr++) = value; *(mem+addr++) = 0x03; while (addr & 0x0F) ++addr; diff --git a/source/Debugger/Debugger_Symbols.cpp b/source/Debugger/Debugger_Symbols.cpp index 20cfade4..9bf79b4f 100644 --- a/source/Debugger/Debugger_Symbols.cpp +++ b/source/Debugger/Debugger_Symbols.cpp @@ -542,7 +542,7 @@ int ParseSymbolTable(const std::string & pPathFileName, SymbolTable_Index_e eSym { bool bFileDisplayed = false; - const int nMaxLen = MIN(DISASM_DISPLAY_MAX_TARGET_LEN, MAX_SYMBOLS_LEN); + const int nMaxLen = std::min(DISASM_DISPLAY_MAX_TARGET_LEN, MAX_SYMBOLS_LEN); int nSymbolsLoaded = 0;