From 4d0597ad5bdccac0192145a18ad720d36df78b42 Mon Sep 17 00:00:00 2001 From: pigeons Date: Mon, 16 Apr 2018 04:47:24 -0400 Subject: [PATCH 1/2] Parenthesizes some macros (#37212) * parenthesizes some macros * A couple more macro definition parenthesizing --- code/__DEFINES/lighting.dm | 2 +- code/__DEFINES/misc.dm | 14 +++++++------- code/__DEFINES/reagents.dm | 2 +- code/_onclick/click.dm | 2 +- .../machinery/components/unary_devices/tank.dm | 2 +- code/modules/recycling/disposal/bin.dm | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/code/__DEFINES/lighting.dm b/code/__DEFINES/lighting.dm index b7cc207735..9a6ac48090 100644 --- a/code/__DEFINES/lighting.dm +++ b/code/__DEFINES/lighting.dm @@ -4,7 +4,7 @@ #define LIGHTING_FALLOFF 1 // type of falloff to use for lighting; 1 for circular, 2 for square #define LIGHTING_LAMBERTIAN 0 // use lambertian shading for light sources #define LIGHTING_HEIGHT 1 // height off the ground of light sources on the pseudo-z-axis, you should probably leave this alone -#define LIGHTING_ROUND_VALUE 1 / 64 //Value used to round lumcounts, values smaller than 1/129 don't matter (if they do, thanks sinking points), greater values will make lighting less precise, but in turn increase performance, VERY SLIGHTLY. +#define LIGHTING_ROUND_VALUE (1 / 64) //Value used to round lumcounts, values smaller than 1/129 don't matter (if they do, thanks sinking points), greater values will make lighting less precise, but in turn increase performance, VERY SLIGHTLY. #define LIGHTING_ICON 'icons/effects/lighting_object.dmi' // icon used for lighting shading effects diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 03823a1d76..3267a43d5a 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -85,11 +85,11 @@ Will print: "/mob/living/carbon/human/death" (you can optionally embed it in a s //Human Overlay Index Shortcuts for alternate_worn_layer, layers //Because I *KNOW* somebody will think layer+1 means "above" //IT DOESN'T OK, IT MEANS "UNDER" -#define UNDER_SUIT_LAYER SUIT_LAYER+1 +#define UNDER_SUIT_LAYER (SUIT_LAYER+1) //AND -1 MEANS "ABOVE", OK?, OK!?! -#define ABOVE_SHOES_LAYER SHOES_LAYER-1 -#define ABOVE_BODY_FRONT_LAYER BODY_FRONT_LAYER-1 +#define ABOVE_SHOES_LAYER (SHOES_LAYER-1) +#define ABOVE_BODY_FRONT_LAYER (BODY_FRONT_LAYER-1) //Security levels @@ -267,7 +267,7 @@ GLOBAL_LIST_INIT(ghost_others_options, list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE #define APPEARANCE_IGNORE_TRANSFORM RESET_TRANSFORM #define APPEARANCE_IGNORE_COLOUR RESET_COLOR #define APPEARANCE_IGNORE_CLIENT_COLOUR NO_CLIENT_COLOR -#define APPEARANCE_IGNORE_COLOURING RESET_COLOR|NO_CLIENT_COLOR +#define APPEARANCE_IGNORE_COLOURING (RESET_COLOR|NO_CLIENT_COLOR) #define APPEARANCE_IGNORE_ALPHA RESET_ALPHA #define APPEARANCE_NORMAL_GLIDE ~LONG_GLIDE @@ -275,15 +275,15 @@ GLOBAL_LIST_INIT(ghost_others_options, list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE #define APPEARANCE_CONSIDER_TRANSFORM ~RESET_TRANSFORM #define APPEARANCE_CONSIDER_COLOUR ~RESET_COLOUR #define APPEARANCE_CONSIDER_CLIENT_COLOUR ~NO_CLIENT_COLOR -#define APPEARANCE_CONSIDER_COLOURING ~RESET_COLOR|~NO_CLIENT_COLOR +#define APPEARANCE_CONSIDER_COLOURING (~RESET_COLOR|~NO_CLIENT_COLOR) #define APPEARANCE_CONSIDER_ALPHA ~RESET_ALPHA #define APPEARANCE_LONG_GLIDE LONG_GLIDE */ // Consider these images/atoms as part of the UI/HUD -#define APPEARANCE_UI_IGNORE_ALPHA RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR|RESET_ALPHA|PIXEL_SCALE -#define APPEARANCE_UI RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR|PIXEL_SCALE +#define APPEARANCE_UI_IGNORE_ALPHA (RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR|RESET_ALPHA|PIXEL_SCALE) +#define APPEARANCE_UI (RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR|PIXEL_SCALE) //Just space #define SPACE_ICON_STATE "[((x + y) ^ ~(x * y) + z) % 25]" diff --git a/code/__DEFINES/reagents.dm b/code/__DEFINES/reagents.dm index d9e6225eb7..ed815c3393 100644 --- a/code/__DEFINES/reagents.dm +++ b/code/__DEFINES/reagents.dm @@ -14,7 +14,7 @@ #define AMOUNT_VISIBLE 32 // For non-transparent containers that still have the general amount of reagents in them visible. // Is an open container for all intents and purposes. -#define OPENCONTAINER REFILLABLE | DRAINABLE | TRANSPARENT +#define OPENCONTAINER (REFILLABLE | DRAINABLE | TRANSPARENT) #define TOUCH 1 // splashing diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index f69b7e2d21..dfa2a27ded 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -450,7 +450,7 @@ screen_loc = "CENTER" #define MAX_SAFE_BYOND_ICON_SCALE_TILES (MAX_SAFE_BYOND_ICON_SCALE_PX / world.icon_size) -#define MAX_SAFE_BYOND_ICON_SCALE_PX 33 * 32 //Not using world.icon_size on purpose. +#define MAX_SAFE_BYOND_ICON_SCALE_PX (33 * 32) //Not using world.icon_size on purpose. /obj/screen/click_catcher/proc/UpdateGreed(view_size_x = 15, view_size_y = 15) var/icon/newicon = icon('icons/mob/screen_gen.dmi', "catcher") diff --git a/code/modules/atmospherics/machinery/components/unary_devices/tank.dm b/code/modules/atmospherics/machinery/components/unary_devices/tank.dm index b12eb59442..1a9d1cff30 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/tank.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/tank.dm @@ -1,4 +1,4 @@ -#define AIR_CONTENTS (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature) +#define AIR_CONTENTS ((25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)) /obj/machinery/atmospherics/components/unary/tank icon = 'icons/obj/atmospherics/pipes/pressure_tank.dmi' icon_state = "generic" diff --git a/code/modules/recycling/disposal/bin.dm b/code/modules/recycling/disposal/bin.dm index e656b616dd..529d883916 100644 --- a/code/modules/recycling/disposal/bin.dm +++ b/code/modules/recycling/disposal/bin.dm @@ -1,6 +1,6 @@ // Disposal bin and Delivery chute. -#define SEND_PRESSURE 0.05*ONE_ATMOSPHERE +#define SEND_PRESSURE (0.05*ONE_ATMOSPHERE) /obj/machinery/disposal icon = 'icons/obj/atmospherics/pipes/disposal.dmi'