1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Remove trailing semicolons from more macros

This commit is contained in:
Alexander Wilms 2024-01-16 19:25:21 +00:00
parent a5e95cce96
commit ccac73fb69
4 changed files with 5 additions and 9 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

@ -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>()); \