From ccac73fb69aeeac897401c0be23d6c3c144697bc Mon Sep 17 00:00:00 2001 From: Alexander Wilms Date: Tue, 16 Jan 2024 19:25:21 +0000 Subject: [PATCH] Remove trailing semicolons from more macros --- client/CPlayerInterface.cpp | 6 +----- lib/battle/IBattleInfoCallback.h | 2 +- lib/mapObjectConstructors/CObjectClassesHandler.cpp | 2 +- lib/rmg/modificators/Modificator.h | 4 ++-- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 722048dd5..e0a3b7daf 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -111,11 +111,7 @@ // They all assume that interface mutex is locked. #define EVENT_HANDLER_CALLED_BY_CLIENT -#define BATTLE_EVENT_POSSIBLE_RETURN \ - if (LOCPLINT != this) \ - return; \ - if (isAutoFightOn && !battleInt) \ - return; +#define BATTLE_EVENT_POSSIBLE_RETURN if (LOCPLINT != this) return; if (isAutoFightOn && !battleInt) return CPlayerInterface * LOCPLINT; diff --git a/lib/battle/IBattleInfoCallback.h b/lib/battle/IBattleInfoCallback.h index 6ee05b2f6..b5b9ce583 100644 --- a/lib/battle/IBattleInfoCallback.h +++ b/lib/battle/IBattleInfoCallback.h @@ -15,7 +15,7 @@ #include -#define RETURN_IF_NOT_BATTLE(...) if(!duringBattle()) {logGlobal->error("%s called when no battle!", __FUNCTION__); return __VA_ARGS__; } +#define RETURN_IF_NOT_BATTLE(...) do { if(!duringBattle()) {logGlobal->error("%s called when no battle!", __FUNCTION__); return __VA_ARGS__; } } while (false) VCMI_LIB_NAMESPACE_BEGIN diff --git a/lib/mapObjectConstructors/CObjectClassesHandler.cpp b/lib/mapObjectConstructors/CObjectClassesHandler.cpp index f7fbcd46c..1172a7ac1 100644 --- a/lib/mapObjectConstructors/CObjectClassesHandler.cpp +++ b/lib/mapObjectConstructors/CObjectClassesHandler.cpp @@ -42,7 +42,7 @@ VCMI_LIB_NAMESPACE_BEGIN CObjectClassesHandler::CObjectClassesHandler() { -#define SET_HANDLER_CLASS(STRING, CLASSNAME) handlerConstructors[STRING] = std::make_shared; +#define SET_HANDLER_CLASS(STRING, CLASSNAME) handlerConstructors[STRING] = std::make_shared #define SET_HANDLER(STRING, TYPENAME) handlerConstructors[STRING] = std::make_shared> // list of all known handlers, hardcoded for now since the only way to add new objects is via C++ code diff --git a/lib/rmg/modificators/Modificator.h b/lib/rmg/modificators/Modificator.h index c4db98da8..ef5be49bc 100644 --- a/lib/rmg/modificators/Modificator.h +++ b/lib/rmg/modificators/Modificator.h @@ -21,8 +21,8 @@ class Zone; class MapProxy; #define MODIFICATOR(x) x(Zone & z, RmgMap & m, CMapGenerator & g): Modificator(z, m, g) {setName(#x);} -#define DEPENDENCY(x) dependency(zone.getModificator()); -#define POSTFUNCTION(x) postfunction(zone.getModificator()); +#define DEPENDENCY(x) dependency(zone.getModificator()) +#define POSTFUNCTION(x) postfunction(zone.getModificator()) #define DEPENDENCY_ALL(x) for(auto & z : map.getZones()) \ { \ dependency(z.second->getModificator()); \