changeset 1046:f09d5edfc7a3

Added some parentheses for a little more macro safety. Recommended by Petri Kero, here: http://www.devolution.com/pipermail/sdl/2005-March/067630.html
author Ryan C. Gordon <icculus@icculus.org>
date Sun, 17 Apr 2005 10:16:30 +0000
parents 63b8e93a3a52
children ffaaf7ecf685
files include/SDL_cdrom.h include/SDL_mouse.h include/SDL_version.h
diffstat 3 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/include/SDL_cdrom.h	Fri Apr 01 15:19:26 2005 +0000
+++ b/include/SDL_cdrom.h	Sun Apr 17 10:16:30 2005 +0000
@@ -60,7 +60,7 @@
 } 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 */
--- a/include/SDL_mouse.h	Fri Apr 01 15:19:26 2005 +0000
+++ b/include/SDL_mouse.h	Sun Apr 17 10:16:30 2005 +0000
@@ -120,7 +120,7 @@
    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
--- a/include/SDL_version.h	Fri Apr 01 15:19:26 2005 +0000
+++ b/include/SDL_version.h	Sun Apr 17 10:16:30 2005 +0000
@@ -65,7 +65,7 @@
    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 \