From d449d4596ca85573276dead8c4979841553d4695 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 17 Apr 2005 10:16:30 +0000 Subject: [PATCH] Added some parentheses for a little more macro safety. Recommended by Petri Kero, here: http://www.devolution.com/pipermail/sdl/2005-March/067630.html --- include/SDL_cdrom.h | 2 +- include/SDL_mouse.h | 2 +- include/SDL_version.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/SDL_cdrom.h b/include/SDL_cdrom.h index bd415e78e..3de89934b 100644 --- a/include/SDL_cdrom.h +++ b/include/SDL_cdrom.h @@ -60,7 +60,7 @@ typedef enum { } CDstatus; /* Given a status, returns true if there's a disk in the drive */ -#define CD_INDRIVE(status) ((int)status > 0) +#define CD_INDRIVE(status) ((int)(status) > 0) typedef struct SDL_CDtrack { Uint8 id; /* Track number */ diff --git a/include/SDL_mouse.h b/include/SDL_mouse.h index 3ab745bb6..645182bc0 100644 --- a/include/SDL_mouse.h +++ b/include/SDL_mouse.h @@ -120,7 +120,7 @@ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); Button 4: Mouse wheel up (may also be a real button) Button 5: Mouse wheel down (may also be a real button) */ -#define SDL_BUTTON(X) (SDL_PRESSED<<(X-1)) +#define SDL_BUTTON(X) (SDL_PRESSED << ((X)-1)) #define SDL_BUTTON_LEFT 1 #define SDL_BUTTON_MIDDLE 2 #define SDL_BUTTON_RIGHT 3 diff --git a/include/SDL_version.h b/include/SDL_version.h index a78444752..9ac0b026e 100644 --- a/include/SDL_version.h +++ b/include/SDL_version.h @@ -65,7 +65,7 @@ typedef struct SDL_version { This assumes that there will never be more than 100 patchlevels */ #define SDL_VERSIONNUM(X, Y, Z) \ - (X)*1000 + (Y)*100 + (Z) + ((X)*1000 + (Y)*100 + (Z)) /* This is the version number macro for the current SDL version */ #define SDL_COMPILEDVERSION \