diff --git a/AI/Nullkiller/AIGateway.cpp b/AI/Nullkiller/AIGateway.cpp index a5234bf47..0d79173a4 100644 --- a/AI/Nullkiller/AIGateway.cpp +++ b/AI/Nullkiller/AIGateway.cpp @@ -64,7 +64,7 @@ struct SetGlobalState }; -#define SET_GLOBAL_STATE(ai) SetGlobalState _hlpSetState(ai); +#define SET_GLOBAL_STATE(ai) SetGlobalState _hlpSetState(ai) #define NET_EVENT_HANDLER SET_GLOBAL_STATE(this) #define MAKING_TURN SET_GLOBAL_STATE(this) diff --git a/AI/VCAI/VCAI.cpp b/AI/VCAI/VCAI.cpp index 4ebeb1f3f..429f6a0db 100644 --- a/AI/VCAI/VCAI.cpp +++ b/AI/VCAI/VCAI.cpp @@ -66,7 +66,7 @@ struct SetGlobalState }; -#define SET_GLOBAL_STATE(ai) SetGlobalState _hlpSetState(ai); +#define SET_GLOBAL_STATE(ai) SetGlobalState _hlpSetState(ai) #define NET_EVENT_HANDLER SET_GLOBAL_STATE(this) #define MAKING_TURN SET_GLOBAL_STATE(this) diff --git a/include/vstd/CLoggerBase.h b/include/vstd/CLoggerBase.h index 37c9e5b94..546b3d352 100644 --- a/include/vstd/CLoggerBase.h +++ b/include/vstd/CLoggerBase.h @@ -172,10 +172,10 @@ private: /// Macros for tracing the control flow of the application conveniently. If the LOG_TRACE macro is used it should be /// the first statement in the function. Logging traces via this macro have almost no impact when the trace is disabled. /// -#define RAII_TRACE(logger, onEntry, onLeave) \ - std::unique_ptr ctl00; \ - if(logger->isTraceEnabled()) \ - ctl00 = std::make_unique(logger, onEntry, onLeave); +#define RAII_TRACE(logger, onEntry, onLeave) \ + std::unique_ptr ctl00 = logger->isTraceEnabled() ? \ + std::make_unique(logger, onEntry, onLeave) : \ + std::unique_ptr() #define LOG_TRACE(logger) RAII_TRACE(logger, \ boost::str(boost::format("Entering %s.") % BOOST_CURRENT_FUNCTION), \