From: Rudolf Polzer Date: Wed, 27 Oct 2010 13:50:41 +0000 (+0200) Subject: we can get rid of the "hanging ;" warning by calling an empty macro ENDS_WITH_CURLY_B... X-Git-Tag: xonotic-v0.1.0preview~240 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=75f25de6a6bc96b4b1311600f7e2d8fde56f9fe7;p=xonotic%2Fxonotic-data.pk3dir.git we can get rid of the "hanging ;" warning by calling an empty macro ENDS_WITH_CURLY_BRACE at the end of the causing macro. So let's do that instead of totally disabling the warning --- diff --git a/Makefile b/Makefile index 7d2e739d0..9910a39e7 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ DIFF ?= diff FTEQCCFLAGS_WATERMARK ?= -DWATERMARK='"^1$(shell git describe) TEST BUILD"' #FTEQCCFLAGS ?= -Werror -Wno-Q205 -Wno-Q302 -O3 -Ono-c -Ono-cs -flo $(FTEQCCFLAGS_EXTRA) $(FTEQCCFLAGS_WATERMARK) -FTEQCCFLAGS ?= -Wno-Q205 -Wno-Q302 -O3 -Ono-c -Ono-cs -flo $(FTEQCCFLAGS_EXTRA) $(FTEQCCFLAGS_WATERMARK) +FTEQCCFLAGS ?= -Wno-Q302 -O3 -Ono-c -Ono-cs -flo $(FTEQCCFLAGS_EXTRA) $(FTEQCCFLAGS_WATERMARK) FTEQCCFLAGS_PROGS ?= FTEQCCFLAGS_MENU ?= diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 73da7b44c..3d2ba9f2b 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -540,7 +540,9 @@ void HUD_Panel_HlBorder(float myBorder, vector color, float alpha) if(panel_bg != "0")\ draw_BorderPicture(panel_pos - '1 1 0' * panel_bg_border, panel_bg, panel_size + '1 1 0' * 2 * panel_bg_border, panel_bg_color, panel_bg_alpha * alpha, '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER));\ if(highlightedPanel_prev == active_panel && autocvar__hud_configure)\ - HUD_Panel_HlBorder(panel_bg_border + 1.5 * hlBorderSize, '0 0.5 1', 0.25 * (1 - autocvar__menu_alpha) * alpha); +{\ + HUD_Panel_HlBorder(panel_bg_border + 1.5 * hlBorderSize, '0 0.5 1', 0.25 * (1 - autocvar__menu_alpha) * alpha);\ +} ENDS_WITH_CURLY_BRACE void HUD_Panel_DrawProgressBar(vector pos, float vertical, vector mySize, vector color, float alpha, float drawflag) { @@ -1435,7 +1437,7 @@ float weaponspace[10]; #define HUD_Weapons_Clear()\ float idx;\ for(idx = 0; idx < 10; ++idx)\ - weaponspace[idx] = 0; + weaponspace[idx] = 0 entity weaponorder[WEP_MAXCOUNT]; void weaponorder_swap(float i, float j, entity pass) @@ -4286,7 +4288,7 @@ void HUD_Mod_Race(vector pos, vector mySize) } else { // text on top squareSize = min(mySize_x, mySize_y/2); - textPos = pos + eY * 0.5 * max(0, mySize_y/2 - squareSize) + eX * 0.5 * (mySize_x - squareSize);; + textPos = pos + eY * 0.5 * max(0, mySize_y/2 - squareSize) + eX * 0.5 * (mySize_x - squareSize); medalPos = pos + eY * 0.5 * max(0, mySize_y/2 - squareSize) + eY * 0.5 * mySize_y + eX * 0.5 * (mySize_x - squareSize); } @@ -4943,7 +4945,7 @@ switch (id) {\ HUD_EngineInfo(); break;\ case (HUD_PANEL_INFOMESSAGES):\ HUD_InfoMessages(); break;\ -} +} ENDS_WITH_CURLY_BRACE void HUD_Main (void) { diff --git a/qcsrc/client/hud.qh b/qcsrc/client/hud.qh index ca0df8e24..3494e9998 100644 --- a/qcsrc/client/hud.qh +++ b/qcsrc/client/hud.qh @@ -105,7 +105,7 @@ switch(item) {\ case "armor": HUD_Panel_GetProgressBarColor(armor); break;\ case "fuel": HUD_Panel_GetProgressBarColor(fuel); break;\ case "nexball": HUD_Panel_GetProgressBarColor(nexball); break;\ -} +} ENDS_WITH_CURLY_BRACE // Get value for 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... @@ -192,7 +192,7 @@ if(panel_bg_border_str == "") {\ panel_bg_border = autocvar_hud_panel_bg_border;\ } else {\ panel_bg_border = stof(panel_bg_border_str);\ -} +} ENDS_WITH_CURLY_BRACE // Scale the pos and size vectors to absolute coordinates #define HUD_Panel_GetScaledVectors()\ @@ -271,7 +271,7 @@ HUD_Panel_StringVars()\ if(menu_enabled == 2 && active_panel == highlightedPanel) {\ HUD_Panel_GetMenuSize()\ HUD_Panel_GetMenuPos()\ -} +} ENDS_WITH_CURLY_BRACE // Update all common cvars of given panel id #define HUD_Panel_UpdateCvarsForId(id) \ diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index 77b3e0320..f1d283238 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -1,3 +1,6 @@ +// a dummy macro that prevents the "hanging ;" warning +#define ENDS_WITH_CURLY_BRACE + #define ACCUMULATE_FUNCTION(func,otherfunc) \ #ifdef func \ void __merge__##otherfunc() { func(); otherfunc(); } \ @@ -216,7 +219,7 @@ float get_model_parameters(string mod, float skn); // call with string_null to c switch(id) {\ case HUD_PANEL_ENGINEINFO: panel_name = HUD_PANELNAME_ENGINEINFO; break; \ case HUD_PANEL_INFOMESSAGES: panel_name = HUD_PANELNAME_INFOMESSAGES; break; \ -} +} ENDS_WITH_CURLY_BRACE // Get name of specified panel id #define HUD_Panel_GetName(id) \