Changeset - r3941:ca89350e55ac
[Not reviewed]
master
0 1 0
peter1138 - 18 years ago 2006-06-03 15:14:41
peter1138@openttd.org
(svn r5085) - Fix (FS#198): add parentheses to CHANCE16*() (and GENERAL_SPRITE_COLOR) macro parameters (thanks to ASM)
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
macros.h
Show inline comments
 
@@ -73,7 +73,7 @@ static inline int64 BIGMULS(int32 a, int
 
#define SETBITS(x,y) ((x) |= (y))
 
#define CLRBITS(x,y) ((x) &= ~(y))
 

	
 
#define GENERAL_SPRITE_COLOR(color) ( (color + PALETTE_RECOLOR_START) << PALETTE_SPRITE_START)
 
#define GENERAL_SPRITE_COLOR(color) ( ((color) + PALETTE_RECOLOR_START) << PALETTE_SPRITE_START)
 
#define PLAYER_SPRITE_COLOR(owner) ( GENERAL_SPRITE_COLOR(_player_colors[owner]))
 
#define SPRITE_PALETTE(x) ((x) | PALETTE_MODIFIER_COLOR)
 

	
 
@@ -125,9 +125,9 @@ static inline int KillFirstBit2x64(int v
 
#define IS_INT_INSIDE(a,min,max) ((uint)((a)-(min)) < (uint)((max)-(min)))
 

	
 

	
 
#define CHANCE16(a,b) ((uint16)Random() <= (uint16)((65536 * a) / b))
 
#define CHANCE16R(a,b,r) ((uint16)(r=Random()) <= (uint16)((65536 * a) / b))
 
#define CHANCE16I(a,b,v) ((uint16)(v) <= (uint16)((65536 * a) / b))
 
#define CHANCE16(a,b) ((uint16)Random() <= (uint16)((65536 * (a)) / (b)))
 
#define CHANCE16R(a,b,r) ((uint16)(r=Random()) <= (uint16)((65536 * a) / (b)))
 
#define CHANCE16I(a,b,v) ((uint16)(v) <= (uint16)((65536 * (a)) / (b)))
 

	
 

	
 
#define for_each_bit(_i, _b)            \
0 comments (0 inline, 0 general)