Commit 20dbe0d9 authored by Ryan C. Gordon's avatar Ryan C. Gordon

Added some parentheses for a little more macro safety. Recommended by Petri

 Kero, here: http://www.devolution.com/pipermail/sdl/2005-March/067630.html

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401047
parent dc6bb605
...@@ -60,7 +60,7 @@ typedef enum { ...@@ -60,7 +60,7 @@ typedef enum {
} CDstatus; } CDstatus;
/* Given a status, returns true if there's a disk in the drive */ /* 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 { typedef struct SDL_CDtrack {
Uint8 id; /* Track number */ Uint8 id; /* Track number */
......
...@@ -120,7 +120,7 @@ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); ...@@ -120,7 +120,7 @@ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
Button 4: Mouse wheel up (may also be a real button) Button 4: Mouse wheel up (may also be a real button)
Button 5: Mouse wheel down (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_LEFT 1
#define SDL_BUTTON_MIDDLE 2 #define SDL_BUTTON_MIDDLE 2
#define SDL_BUTTON_RIGHT 3 #define SDL_BUTTON_RIGHT 3
......
...@@ -65,7 +65,7 @@ typedef struct SDL_version { ...@@ -65,7 +65,7 @@ typedef struct SDL_version {
This assumes that there will never be more than 100 patchlevels This assumes that there will never be more than 100 patchlevels
*/ */
#define SDL_VERSIONNUM(X, Y, Z) \ #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 */ /* This is the version number macro for the current SDL version */
#define SDL_COMPILEDVERSION \ #define SDL_COMPILEDVERSION \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment