Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added some parentheses for a little more macro safety. Recommended by…
  • Loading branch information
icculus committed Apr 17, 2005
1 parent ae5d1e7 commit d449d45
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/SDL_cdrom.h
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion include/SDL_mouse.h
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/SDL_version.h
Expand Up @@ -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 \
Expand Down

0 comments on commit d449d45

Please sign in to comment.