1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-25 21:38:59 +02:00

Merge pull request #3510 from Alexander-Wilms/remove-semicolons-from-macros

Remove trailing semicolons from more macros
This commit is contained in:
Ivan Savenko 2024-01-18 16:03:55 +02:00 committed by GitHub
commit 9025744cc5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 6 additions and 10 deletions

View File

@ -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;

View File

@ -64,7 +64,7 @@ TStacks CPlayerBattleCallback::battleGetStacks(EStackOwnership whose, bool onlyA
int CPlayerBattleCallback::battleGetSurrenderCost() const
{
RETURN_IF_NOT_BATTLE(-3)
RETURN_IF_NOT_BATTLE(-3);
ASSERT_IF_CALLED_WITH_PLAYER
return CBattleInfoCallback::battleGetSurrenderCost(*getPlayerID());
}

View File

@ -15,7 +15,7 @@
#include <vcmi/Entity.h>
#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

View File

@ -42,7 +42,7 @@ VCMI_LIB_NAMESPACE_BEGIN
CObjectClassesHandler::CObjectClassesHandler()
{
#define SET_HANDLER_CLASS(STRING, CLASSNAME) handlerConstructors[STRING] = std::make_shared<CLASSNAME>;
#define SET_HANDLER_CLASS(STRING, CLASSNAME) handlerConstructors[STRING] = std::make_shared<CLASSNAME>
#define SET_HANDLER(STRING, TYPENAME) handlerConstructors[STRING] = std::make_shared<CDefaultObjectTypeHandler<TYPENAME>>
// list of all known handlers, hardcoded for now since the only way to add new objects is via C++ code

View File

@ -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<x>());
#define POSTFUNCTION(x) postfunction(zone.getModificator<x>());
#define DEPENDENCY(x) dependency(zone.getModificator<x>())
#define POSTFUNCTION(x) postfunction(zone.getModificator<x>())
#define DEPENDENCY_ALL(x) for(auto & z : map.getZones()) \
{ \
dependency(z.second->getModificator<x>()); \