]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove redundant brackets from MACRO_BEGIN / MACRO_END calls
authorterencehill <piuntn@gmail.com>
Fri, 1 Feb 2019 22:35:59 +0000 (23:35 +0100)
committerterencehill <piuntn@gmail.com>
Fri, 1 Feb 2019 22:35:59 +0000 (23:35 +0100)
40 files changed:
qcsrc/client/announcer.qc
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/hud/hud.qh
qcsrc/client/hud/panel/infomessages.qc
qcsrc/client/hud/panel/modicons.qc
qcsrc/client/hud/panel/weapons.qc
qcsrc/client/miscfunctions.qh
qcsrc/client/view.qc
qcsrc/common/effects/effectinfo.qc
qcsrc/common/effects/qc/globalsound.qc
qcsrc/common/effects/qc/globalsound.qh
qcsrc/common/gamemodes/sv_rules.qh
qcsrc/common/mapinfo.qc
qcsrc/common/mutators/base.qh
qcsrc/common/mutators/mutator/nades/nades.inc
qcsrc/common/net_notice.qc
qcsrc/common/notifications/all.qc
qcsrc/common/notifications/all.qh
qcsrc/common/sounds/sound.qh
qcsrc/common/weapons/config.qh
qcsrc/lib/_all.inc
qcsrc/lib/arraylist.qh
qcsrc/lib/intrusivelist.qh
qcsrc/lib/iter.qh
qcsrc/lib/linkedlist.qh
qcsrc/lib/log.qh
qcsrc/lib/misc.qh
qcsrc/lib/net.qh
qcsrc/lib/oo.qh
qcsrc/lib/registry.qh
qcsrc/lib/sort.qh
qcsrc/lib/stats.qh
qcsrc/lib/test.qh
qcsrc/lib/vector.qh
qcsrc/lib/warpzone/server.qc
qcsrc/lib/yenc.qh
qcsrc/menu/xonotic/keybinder.qc
qcsrc/server/bot/default/bot.qc
qcsrc/server/g_world.qc
qcsrc/server/utils.qh

index 0195db43a432e17e1e472155995451a8f703160d..4ad25b3fd865618c2027922f6cb6b1d5f009a551 100644 (file)
@@ -115,7 +115,7 @@ void Announcer_Gamestart()
        previous_game_starttime = startTime;
 }
 
-#define ANNOUNCER_CHECKMINUTE(minute) MACRO_BEGIN \
+#define ANNOUNCER_CHECKMINUTE(minute) MACRO_BEGIN \
        if(announcer_##minute##min) { \
                if(timeleft > minute * 60) \
                        announcer_##minute##min = false; \
@@ -125,7 +125,7 @@ void Announcer_Gamestart()
                        Local_Notification(MSG_ANNCE, ANNCE_REMAINING_MIN_##minute); \
                } \
        } \
-MACRO_END
+MACRO_END
 
 void Announcer_Time()
 {
index c33c271fa21d52306bd46d92dc093c5166970b3a..939e5d77fa80dd57c4ae4c7bb4382f413c85917d 100644 (file)
@@ -341,10 +341,10 @@ void CSQCPlayer_FallbackFrame_PostUpdate(entity this, bool isnew)
        // player "pops in"
        if(isnew)
        {
-#define FIX_FRAMETIME(f,ft) MACRO_BEGIN {                                                                                                                                                      \
-               if(IS_DEAD_FRAME(this.f) && this.ft != 0 && this.death_time != 0)                                                                                       \
-                       this.ft = this.death_time;                                                                                                                                                              \
-MACRO_END
+#define FIX_FRAMETIME(f,ft) MACRO_BEGIN \
+               if(IS_DEAD_FRAME(this.f) && this.ft != 0 && this.death_time != 0) \
+                       this.ft = this.death_time; \
+MACRO_END
                FIX_FRAMETIME(frame, frame1time);
                FIX_FRAMETIME(frame2, frame2time);
 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
index c710fd6518f90205c2c16e6258cb1a818777ca74..b4596fbdfe8984e5cd2f15b70843a6070922049d 100644 (file)
@@ -27,7 +27,7 @@ REGISTER_REGISTRY(hud_panels)
 #define HUD_PANEL(NAME) HUD_PANEL_##NAME
 
 // draw the background/borders
-#define HUD_Panel_DrawBg() MACRO_BEGIN \
+#define HUD_Panel_DrawBg() MACRO_BEGIN \
        if(panel.current_panel_bg != "0" && panel.current_panel_bg != "") \
                draw_BorderPicture( \
                        HUD_Shift(panel_pos - '1 1 0' * panel_bg_border), \
@@ -36,7 +36,7 @@ REGISTER_REGISTRY(hud_panels)
                        panel_bg_color, panel_bg_alpha, \
                        HUD_Scale('1 1 0' * BORDER_MULTIPLIER * panel_bg_border) \
                ); \
-MACRO_END
+MACRO_END
 
 int panel_order[hud_panels_MAX];
 string hud_panelorder_prev;
@@ -240,7 +240,7 @@ REGISTER_HUD_PANEL(SCOREBOARD,      Scoreboard_Draw,    PANEL_CONFIG_NO
 
 // Get value for panel.current_panel_bg: if "" fetch default, else use panel_bg_str
 // comment on last line of macro: // we probably want to see a background in config mode at all times...
-#define HUD_Panel_GetBg() MACRO_BEGIN \
+#define HUD_Panel_GetBg() MACRO_BEGIN \
        string panel_bg; \
        if (!autocvar__hud_configure && panel_bg_str == "0") { \
                panel_bg = "0"; \
@@ -263,10 +263,10 @@ REGISTER_HUD_PANEL(SCOREBOARD,      Scoreboard_Draw,    PANEL_CONFIG_NO
                } \
        } \
        strcpy(panel.current_panel_bg, panel_bg); \
-MACRO_END
+MACRO_END
 
 // Get value for panel_bg_color: if "" fetch default, else use panel_bg_color. Convert pants, shirt or teamcolor into a vector.
-#define HUD_Panel_GetColor() MACRO_BEGIN \
+#define HUD_Panel_GetColor() MACRO_BEGIN \
        if ((teamplay) && panel_bg_color_team > 0) { \
                if (autocvar__hud_configure && myteam == NUM_SPECTATOR) \
                        panel_bg_color = '1 0 0' * panel_bg_color_team; \
@@ -287,20 +287,20 @@ REGISTER_HUD_PANEL(SCOREBOARD,      Scoreboard_Draw,    PANEL_CONFIG_NO
                        } \
                } \
        } \
-MACRO_END
+MACRO_END
 
 // Get value for panel_bg_color_team: if "" fetch default, else use panel_bg_color_team_str
-#define HUD_Panel_GetColorTeam() MACRO_BEGIN \
+#define HUD_Panel_GetColorTeam() MACRO_BEGIN \
        if (panel_bg_color_team_str == "") { \
                panel_bg_color_team = autocvar_hud_panel_bg_color_team; \
        } else { \
                panel_bg_color_team = stof(panel_bg_color_team_str); \
        } \
-MACRO_END
+MACRO_END
 
 // Get value for panel_bg_alpha: if "" fetch default, else use panel_bg_alpha. Also do various menu dialog fadeout/in checks, and minalpha checks
 // comment on line 3 of macro: // do not set a minalpha cap when showing the config dialog for this panel
-#define HUD_Panel_GetBgAlpha() MACRO_BEGIN \
+#define HUD_Panel_GetBgAlpha() MACRO_BEGIN \
        if (panel_bg_alpha_str == "") { \
                panel_bg_alpha_str = ftos(autocvar_hud_panel_bg_alpha); \
        } \
@@ -313,39 +313,39 @@ REGISTER_HUD_PANEL(SCOREBOARD,      Scoreboard_Draw,    PANEL_CONFIG_NO
                else \
                        panel_bg_alpha = max(cvar("hud_configure_bg_minalpha"), panel_bg_alpha); \
        } \
-MACRO_END
+MACRO_END
 
 // Get value for panel_fg_alpha. Also do various minalpha checks
 // comment on line 2 of macro: // ALWAYS show disabled panels at 0.25 alpha when in config mode
-#define HUD_Panel_GetFgAlpha() MACRO_BEGIN \
+#define HUD_Panel_GetFgAlpha() MACRO_BEGIN \
        panel_fg_alpha = autocvar_hud_panel_fg_alpha; \
        if (autocvar__hud_configure && !panel_enabled) \
                panel_fg_alpha = 0.25; \
-MACRO_END
+MACRO_END
 
 // Get border. See comments above, it's similar.
-#define HUD_Panel_GetBorder() MACRO_BEGIN \
+#define HUD_Panel_GetBorder() MACRO_BEGIN \
        if (panel_bg_border_str == "") { \
                panel_bg_border = autocvar_hud_panel_bg_border; \
        } else { \
                panel_bg_border = stof(panel_bg_border_str); \
        } \
-MACRO_END
+MACRO_END
 
 // Get padding. See comments above, it's similar.
 // last line is a port of the old function, basically always make sure the panel contents are at least 5 pixels tall/wide, to disallow extreme padding values
-#define HUD_Panel_GetPadding() MACRO_BEGIN \
+#define HUD_Panel_GetPadding() MACRO_BEGIN \
        if (panel_bg_padding_str == "") { \
                panel_bg_padding = autocvar_hud_panel_bg_padding; \
        } else { \
                panel_bg_padding = stof(panel_bg_padding_str); \
        } \
        panel_bg_padding = min(min(panel_size.x, panel_size.y)/2 - 5, panel_bg_padding); \
-MACRO_END
+MACRO_END
 
 // return smoothly faded pos and size of given panel when a dialog is active
 // don't center too wide panels, it doesn't work with different resolutions
-#define HUD_Panel_UpdatePosSize_ForMenu() MACRO_BEGIN \
+#define HUD_Panel_UpdatePosSize_ForMenu() MACRO_BEGIN \
        vector new_size = panel_size; \
        float max_panel_width = 0.52 * vid_conwidth; \
        if(panel_size.x > max_panel_width) \
@@ -356,13 +356,13 @@ REGISTER_HUD_PANEL(SCOREBOARD,      Scoreboard_Draw,    PANEL_CONFIG_NO
        vector new_pos = vec2(panel_bg_border + 0.5 * max_panel_width, 0.5 * vid_conheight) - 0.5 * new_size; \
        panel_pos = (1 - autocvar__menu_alpha) * panel_pos + (autocvar__menu_alpha) * new_pos; \
        panel_size = (1 - autocvar__menu_alpha) * panel_size + (autocvar__menu_alpha) * new_size; \
-MACRO_END
+MACRO_END
 
 // Scale the pos and size vectors to absolute coordinates
-#define HUD_Panel_ScalePosSize() MACRO_BEGIN \
+#define HUD_Panel_ScalePosSize() MACRO_BEGIN \
        panel_pos.x *= vid_conwidth; panel_pos.y *= vid_conheight; \
        panel_size.x *= vid_conwidth; panel_size.y *= vid_conheight; \
-MACRO_END
+MACRO_END
 
 float panel_fade_alpha;
 void HUD_Panel_LoadCvars();
@@ -371,7 +371,7 @@ void HUD_Panel_LoadCvars();
        panel_enabled = ((panel.panel_configflags & PANEL_CONFIG_CANBEOFF) \
                                        ? cvar(strcat("hud_panel_", panel.panel_name)) : true)
 
-#define HUD_Panel_UpdatePosSize() MACRO_BEGIN \
+#define HUD_Panel_UpdatePosSize() MACRO_BEGIN \
        Hud_Panel_GetPanelEnabled(); \
        panel_pos = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_pos"))); \
        panel_size = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_size"))); \
@@ -381,7 +381,7 @@ void HUD_Panel_LoadCvars();
        } \
        panel_bg_border_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_border")); \
        HUD_Panel_GetBorder(); \
-MACRO_END
+MACRO_END
 
 const int NOTIFY_MAX_ENTRIES = 10;
 const float NOTIFY_ICON_MARGIN = 0.02;
index f63ffb1deab223f0c31425248acfbee784399a48..131d62efe921129071db68a515723bf45cf0c69f 100644 (file)
@@ -50,10 +50,10 @@ vector InfoMessages_drawstring(string s, vector pos, vector sz, float a, vector
        return pos;
 }
 
-#define InfoMessage(s) MACRO_BEGIN \
+#define InfoMessage(s) MACRO_BEGIN \
        pos = InfoMessages_drawstring(s, pos, mySize, ((img_curr_group >= 0) ? panel_fg_alpha * img_fade[img_curr_group] : panel_fg_alpha), fontsize); \
        img_curr_group = -1; \
-MACRO_END
+MACRO_END
 
 void HUD_InfoMessages()
 {
index f4e63043054b12a2a8a3d18105e9c0013ba7e64f..306bb6f8a316970d229561ad435398f4de58b458 100644 (file)
@@ -136,14 +136,14 @@ void HUD_Mod_CTF(vector pos, vector mySize)
        }
 
        // when status CHANGES, set old status into prevstatus and current status into status
-       #define X(team) MACRO_BEGIN {                                                                                                   \
-               if (team##flag != team##flag_prevframe) {                                                                       \
-               team##flag_statuschange_time = time;                                                                    \
-               team##flag_prevstatus = team##flag_prevframe;                                                   \
-               team##flag_prevframe = team##flag;                                                                              \
-       }                                                                                                                                                       \
-       team##flag_statuschange_elapsedtime = time - team##flag_statuschange_time;      \
-    } MACRO_END
+       #define X(team) MACRO_BEGIN \
+               if (team##flag != team##flag_prevframe) { \
+                       team##flag_statuschange_time = time; \
+                       team##flag_prevstatus = team##flag_prevframe; \
+                       team##flag_prevframe = team##flag; \
+               } \
+               team##flag_statuschange_elapsedtime = time - team##flag_statuschange_time; \
+       MACRO_END
        X(red);
        X(blue);
        X(yellow);
@@ -164,7 +164,7 @@ void HUD_Mod_CTF(vector pos, vector mySize)
        string team##_icon = string_null, team##_icon_prevstatus = string_null; \
        int team##_alpha, team##_alpha_prevstatus; \
        team##_alpha = team##_alpha_prevstatus = 1; \
-       MACRO_BEGIN \
+       MACRO_BEGIN \
                switch (team##flag) { \
                        case 1: team##_icon = "flag_" #team "_taken"; break; \
                        case 2: team##_icon = "flag_" #team "_lost"; break; \
@@ -191,7 +191,7 @@ void HUD_Mod_CTF(vector pos, vector mySize)
                                } \
                                break; \
                } \
-       MACRO_END
+       MACRO_END
        X(red, myteam != NUM_TEAM_1 && (nteams & BIT(0)));
        X(blue, myteam != NUM_TEAM_2 && (nteams & BIT(1)));
        X(yellow, myteam != NUM_TEAM_3 && (nteams & BIT(2)));
@@ -262,7 +262,7 @@ void HUD_Mod_CTF(vector pos, vector mySize)
        neutralflag_pos = pos;
        flag_size = e1 * fs * size1 + e2 * size2;
 
-       #define X(team) MACRO_BEGIN \
+       #define X(team) MACRO_BEGIN \
                f = bound(0, team##flag_statuschange_elapsedtime * 2, 1); \
                if (team##_icon && ctf_stalemate) \
                        drawpic_aspect_skin(team##flag_pos, "flag_stalemate", flag_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); \
@@ -270,7 +270,7 @@ void HUD_Mod_CTF(vector pos, vector mySize)
                        drawpic_aspect_skin_expanding(team##flag_pos, team##_icon_prevstatus, flag_size, '1 1 1', panel_fg_alpha * team##_alpha_prevstatus, DRAWFLAG_NORMAL, f); \
                if (team##_icon) \
                        drawpic_aspect_skin(team##flag_pos, team##_icon, flag_size, '1 1 1', panel_fg_alpha * team##_alpha * f, DRAWFLAG_NORMAL); \
-       MACRO_END
+       MACRO_END
        X(red);
        X(blue);
        X(yellow);
index 8bf11cf1ac93d3994840bb64b96bac5ce993317d..eb3e3b87a35c725adabd748bc4b30a109220733e 100644 (file)
@@ -26,7 +26,7 @@ int weaponorder_cmp(int i, int j, entity pass)
        return aj - ai; // the string is in REVERSE order (higher prio at the right is what we want, but higher prio first is the string)
 }
 
-#define HUD_WEAPONS_GET_FULL_LAYOUT() MACRO_BEGIN \
+#define HUD_WEAPONS_GET_FULL_LAYOUT() MACRO_BEGIN \
        int nHidden = 0; \
        FOREACH(Weapons, it != WEP_Null, { \
                if (weapons_stat & WepSet_FromWeapon(it)) continue; \
@@ -37,7 +37,7 @@ int weaponorder_cmp(int i, int j, entity pass)
        rows = table_size.y; \
        weapon_size.x = panel_size.x / columns; \
        weapon_size.y = panel_size.y / rows; \
-MACRO_END
+MACRO_END
 
 void HUD_Weapons()
 {
index 0143d1a0134ac1720a49273a0bb87b408156ab54..ecfb0b295a8f0544e3f5f3aa7e0239bbc79efd23 100644 (file)
@@ -110,7 +110,7 @@ vector _drawpic_sz;
 float _drawpic_oldsz;
 string _drawpic_picpath;
 #define drawpic_aspect(pos,pic,mySize,color,theAlpha,drawflag)\
-       MACRO_BEGIN {\
+       MACRO_BEGIN \
                _drawpic_imgsize = draw_getimagesize(pic);\
                if(_drawpic_imgsize != '0 0 0') {\
                        _drawpic_imgaspect = _drawpic_imgsize.x/_drawpic_imgsize.y;\
@@ -127,35 +127,35 @@ string _drawpic_picpath;
                                        drawpic(pos + eY * 0.5 * (_drawpic_oldsz - _drawpic_sz.y), pic, _drawpic_sz, color, theAlpha, drawflag);\
                        }\
                }\
-       MACRO_END
+       MACRO_END
 
 // draw HUD element with image from gfx/hud/hud_skin/foo.tga if it exists, otherwise gfx/hud/default/foo.tga
 #define drawpic_aspect_skin(pos,pic,sz,color,theAlpha,drawflag)\
-       MACRO_BEGIN {\
+       MACRO_BEGIN \
                _drawpic_picpath = strcat(hud_skin_path, "/", pic);\
                if(precache_pic(_drawpic_picpath) == "") {\
                        _drawpic_picpath = strcat("gfx/hud/default/", pic);\
                }\
                drawpic_aspect(pos, _drawpic_picpath, sz, color, theAlpha, drawflag);\
                _drawpic_picpath = string_null;\
-       MACRO_END
+       MACRO_END
 
 // draw HUD element with image from gfx/hud/hud_skin/foo.tga if it exists, otherwise gfx/hud/default/foo.tga
 #define drawpic_skin(pos,pic,sz,color,theAlpha,drawflag)\
-       MACRO_BEGIN {\
+       MACRO_BEGIN \
                _drawpic_picpath = strcat(hud_skin_path, "/", pic);\
                if(precache_pic(_drawpic_picpath) == "") {\
                        _drawpic_picpath = strcat("gfx/hud/default/", pic);\
                }\
                drawpic(pos, _drawpic_picpath, sz, color, theAlpha, drawflag);\
                _drawpic_picpath = string_null;\
-       MACRO_END
+       MACRO_END
 
 void drawpic_aspect_skin_expanding(vector position, string pic, vector theScale, vector rgb, float theAlpha, float flag, float fadelerp);
 
 void drawpic_aspect_skin_expanding_two(vector position, string pic, vector theScale, vector rgb, float theAlpha, float flag, float fadelerp);
 
-#define SET_POS_AND_SZ_Y_ASPECT(allow_colors) MACRO_BEGIN {                                                                                                                    \
+#define SET_POS_AND_SZ_Y_ASPECT(allow_colors) MACRO_BEGIN                                                                                                                      \
        float textaspect, oldsz;                                                                                                                                                                                \
        vector dfs = drawfontscale; \
        drawfontscale = '1 1 0'; \
@@ -170,7 +170,7 @@ void drawpic_aspect_skin_expanding_two(vector position, string pic, vector theSc
                sz.y = sz.x / textaspect;                                                                                                                                                                       \
                pos.y += (oldsz - sz.y) * 0.5;                                                                                                                                                          \
        }                                                                                                                                                                                                                               \
-MACRO_END
+MACRO_END
 
 // drawstring wrapper to draw a string as large as possible with preserved aspect ratio into a box
 void drawstring_aspect(vector pos, string text, vector sz, vector color, float theAlpha, float drawflag);
index e26f90894d7ce24f9df890eeeeca4223d3aa290c..5efd863bd6a54d7ef864b55f4f5ed6c59fbbee09 100644 (file)
@@ -76,54 +76,46 @@ float autocvar_cl_leanmodel_lowpass = 0.05;
        ret = ref_store = ref_store * (1 - frac) + (value) * frac;
 
 #define lowpass_limited(value, frac, limit, ref_store, ret) MACRO_BEGIN \
-{ \
        float __ignore; lowpass(value, frac, ref_store, __ignore); \
        ret = ref_store = bound((value) - (limit), ref_store, (value) + (limit)); \
-MACRO_END
+MACRO_END
 
 #define highpass(value, frac, ref_store, ret) MACRO_BEGIN \
-{ \
        float __f = 0; lowpass(value, frac, ref_store, __f); \
        ret = (value) - __f; \
-MACRO_END
+MACRO_END
 
 #define highpass_limited(value, frac, limit, ref_store, ret) MACRO_BEGIN \
-{ \
        float __f = 0; lowpass_limited(value, frac, limit, ref_store, __f); \
        ret = (value) - __f; \
-MACRO_END
+MACRO_END
 
 #define lowpass2(value, frac, ref_store, ref_out) MACRO_BEGIN \
-{ \
        lowpass(value.x, frac, ref_store.x, ref_out.x); \
        lowpass(value.y, frac, ref_store.y, ref_out.y); \
-MACRO_END
+MACRO_END
 
 #define highpass2(value, frac, ref_store, ref_out) MACRO_BEGIN \
-{ \
        highpass(value.x, frac, ref_store.x, ref_out.x); \
        highpass(value.y, frac, ref_store.y, ref_out.y); \
-MACRO_END
+MACRO_END
 
 #define highpass2_limited(value, frac, limit, ref_store, ref_out) MACRO_BEGIN \
-{ \
        highpass_limited(value.x, frac, limit, ref_store.x, ref_out.x); \
        highpass_limited(value.y, frac, limit, ref_store.y, ref_out.y); \
-MACRO_END
+MACRO_END
 
 #define lowpass3(value, frac, ref_store, ref_out) MACRO_BEGIN \
-{ \
        lowpass(value.x, frac, ref_store.x, ref_out.x); \
        lowpass(value.y, frac, ref_store.y, ref_out.y); \
        lowpass(value.z, frac, ref_store.z, ref_out.z); \
-MACRO_END
+MACRO_END
 
 #define highpass3(value, frac, ref_store, ref_out) MACRO_BEGIN \
-{ \
        highpass(value.x, frac, ref_store.x, ref_out.x); \
        highpass(value.y, frac, ref_store.y, ref_out.y); \
        highpass(value.z, frac, ref_store.z, ref_out.z); \
-MACRO_END
+MACRO_END
 
 void calc_followmodel_ofs(entity view)
 {
@@ -1356,7 +1348,7 @@ void HUD_Crosshair(entity this)
                        }
 
 #define CROSSHAIR_DO_BLUR(M,sz,wcross_name,wcross_alpha) \
-                       MACRO_BEGIN \
+                       MACRO_BEGIN \
                                vector scaled_sz = sz * wcross_size; \
                                if(wcross_blur > 0) \
                                { \
@@ -1368,7 +1360,7 @@ void HUD_Crosshair(entity this)
                                { \
                                        M(0,0,sz,scaled_sz,wcross_name,wcross_alpha); \
                                } \
-                       MACRO_END
+                       MACRO_END
 
 #define CROSSHAIR_DRAW_SINGLE(i,j,sz,scaled_sz,wcross_name,wcross_alpha) \
                        drawpic(wcross_origin - ('0.5 0 0' * (scaled_sz.x + i * wcross_blur) + '0 0.5 0' * (scaled_sz.y + j * wcross_blur)), wcross_name, scaled_sz, wcross_color, wcross_alpha, DRAWFLAG_NORMAL)
index a1b27873053917e1ba6613d9939bc36d39f0395d..84bc880ba23608c3660d0aec63ecf1a487e0f161 100644 (file)
@@ -263,10 +263,10 @@ void effectinfo_read()
 
 void effectinfo_dump(int fh, bool alsoprint)
 {
-    #define WRITE(s) MACRO_BEGIN \
+    #define WRITE(s) MACRO_BEGIN \
         fputs(fh, s); \
         if (alsoprint) LOG_INFO(s); \
-    MACRO_END
+    MACRO_END
     WRITE("// ********************************************** //\n");
     WRITE("// ** WARNING - DO NOT MANUALLY EDIT THIS FILE ** //\n");
     WRITE("// **                                          ** //\n");
index 8c0dfd5080312fda7d1ed4d10a66a108bdd34075..4653f4a956084108ac62bc36e9eb4b006389da1e 100644 (file)
                                {
                                        #define X() \
                                                MACRO_BEGIN \
-                                               { \
                                                        float atten = (CS(msg_entity).cvar_cl_voice_directional == 1) ? ATTEN_MIN : ATTEN_NONE; \
                                                        if (gs) globalsound(MSG_ONE, this, gs, r, chan, vol, atten); \
                                                        else if (ps) playersound(MSG_ONE, this, ps, r, chan, vol, atten); \
                                                        else soundto(MSG_ONE, this, chan, sample, vol, atten); \
-                                               MACRO_END
+                                               MACRO_END
 
                                        if (fake) { msg_entity = this; X(); }
                                        else
                                        if (voicetype == VOICETYPE_AUTOTAUNT) tauntrand = random();
                                        #define X() \
                                                MACRO_BEGIN \
-                                               { \
                                                        if (voicetype != VOICETYPE_AUTOTAUNT || tauntrand < CS(msg_entity).cvar_cl_autotaunt) \
                                                        { \
                                                                float atten = (CS(msg_entity).cvar_cl_voice_directional >= 1) \
                                                                else if (ps) playersound(MSG_ONE, this, ps, r, chan, vol, atten); \
                                                                else soundto(MSG_ONE, this, chan, sample, vol, atten); \
                                                        } \
-                                               MACRO_END
+                                               MACRO_END
                                        if (fake)
                                        {
                                                msg_entity = this;
index 8c6dd86ddcd717571f32c53295f2e344083e5fb2..8b1570f030053124aae84b13ee04ba92394ff471 100644 (file)
@@ -129,7 +129,6 @@ string GlobalSound_sample(string pair, float r);
        #define PlayerSound(this, def, chan, vol, voicetype) _GlobalSound(this, NULL, def, string_null, chan, vol, voicetype, false)
        #define VoiceMessage(this, def, msg) \
                MACRO_BEGIN \
-               { \
                        entity VM = def; \
                        int voicetype = VM.m_playersoundvt; \
                        bool ownteam = (voicetype == VOICETYPE_TEAMRADIO); \
@@ -139,7 +138,7 @@ string GlobalSound_sample(string pair, float r);
                        else if (flood > 0) fake = false; \
                        else break; \
                        _GlobalSound(this, NULL, VM, string_null, CH_VOICE, VOL_BASEVOICE, voicetype, fake); \
-               MACRO_END
+               MACRO_END
 
 #endif
 
index f8950684b4967eabaa9990de93a7e53746d8f0cc..1b0f8a7bd89128fccc844f0fc05ccdf243608b91 100644 (file)
@@ -31,14 +31,14 @@ void GameRules_limit_fallbacks();
  * @param spprio player score priority (if frags aren't enabled)
  * @param stprio team score priority (if frags aren't enabled)
  */
-#define GameRules_scoring(teams, spprio, stprio, fields) MACRO_BEGIN \
+#define GameRules_scoring(teams, spprio, stprio, fields) MACRO_BEGIN \
     _GameRules_scoring_begin((teams), (spprio), (stprio)); \
     noref void(entity, string, float) field = _GameRules_scoring_field; \
     /* todo: just have the one `field` function */ \
     noref void(int, string, float) field_team = _GameRules_scoring_field_team; \
     LAMBDA(fields); \
     _GameRules_scoring_end(); \
-MACRO_END
+MACRO_END
 
 void _GameRules_scoring_begin(int teams, float spprio, float stprio);
 void _GameRules_scoring_field(entity i, string label, int scoreflags);
index 40a1134fb536deb0d14583f8d895f5ad11462eb0..64fdff73bf0ef1d9f878deefceca88832e6c3f10 100644 (file)
@@ -591,14 +591,14 @@ void _MapInfo_Map_ApplyGametypeEx(string s, Gametype pWantedType, Gametype pThis
 
 Gametype MapInfo_Type_FromString(string t)
 {
-#define deprecate(from, to) MACRO_BEGIN \
+#define deprecate(from, to) MACRO_BEGIN \
        if (t == #from) { \
                string replacement = #to; \
                if(WARN_COND) \
                        LOG_WARNF("MapInfo_Type_FromString (probably %s): using deprecated name '%s'. Should use '%s'.", MapInfo_Map_bspname, t, replacement); \
                t = replacement; \
        } \
-MACRO_END
+MACRO_END
        deprecate(nexball, nb);
        deprecate(freezetag, ft);
        deprecate(keepaway, ka);
index 770c9f05d69c4d7b15d1d2b0a7bb4879bfae3a13..b9a69caf93ea75990fe7c50b2640c62d74d9de13 100644 (file)
@@ -283,7 +283,7 @@ STATIC_INIT_LATE(Mutators) {
 #define MUTATOR_ONREMOVE                if (mode == MUTATOR_REMOVING)
 #define MUTATOR_ONROLLBACK_OR_REMOVE    if (mode == MUTATOR_REMOVING || mode == MUTATOR_ROLLING_BACK)
 
-#define MUTATOR_STATIC() MACRO_BEGIN \
+#define MUTATOR_STATIC() MACRO_BEGIN \
     MUTATOR_ONADD { \
         /* game loads at time 1 */ \
         if (time > 1) { \
@@ -294,7 +294,7 @@ STATIC_INIT_LATE(Mutators) {
                LOG_INFO("This is a game type and it cannot be removed at runtime."); \
                return -1; \
        } \
-MACRO_END
+MACRO_END
 
 #define MUTATOR_ADD(name)               Mutator_Add(MUTATOR_##name)
 #define MUTATOR_REMOVE(name)            Mutator_Remove(MUTATOR_##name)
@@ -318,7 +318,7 @@ STATIC_INIT_LATE(Mutators) {
     bool mut##_##cb() { return = false; } \
     ACCUMULATE bool mut##_##cb()
 
-#define MUTATOR_HOOK(cb, func, order) MACRO_BEGIN \
+#define MUTATOR_HOOK(cb, func, order) MACRO_BEGIN \
     MUTATOR_ONADD { \
         if (!CallbackChain_Add(HOOK_##cb, CB_##func, order)) { \
             LOG_INFO("HOOK FAILED: ", #cb, ":", #func); \
@@ -328,6 +328,6 @@ STATIC_INIT_LATE(Mutators) {
     MUTATOR_ONROLLBACK_OR_REMOVE { \
         CallbackChain_Remove(HOOK_##cb, CB_##func); \
     } \
-MACRO_END
+MACRO_END
 
 #include "events.qh"
index 0245cee640f1e9437af91804340e9f0fbb737ba3..4591d25bff9b1d41024a0ee838ab233d42c5c72d 100644 (file)
@@ -1,8 +1,8 @@
 #ifdef GAMEQC
-#define NADE_PROJECTILE(i, projectile, trail) MACRO_BEGIN \
+#define NADE_PROJECTILE(i, projectile, trail) MACRO_BEGIN \
     this.m_projectile[i] = projectile; \
     this.m_trail[i] = trail; \
-MACRO_END
+MACRO_END
 #else
 #define NADE_PROJECTILE(i, projectile, trail)
 #endif
index 20d1351ebcae9475043db8b86de15a2df2df370d..1d10cf94fb8249a9fbaef77fb57e8c25feb004f4 100644 (file)
@@ -80,7 +80,10 @@ void cl_notice_run()
     drawfill(v1, v2, '0.5 0.5 0.5', 0.5, DRAWFLAG_NORMAL);
 
     vector v3 = v1 + '10 10 0';
-    #define OUT(s, z) MACRO_BEGIN { drawcolorcodedstring(v3, s, '1 1 0' * z, 1, DRAWFLAG_NORMAL); v3.y += z + 4; } MACRO_END
+       #define OUT(s, z) MACRO_BEGIN \
+               drawcolorcodedstring(v3, s, '1 1 0' * z, 1, DRAWFLAG_NORMAL); \
+               v3.y += z + 4; \
+       MACRO_END
 
     float cur_time = 0;
     float time_width = 48;
index 644d049d38e8d92c6f86ad49c8e3487fd5092380..6a4cf814708f7d4b65e767fa2a79edeace46ea3f 100644 (file)
@@ -608,7 +608,7 @@ void Create_Notification_Entity_InfoCenter(entity notif,
                                // ======================
                                //  Process Notif String
                                // ======================
-                               #define SET_NOTIF_STRING(string,stringname) MACRO_BEGIN \
+                               #define SET_NOTIF_STRING(string,stringname) MACRO_BEGIN \
                                        notif.nent_string = strzone(CCR( \
                                                Process_Notif_Line( \
                                                        typeId, \
@@ -619,7 +619,7 @@ void Create_Notification_Entity_InfoCenter(entity notif,
                                                        stringname \
                                                )) \
                                        ); \
-                               MACRO_END
+                               MACRO_END
 
                                if(GENTLE)
                                {
@@ -777,20 +777,20 @@ void Notification_GetCvars(entity this)
 /** used to output notifications.cfg file */
 void Dump_Notifications(int fh, bool alsoprint)
 {
-       #define NOTIF_WRITE(a) MACRO_BEGIN \
+       #define NOTIF_WRITE(a) MACRO_BEGIN \
                fputs(fh, a); \
                if (alsoprint) LOG_INFO(a); \
-       MACRO_END
+       MACRO_END
 
-       #define NOTIF_WRITE_ENTITY(e, description) MACRO_BEGIN \
+       #define NOTIF_WRITE_ENTITY(e, description) MACRO_BEGIN \
                string notif_msg = sprintf( \
                        "seta notification_%s \"%d\" \"%s\"\n", \
                        Get_Notif_CvarName(e), e.nent_default, description \
                ); \
                NOTIF_WRITE(notif_msg); \
-       MACRO_END
+       MACRO_END
 
-       #define NOTIF_WRITE_ENTITY_CHOICE(e, descriptiona, descriptionb) MACRO_BEGIN \
+       #define NOTIF_WRITE_ENTITY_CHOICE(e, descriptiona, descriptionb) MACRO_BEGIN \
                string notif_msg = sprintf( \
                        "seta notification_%s \"%d\" \"%s\"\n" \
                        "seta notification_%s_ALLOWED \"%d\" \"%s\"\n", \
@@ -798,15 +798,15 @@ void Dump_Notifications(int fh, bool alsoprint)
                        Get_Notif_CvarName(e), e.nent_challow_def, descriptionb \
                ); \
                NOTIF_WRITE(notif_msg); \
-       MACRO_END
+       MACRO_END
 
-       #define NOTIF_WRITE_HARDCODED(cvar, default, description) MACRO_BEGIN \
+       #define NOTIF_WRITE_HARDCODED(cvar, default, description) MACRO_BEGIN \
                string notif_msg = sprintf( \
                        "seta notification_%s \"%s\" \"%s\"\n", \
                        cvar, default, description \
                ); \
                NOTIF_WRITE(notif_msg); \
-       MACRO_END
+       MACRO_END
 
        // Note: This warning only applies to the notifications.cfg file that is output...
        // You ARE supposed to manually edit this function to add i.e. hard coded
@@ -1603,7 +1603,7 @@ void Send_Notification(
                //   2. Manually handling each separate call on per-usage basis (See old CTF usage of verbose)
                entity found_choice;
 
-               #define RECURSE_FROM_CHOICE(ent,action) MACRO_BEGIN \
+               #define RECURSE_FROM_CHOICE(ent,action) MACRO_BEGIN \
                        if (notif.nent_challow_var && (warmup_stage || (notif.nent_challow_var == 2))) { \
                                switch (CS(ent).msg_choice_choices[net_name.nent_choice_idx]) \
                                { \
@@ -1623,7 +1623,7 @@ void Send_Notification(
                                found_choice.nent_floatcount, \
                                s1, s2, s3, s4, \
                                f1, f2, f3, f4); \
-               MACRO_END
+               MACRO_END
 
                switch (broadcast)
                {
index 6cbf91cc9b3fe185cb1b728b75dc8d273435e612..56442d8be70c73accef5439bb91faa56dacfa5f9 100644 (file)
@@ -441,9 +441,10 @@ string BUFF_NAME(int i);
        ARG_CASE(ARG_CS_SV_HA,  "minigame1_name",find(NULL,netname,s1).descriptor.message) \
        ARG_CASE(ARG_CS_SV_HA,  "minigame1_d",   find(NULL,netname,s1).descriptor.netname)
 
-#define NOTIF_HIT_MAX(count,funcname) MACRO_BEGIN \
+#define NOTIF_HIT_MAX(count,funcname) MACRO_BEGIN \
        if(sel_num == count) { backtrace(sprintf("%s: Hit maximum arguments!\n", funcname)); break; } \
-} MACRO_END
+MACRO_END
+
 #define NOTIF_HIT_UNKNOWN(token,funcname) { backtrace(sprintf("%s: Hit unknown token in selected string! '%s'\n", funcname, selected)); break; }
 
 #define KILL_SPREE_LIST \
index 49cfb4488c9e478f7bf90dddf95c7787a143d62e..b3eb1ea861397547734d91eaef173e8f1f9b59a1 100644 (file)
@@ -41,11 +41,10 @@ const float VOL_MUFFLED = 0.35;
 #ifdef SVQC
        #define _sound(e, c, s, v, a) \
                MACRO_BEGIN \
-               { \
                        entity __e = e; \
                        if (sound_allowed(MSG_BROADCAST, __e)) \
                                sound7(__e, c, s, v, a, 0, 0); \
-               MACRO_END
+               MACRO_END
 #else
        #define _sound(e, c, s, v, a) sound7(e, c, s, v, a, 0, 0)
 #endif
@@ -65,7 +64,6 @@ const float VOL_MUFFLED = 0.35;
  */
 #define sound8(e, o, chan, samp, vol, atten, speed, sf) \
        MACRO_BEGIN \
-       { \
                entity __e; \
                int __chan = chan; \
                string __samp = samp; \
@@ -90,7 +88,7 @@ const float VOL_MUFFLED = 0.35;
                        setorigin(__e, old_origin); \
                        setsize(__e, old_mins, old_maxs); \
                } \
-       MACRO_END
+       MACRO_END
 
 string _Sound_fixpath(string base)
 {
index 9489843654f89db445a844973a14b6cd270f8e65..883082c97d02ed22df2c6910c1123542f2d09818 100644 (file)
@@ -14,10 +14,10 @@ int WEP_CONFIG_COUNT;
        config_queue[WEP_CONFIG_COUNT] = a; \
        ++WEP_CONFIG_COUNT; }
 
-#define WEP_CONFIG_WRITETOFILE(a) MACRO_BEGIN \
+#define WEP_CONFIG_WRITETOFILE(a) MACRO_BEGIN \
        fputs(wep_config_file, a); \
        if(wep_config_alsoprint) { LOG_INFO(a); } \
-MACRO_END
+MACRO_END
 
 
 #define WEP_CONFIG_WRITE_CVARS(wepname, name, T) WEP_CONFIG_WRITE_PROPS_##T(wepname, name)
index 0bed40bbf081fcd3c784719cc463c0db1be14dcb..ab74531605f29a44d7f69c23b7ba99e4f30a3479 100644 (file)
@@ -162,14 +162,14 @@ void make_safe_for_remove(entity this);
     #define objerror_safe(e) make_safe_for_remove(e)
 #endif
 
-#define objerror(this, msg) MACRO_BEGIN \
+#define objerror(this, msg) MACRO_BEGIN \
        LOG_WARN("======OBJECT ERROR======"); \
        entity _e = (this); \
        eprint(_e); \
        objerror_safe(_e); \
        delete(_e); \
        LOG_WARNF("%s OBJECT ERROR in %s:\n%s\nTip: read above for entity information", PROGNAME, __FUNC__, msg); \
-MACRO_END
+MACRO_END
 
 #ifdef MENUQC
        void _m_init();
index 18305177bf8a266261e1be9ad143dfde695fcace..a10dcaa7b919b0c60299393c715bdfb6d1130b5f 100644 (file)
@@ -6,7 +6,6 @@ USING(ArrayList, entity);
 
 #define AL_NEW(this, n, default, T) \
        MACRO_BEGIN \
-       { \
                ArrayList _al = this = new_pure(ArrayList); \
                _al.al_buf = buf_create(); \
                for (int i = 0, _n = _al.al_len = n; i < _n; ++i) \
@@ -14,15 +13,14 @@ USING(ArrayList, entity);
                        const _AL_type__##T() it = default; \
                        AL_set##T(this, i, it); \
                } \
-       MACRO_END
+       MACRO_END
 
 #define AL_DELETE(this) \
        MACRO_BEGIN \
-       { \
                buf_del(this.al_buf); \
                delete(this); \
                this = NULL; \
-       MACRO_END
+       MACRO_END
 
 #define _AL_type__s() string
 #define AL_gets(this, idx) bufstr_get(this.al_buf, idx)
@@ -60,11 +58,10 @@ entity al_ftoe(int i) = #80;
 
 #define AL_EACH(this, T, cond, body) \
        MACRO_BEGIN \
-       { \
                const noref ArrayList _al = this; \
                for (int i = 0, n = _al.al_len; i < n; ++i) \
                { \
                        const noref _AL_type__##T() it = AL_get##T(_al, i); \
                        if (cond) { body } \
                } \
-       MACRO_END
+       MACRO_END
index fc0e080eae32fa103333559653d439a403895cb2..9b721a9ba42e96add17111001747949bc89763f0 100644 (file)
@@ -146,27 +146,24 @@ void IL_REMOVE(IntrusiveList this, entity it)
  */
 #define IL_CLEAR(this) \
        MACRO_BEGIN \
-       { \
                IntrusiveList __il = this; \
                assert(__il); \
                .entity il_prev = __il.il_prevfld; \
                IL_EACH(__il, true, it.(il_next) = it.(il_prev) = NULL); \
                __il.il_head = __il.il_tail = NULL; \
-       MACRO_END
+       MACRO_END
 
 /**
  * Delete the list
  */
 #define IL_DELETE(this) \
        MACRO_BEGIN \
-       { \
                delete(this); \
                this = NULL; \
-       MACRO_END
+       MACRO_END
 
 #define IL_EACH(this, cond, body) \
        MACRO_BEGIN \
-       { \
                IntrusiveList _il = this; \
                assert(_il); \
                .entity il_next = _il.il_nextfld; \
@@ -177,7 +174,7 @@ void IL_REMOVE(IntrusiveList this, entity it)
                        _next = it.(il_next); \
                        if (cond) { LAMBDA(body) } \
                } \
-       MACRO_END
+       MACRO_END
 
 .int il_id;
 IntrusiveList il_links[IL_MAX];
index e3cf7410fba38b7177f6d6ee6c928c5f9e7ce122..4eae6d5d393ccc6e9e33453a33b0658c1a557c80 100644 (file)
@@ -8,20 +8,18 @@
 
 #define FOREACH_ARRAY(arr, start, end, cond, body) \
        MACRO_BEGIN \
-       { \
                for (int _i = start; _i < end; ++_i) \
                { \
                        const noref int i = _i; \
                        ITER_CONST noref entity it = arr[i]; \
                        if (cond) { LAMBDA(body) } \
                } \
-       MACRO_END
+       MACRO_END
 
 #define FOREACH(list, cond, body) FOREACH_LIST(list, enemy, cond, body)
 
 #define FOREACH_LIST(list, next, cond, body) \
        MACRO_BEGIN \
-       { \
                int _i = 0; \
                for (entity _it = list##_first, _next = NULL; _it; (_it = _next, ++_i)) \
                { \
                        _next = _it.next; \
                        if (cond) { LAMBDA(body) } \
                } \
-       MACRO_END
+       MACRO_END
 
 #define FOREACH_WORD(words, cond, body) \
        MACRO_BEGIN \
-       { \
                string _words = words; \
                int _i = 0; \
                for (string _it; (_it = car(_words)); (_words = cdr(_words), ++_i)) \
                        const noref string it = _it; \
                        if (cond) { LAMBDA(body) } \
                } \
-       MACRO_END
+       MACRO_END
 
 #define STRING_ITERATOR(this, s, i) \
        string this##_s = s; \
        int this##_i = i
 
 #define STRING_ITERATOR_SET(this, s, i) \
-       MACRO_BEGIN \
+       MACRO_BEGIN \
                this##_s = s; \
                this##_i = i; \
-       MACRO_END
+       MACRO_END
 
 #define STRING_ITERATOR_GET(this) str2chr(this##_s, this##_i++)
 #define STRING_ITERATOR_PEEK(this) str2chr(this##_s, this##_i)
@@ -64,7 +61,6 @@
 
 #define FOREACH_CHAR(s, cond, body) \
        MACRO_BEGIN \
-       { \
                STRING_ITERATOR(iter, s, 0); \
                int _it; \
                while ((_it = STRING_ITERATOR_GET(iter)) > 0) \
@@ -72,7 +68,7 @@
                        const noref int it = _it; \
                        if (cond) { LAMBDA(body) } \
                } \
-       MACRO_END
+       MACRO_END
 
 #if defined(CSQC)
     entity(entity start, .string fld, string match) _findstring = #18;
 
 #define ORDERED(F) F##_UNORDERED
 #define _FOREACH_ENTITY_FIND_ORDERED(T, fld, match, cond, body) \
-    MACRO_BEGIN \
+    MACRO_BEGIN \
         int _i = 0; \
         for (entity _it = NULL; (_it = _find##T(_it, fld, match)); ++_i) \
         { \
             ITER_CONST noref entity it = _it; \
             if (cond) LAMBDA(body) \
         } \
-    MACRO_END
+    MACRO_END
 #define MUTEX_LOCK(this) MACRO_BEGIN \
        if (this) LOG_SEVEREF("Loop mutex held by %s", this); \
        this = __FUNC__; \
@@ -131,16 +127,16 @@ MACRO_END
        this = string_null; \
 MACRO_END
 #define _FOREACH_ENTITY_FIND_UNORDERED(id, T, fld, match, cond, body) \
-       MACRO_BEGIN \
+       MACRO_BEGIN \
                MUTEX_LOCK(_FOREACH_ENTITY_FIND_##T##_##id##mutex); \
                entity _foundchain_first = _findchain##T##_tofield(fld, match, _FOREACH_ENTITY_FIND_##T##_next##id); \
                FOREACH_LIST(_foundchain, _FOREACH_ENTITY_FIND_##T##_next##id, cond, body); \
                MUTEX_UNLOCK(_FOREACH_ENTITY_FIND_##T##_##id##mutex); \
-       MACRO_END
+       MACRO_END
 
 #define FOREACH_ENTITY(cond, body) ORDERED(FOREACH_ENTITY)(cond, body)
 #define FOREACH_ENTITY_ORDERED(cond, body) \
-       MACRO_BEGIN \
+       MACRO_BEGIN \
                int _i = 0; \
                for (entity _it = NULL; (_it = nextent(_it)); ++_i) \
                { \
@@ -148,7 +144,7 @@ MACRO_END
                        ITER_CONST noref entity it = _it; \
                        if (cond) LAMBDA(body) \
                } \
-       MACRO_END
+       MACRO_END
 /** marker field, always NULL */
 .entity _FOREACH_ENTITY_fld;
 .entity _FOREACH_ENTITY_FIND_entity_nextall; noref string _FOREACH_ENTITY_FIND_entity_allmutex;
index 0dd430722f755218f5f796883a5dcf4317caf885..aa7d7c9517179a05d06e16ff93788b42f4d4929e 100644 (file)
@@ -49,7 +49,6 @@ entity LL_POP(LinkedList this)
 #define LL_CLEAR_1(this) LL_CLEAR_2(this, LAMBDA())
 #define LL_CLEAR_2(this, dtor) \
        MACRO_BEGIN \
-       { \
                LinkedList _ll = this; \
                assert(_ll); \
                while (_ll.ll_tail) \
@@ -59,26 +58,24 @@ entity LL_POP(LinkedList this)
                        dtor \
                        delete(it); \
                } \
-       MACRO_END
+       MACRO_END
 
 #define LL_DELETE(...) EVAL_LL_DELETE(OVERLOAD(LL_DELETE, __VA_ARGS__))
 #define EVAL_LL_DELETE(...) __VA_ARGS__
 #define LL_DELETE_1(this) LL_DELETE_2(this, LAMBDA())
 #define LL_DELETE_2(this, dtor) \
        MACRO_BEGIN \
-       { \
                LL_CLEAR_2(this, dtor); \
                delete(this); \
                this = NULL; \
-       MACRO_END
+       MACRO_END
 
 #define LL_EACH(list, cond, body) \
        MACRO_BEGIN                                                         \
-       {                                                                   \
                noref int i = 0;                                                \
                for (entity _it = list.ll_head; _it; (_it = _it.ll_next, ++i))  \
                {                                                               \
                        ITER_CONST noref entity it = _it.ll_data;                   \
                        if (cond) { body }                                          \
                }                                                               \
-       MACRO_END
+       MACRO_END
index 7491818b24ad309e7f0564efd5fb228326aa032c..b751bfb2a836e8eb298e2201d50fd33f202f9386 100644 (file)
@@ -6,14 +6,14 @@
 #define devassert(...) MACRO_BEGIN if (autocvar_developer) assert(__VA_ARGS__); MACRO_END
 
 #define assert_once(expr, ...) \
-       MACRO_BEGIN \
+       MACRO_BEGIN \
                static bool __once; \
                if (!__once) \
                { \
                        assert(expr, __VA_ARGS__); \
                        __once = true; \
                } \
-       MACRO_END
+       MACRO_END
 #define devassert_once(...) MACRO_BEGIN if (autocvar_developer) assert_once(__VA_ARGS__); MACRO_END
 
 #define demand(expr, ...) _assert(LOG_FATAL, expr, __VA_ARGS__)
 
 #define _assert(f, expr, then) \
        MACRO_BEGIN \
-       { \
                if (!(expr)) \
                { \
                        f("assertion failed: `" #expr "`\n"); \
                        then; \
                } \
-       MACRO_END
+       MACRO_END
 
 #define ASSERT_LESS(name, var, const) noref int name[(const - var + 1)];
 
@@ -48,9 +47,9 @@ string(string, string...) strcat1n = #115;
 
 #define _LOG_HEADER(level) "^9[::" "^7"PROGNAME"^9" "::" level"^9" "] ", __SOURCELOC__
 #define _LOG(f, level, s) \
-       MACRO_BEGIN \
+       MACRO_BEGIN \
                f(strcat1n(_LOG_HEADER(level), "\n^7", s, "\n")); \
-       MACRO_END
+       MACRO_END
 
 #define  LOG_FATAL(...) _LOG_FATAL(strcat1n(__VA_ARGS__))
 #define  LOG_FATALF(...) _LOG_FATAL(sprintf(__VA_ARGS__))
@@ -67,13 +66,13 @@ string(string, string...) strcat1n = #115;
 #define  LOG_INFO(...) _LOG_INFO(strcat1n(__VA_ARGS__))
 #define  LOG_INFOF(...) _LOG_INFO(sprintf(__VA_ARGS__))
 #define _LOG_INFO(s) \
-       MACRO_BEGIN \
+       MACRO_BEGIN \
                dprint(_LOG_HEADER("^5INFO")); \
                string __s = s; \
                print("\n^7", __s); \
                /* TODO: unconditionally add a newline when possible */ \
                if (str2chr(__s, strlen(__s) - 1) != '\n') { print("\n"); } \
-       MACRO_END
+       MACRO_END
 
 #define  LOG_TRACE(...) _LOG_TRACE(strcat1n(__VA_ARGS__))
 #define  LOG_TRACEF(...) _LOG_TRACE(sprintf(__VA_ARGS__))
@@ -84,9 +83,9 @@ string(string, string...) strcat1n = #115;
 #define _LOG_DEBUG(s) _LOG(dprint2, "^2DEBUG", s)
 
 #define dprint2(msg) \
-       MACRO_BEGIN \
+       MACRO_BEGIN \
                if (autocvar_developer > 1) dprint(msg); \
-       MACRO_END
+       MACRO_END
 
 // TODO: this sucks, lets find a better way to do backtraces?
 #define _backtrace() builtin_remove(NULL)
@@ -102,7 +101,6 @@ noref bool autocvar_prvm_backtraceforwarnings;
 
 #define backtrace(msg) \
        MACRO_BEGIN \
-       { \
                int dev = autocvar_developer; \
                bool war = autocvar_prvm_backtraceforwarnings; \
                bt_cvar_set("developer", "1"); \
@@ -112,4 +110,4 @@ noref bool autocvar_prvm_backtraceforwarnings;
                print("\n--- CUT UNTIL HERE ---\n"); \
                bt_cvar_set("developer", ftos(dev)); \
                bt_cvar_set("prvm_backtraceforwarnings", ftos(war)); \
-       MACRO_END
+       MACRO_END
index cbb1079244d2ef5a6806f94387a8826380dc9589..474484c64e5f85aa279835a1826983c1eb0b080f 100644 (file)
@@ -39,9 +39,8 @@
 // With block may not contain continue or break
 #define WITH(type, name, value, block) \
        MACRO_BEGIN \
-       { \
                type __with_save = (name); \
                name = (value); \
                LAMBDA(block) \
                name = __with_save; \
-       MACRO_END
+       MACRO_END
index 7b3f581b38f059cd4e4252905ae0dcf243983209..7495fb135e4387244f1634d2a4fa92f38cbc9b9b 100644 (file)
@@ -187,13 +187,13 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
        const int MSG_C2S = 0;
 
        #define Net_Accept(classname) \
-               MACRO_BEGIN \
-                       if (!this)    this = new(classname); \
-               MACRO_END
+               MACRO_BEGIN \
+                       if (!this) this = new(classname); \
+               MACRO_END
        #define Net_Reject() \
-               MACRO_BEGIN \
-                       if (this)     delete(this); \
-               MACRO_END
+               MACRO_BEGIN \
+                       if (this) delete(this); \
+               MACRO_END
 
        string g_buf;
 
@@ -207,16 +207,14 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
 
 #if defined(CSQC)
        #define WriteHeader(to, id) \
-               MACRO_BEGIN { \
-                       WriteByte(to, NET_##id.m_id); \
-               } MACRO_END
+               WriteByte(to, NET_##id.m_id)
 #elif defined(SVQC)
        #define WriteHeader(to, id) \
-               MACRO_BEGIN \
+               MACRO_BEGIN \
                        if (NET_##id##_istemp) WriteByte(to, SVC_TEMPENTITY); \
                        WriteByte(to, NET_##id.m_id); \
                        bool _net_valid = false; serialize_marker(to, _net_valid); \
-               MACRO_END
+               MACRO_END
 #endif
 
 // serialization: new style
@@ -386,9 +384,9 @@ MACRO_END
                        WriteInt24_t(dst, val.z);
                }
 
-        #define WriteFloat(to, f) WriteCoord(to, f)
-               #define WriteVector(to, v) MACRO_BEGIN { WriteFloat(to, v.x); WriteFloat(to, v.y); WriteFloat(to, v.z); } MACRO_END
-        #define WriteVector2D(to, v) MACRO_BEGIN { WriteFloat(to, v.x); WriteFloat(to, v.y); } MACRO_END
+               #define WriteFloat(to, f) WriteCoord(to, f)
+               #define WriteVector(to, v) MACRO_BEGIN WriteFloat(to, v.x); WriteFloat(to, v.y); WriteFloat(to, v.z); MACRO_END
+               #define WriteVector2D(to, v) MACRO_BEGIN WriteFloat(to, v.x); WriteFloat(to, v.y); MACRO_END
 
                // this will use the value:
                //   128
@@ -413,7 +411,7 @@ MACRO_END
                }
 
                // allow writing to also pass through to spectators (like so spectators see the same centerprints as players for example)
-               #define WRITESPECTATABLE_MSG_ONE(to, statement) MACRO_BEGIN \
+               #define WRITESPECTATABLE_MSG_ONE(to, statement) MACRO_BEGIN \
                        entity prev = msg_entity; \
                        entity dst = to; \
                        FOREACH_CLIENT(IS_REAL_CLIENT(it), { \
@@ -424,6 +422,6 @@ MACRO_END
                                } \
                        }); \
                        msg_entity = prev; \
-               MACRO_END
+               MACRO_END
        #endif
 #endif
index e482d7d9ac9b1afab49ae9279ced927e0aa5ce4e..b91a6d18988e6fd1083bf89370ea506eb6edb52d 100644 (file)
@@ -75,13 +75,13 @@ ACCUMULATE void ONREMOVE(entity this) {}
 #endif
 
 .void(entity this) dtor;
-#define delete(this) MACRO_BEGIN \
+#define delete(this) MACRO_BEGIN \
     entity _this = (this); \
     void(entity) _dtor = _this.dtor; \
     ONREMOVE(this); \
     if (_dtor) _dtor(_this); else delete_fn(_this); \
     /* this = NULL; */  \
-MACRO_END
+MACRO_END
 
 entity _clearentity_ent;
 STATIC_INIT(clearentity)
index 520b00c06342ca095fb79560e9793cee11a3b64d..163ca17b40033190ff312f703dce90843011e8bc 100644 (file)
@@ -89,20 +89,20 @@ REGISTRY(Registries, BITS(8))
        ACCUMULATE_FUNCTION(_Register##registry, Register_##id) \
        REGISTER_INIT(id)
 
-#define REGISTRY_PUSH(registry, fld, it) MACRO_BEGIN \
+#define REGISTRY_PUSH(registry, fld, it) MACRO_BEGIN \
        it.fld = registry##_COUNT; \
        _R_SET(_##registry, registry##_COUNT, it); \
        ++registry##_COUNT; \
        if (!registry##_first) registry##_first = it; \
        if (registry##_last)   registry##_last.REGISTRY_NEXT = it; \
        registry##_last = it; \
-MACRO_END
+MACRO_END
 
-#define REGISTRY_RESERVE(registry, fld, id, suffix) MACRO_BEGIN \
+#define REGISTRY_RESERVE(registry, fld, id, suffix) MACRO_BEGIN \
        entity e = new_pure(registry_reserved); \
        e.registered_id = #id "/" #suffix; \
        REGISTRY_PUSH(registry, fld, e); \
-MACRO_END
+MACRO_END
 
 #define REGISTER_INIT(id) ACCUMULATE void Register_##id##_init(entity this)
 
index 565ebb29c81513276a8f49334cfebd2589cb0986..cd0000912dfcfb65b715bcfabebf889d29144adc 100644 (file)
@@ -10,16 +10,14 @@ void heapsort(int n, swapfunc_t swap, comparefunc_t cmp, entity pass)
 {
        #define heapify(_count) \
                MACRO_BEGIN \
-               { \
                        for (int start = floor(((_count) - 2) / 2); start >= 0; --start) \
                        { \
                                siftdown(start, (_count) - 1); \
                        } \
-               MACRO_END
+               MACRO_END
 
        #define siftdown(_start, _end) \
                MACRO_BEGIN \
-               { \
                        for (int root = (_start); root * 2 + 1 <= (_end); ) \
                        { \
                                int child = root * 2 + 1; \
@@ -28,7 +26,7 @@ void heapsort(int n, swapfunc_t swap, comparefunc_t cmp, entity pass)
                                swap(root, child, pass); \
                                root = child; \
                        } \
-               MACRO_END
+               MACRO_END
 
        heapify(n);
        int end = n - 1;
index 03bd34b813af0714b0380c0aa3ea423713b86bd3..b11fedec90ab444f5d2c00dfe380ae3cfecbbd10 100644 (file)
@@ -73,16 +73,16 @@ int g_magic_stats_hole = 0;
        #define addstat_int(id, fld) addstat(id, AS_INT, fld)
        #define addstat_bool(id, fld) addstat(id, AS_INT, fld)
        #define addstat_float(id, fld) addstat(id, AS_FLOAT, fld)
-       #define addstat_vector(id, fld) MACRO_BEGIN \
+       #define addstat_vector(id, fld) MACRO_BEGIN \
                addstat_float(id + 0, fld##_x); \
                addstat_float(id + 1, fld##_y); \
                addstat_float(id + 2, fld##_z); \
-       MACRO_END
-       #define addstat_vectori(id, fld) MACRO_BEGIN \
+       MACRO_END
+       #define addstat_vectori(id, fld) MACRO_BEGIN \
                addstat_int(id + 0, fld##_x); \
                addstat_int(id + 1, fld##_y); \
                addstat_int(id + 2, fld##_z); \
-       MACRO_END
+       MACRO_END
        const int AS_STRING = 1;
        const int AS_INT = 2;
        const int AS_FLOAT = 8;
index 8d8de76ec6119abecd88093b0bd52bd8e1bb08e3..e806db754735d03b4e57e7a02193392682663bc7 100644 (file)
 #define SUCCEED() (TEST_ok = true)
 
 /** Add a failure, but continue */
-#define ADD_FAILURE(msg) MACRO_BEGIN { ++TEST_failed; LOG_WARN(msg); } MACRO_END
+#define ADD_FAILURE(msg) MACRO_BEGIN \
+       ++TEST_failed; \
+       LOG_WARN(msg); \
+MACRO_END
 
 /** Add a failure and return */
 #define FAIL(msg) _TEST_ASSERT(ADD_FAILURE(msg))
@@ -26,7 +29,7 @@ bool RUN_ALL_TESTS();
 
 // difference between expect/assert: assert returns early
 
-#define EXPECT_EQ(expected_, actual_) MACRO_BEGIN \
+#define EXPECT_EQ(expected_, actual_) MACRO_BEGIN \
        int expected = expected_; \
        int actual = actual_; \
        if ((expected) != (actual)) { \
@@ -37,7 +40,7 @@ bool RUN_ALL_TESTS();
                        actual, expected \
                )); \
        } \
-MACRO_END
+MACRO_END
 #define ASSERT_EQ(expected, actual) _TEST_ASSERT(EXPECT_EQ(expected, actual))
 
 #define EXPECT_TRUE(condition) EXPECT_EQ(true, condition)
@@ -72,18 +75,18 @@ bool TEST_ok;
 int TEST_failed;
 
 #define _TEST_ASSERT(statement) \
-       MACRO_BEGIN \
+       MACRO_BEGIN \
                LAMBDA(statement); \
                ++TEST_fatal; return; \
-       MACRO_END
+       MACRO_END
 
 #define EXPECT_NO_FATAL_FAILURE__(statement, then) \
-       MACRO_BEGIN \
+       MACRO_BEGIN \
                int TEST_prevfatal = TEST_fatal; \
                LAMBDA(statement); \
                if (TEST_fatal != TEST_prevfatal) \
                        LAMBDA(then); \
-       MACRO_END
+       MACRO_END
 
 #define EXPECT_NO_FATAL_FAILURE_(statement, then) \
        EXPECT_NO_FATAL_FAILURE__(statement, { \
index 8340381bab3aff467e543a1fdf1d1c19eacf1463..0d09ea8e6a50767bf181376b671423a9b7918070 100644 (file)
@@ -93,12 +93,12 @@ float boxinsidebox(vector smins, vector smaxs, vector bmins, vector bmaxs) { ret
 #define YAW(v) ((v).y)
 #define ROLL(v) ((v).z)
 
-#define MAKEVECTORS(f, angles, forward, right, up) MACRO_BEGIN \
+#define MAKEVECTORS(f, angles, forward, right, up) MACRO_BEGIN \
        f(angles); \
        forward = v_forward; \
        right = v_right; \
        up = v_up; \
-MACRO_END
+MACRO_END
 
 //pseudo prototypes:
 // vector vec2(vector v); // returns a vector with just the x and y components of the given vector
index a81d0c4fb777a122fabab58222be9677d116d6ff..9958a5df4a4497242afc4b0f7028bba54500be64 100644 (file)
 .float warpzone_teleport_finishtime;
 .entity warpzone_teleport_zone;
 
-#define WarpZone_StoreProjectileData(e_) MACRO_BEGIN \
+#define WarpZone_StoreProjectileData(e_) MACRO_BEGIN \
        entity e = e_; \
        e.warpzone_oldorigin = e.origin; \
        e.warpzone_oldvelocity = e.velocity; \
        e.warpzone_oldangles = e.angles; \
-       MACRO_END
+       MACRO_END
 
 void WarpZone_TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity)
 {
index dce6e9c9d82459022ec231eeb5ee03b3f5e41c0e..e71c68ef63683aa0caeb762f79971c32c83fb577 100644 (file)
@@ -3,7 +3,7 @@
 #include "test.qh"
 
 #define yenc_single(c, ret) \
-       MACRO_BEGIN \
+       MACRO_BEGIN \
                int conv = c; \
                conv += 42; \
                if (conv >= 256) conv -= 256; \
                                break; \
                        } \
                } \
-       MACRO_END
+       MACRO_END
 
 #define ydec_single(stringiter, ret) \
-       MACRO_BEGIN \
+       MACRO_BEGIN \
                int conv = STRING_ITERATOR_GET(stringiter); \
                if (conv <= 0) { \
                        ret = -1; \
@@ -42,7 +42,7 @@
                        conv -= 42; \
                        ret = conv; \
                } \
-       MACRO_END
+       MACRO_END
 
 TEST(yEnc, EncodeDecode)
 {
index f4417171ff6c6e0b1498bad74f73b5ffd5d4f398..8c0468ea0d639733ad06ed5e56412a702968c546 100644 (file)
@@ -18,13 +18,13 @@ void Xonotic_KeyBinds_Read()
 {
        Xonotic_KeyBinds_Count = 0;
 
-       #define KEYBIND_DEF(func, desc) MACRO_BEGIN \
+       #define KEYBIND_DEF(func, desc) MACRO_BEGIN \
                if((Xonotic_KeyBinds_Count < MAX_KEYBINDS)) { \
                        Xonotic_KeyBinds_Functions[Xonotic_KeyBinds_Count] = strzone(func); \
                        Xonotic_KeyBinds_Descriptions[Xonotic_KeyBinds_Count] = strzone(desc); \
                        ++Xonotic_KeyBinds_Count; \
                } \
-       MACRO_END
+       MACRO_END
 
        KEYBIND_DEF(""                                      , _("Moving"));
        KEYBIND_DEF("+forward"                              , _("forward"));
index 9ebcffae3c8383657da46d4b571e24dfcdd92b2a..cf31b4ce62231a7e666f282dddc0fdf0f56ff325 100644 (file)
@@ -215,13 +215,13 @@ void bot_setnameandstuff(entity this)
 
        prio = 6;
 
-       #define READSKILL(f, w, r) MACRO_BEGIN \
+       #define READSKILL(f, w, r) MACRO_BEGIN \
                if(argv(prio) != "") \
                        this.f = stof(argv(prio)) * w; \
                else \
                        this.f = (!autocvar_g_campaign) * (2 * random() - 1) * r * w; \
                prio++; \
-       MACRO_END
+       MACRO_END
        //print(bot_name, ": ping=", argv(9), "\n");
 
        READSKILL(havocbot_keyboardskill, 0.5, 0.5); // keyboard skill
index 4c620c62fd0c55728b5726abba53b04d2d47aef8..394c62d21a334485725765f4873298bb98cc0d7d 100644 (file)
@@ -924,7 +924,7 @@ spawnfunc(worldspawn)
                        s = cons(s, pkg);
                }
                // add automatically managed files to the list
-               #define X(match) MACRO_BEGIN \
+               #define X(match) MACRO_BEGIN \
                        int fd = search_begin(match, true, false); \
                        if (fd >= 0) \
                        { \
@@ -934,7 +934,7 @@ spawnfunc(worldspawn)
                                } \
                                search_end(fd); \
                        } \
-               MACRO_END
+               MACRO_END
                X("*-serverpackage.txt");
                X("*.serverpackage");
                #undef X
index 097685abf1766820a9e3f964928da71172c31d5b..e4dfe2afa4c305e18a15fe644e63a8425dee9364 100644 (file)
@@ -34,14 +34,14 @@ const string STR_OBSERVER = "observer";
 // NOTE: FOR_EACH_REALPLAYER deprecated! Use the following instead: FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), { code; });
 
 #define FOREACH_CLIENTSLOT(cond, body) \
-       MACRO_BEGIN \
+       MACRO_BEGIN \
                for(int _i = 1; _i <= maxclients; ++_i) \
                { \
                        const noref int i = _i; \
                        ITER_CONST noref entity it = ftoe(i); \
                        if(cond) { LAMBDA(body) } \
                } \
-       MACRO_END
+       MACRO_END
 
 #define FOREACH_CLIENT(cond, body) FOREACH_CLIENTSLOT(IS_CLIENT(it) && (cond), LAMBDA(body))
 
@@ -50,7 +50,7 @@ const string STR_OBSERVER = "observer";
 entity _FCR_clients[255];
 bool _FCR_entered = false;
 #define FOREACH_CLIENT_RANDOM(cond, body) \
-       MACRO_BEGIN \
+       MACRO_BEGIN \
                if (_FCR_entered) LOG_FATAL("FOREACH_CLIENT_RANDOM must not be nested"); \
                _FCR_entered = true; \
                int _cnt = 0; \
@@ -74,6 +74,6 @@ bool _FCR_entered = false;
                        if (cond) { LAMBDA(body) } \
                } \
                _FCR_entered = false; \
-       MACRO_END
+       MACRO_END
 
 // NOTE: FOR_EACH_MONSTER deprecated! Use the following instead: IL_EACH(g_monsters, true, { code; });