From 6dc3af5db41ecb24669b259c776c51964539d531 Mon Sep 17 00:00:00 2001 From: Naram Qashat Date: Sat, 26 Jun 2010 01:38:19 -0400 Subject: The next of a few "CBX OCDing over code style" commits, focusing on src/core/hs_* and src/core/ms_*, plus some tiny fallout caused by changing the FOREACH_* macros. --- include/modules.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/modules.h b/include/modules.h index 10e169dff..5fd36d6ac 100644 --- a/include/modules.h +++ b/include/modules.h @@ -55,8 +55,8 @@ enum EventReturn * loaded modules in a readable simple way, e.g.: * 'FOREACH_MOD(I_OnConnect,OnConnect(user));' */ -#define FOREACH_MOD(y,x) \ -do \ +#define FOREACH_MOD(y, x) \ +if (true) \ { \ std::vector::iterator safei; \ for (std::vector::iterator _i = ModuleManager::EventHandlers[y].begin(); _i != ModuleManager::EventHandlers[y].end(); ) \ @@ -73,15 +73,17 @@ do \ } \ _i = safei; \ } \ -} while (0); +} \ +else \ + static_cast(0) /** * This define is similar to the one above but returns a result in MOD_RESULT. * The first module to return a nonzero result is the value to be accepted, * and any modules after are ignored. */ -#define FOREACH_RESULT(y,x) \ -do \ +#define FOREACH_RESULT(y, x) \ +if (true) \ { \ std::vector::iterator safei; \ MOD_RESULT = EVENT_CONTINUE; \ @@ -103,7 +105,9 @@ do \ } \ _i = safei; \ } \ -} while(0); +} \ +else \ + static_cast(0) #ifndef _WIN32 # include -- cgit