summaryrefslogtreecommitdiff
path: root/src/macros.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-04-18 22:10:36 +0000
committerrubidium <rubidium@openttd.org>2007-04-18 22:10:36 +0000
commit7577954ced47f09803bc1b3881d47f222dbd306b (patch)
treef018095aed2d70f8386d800c8e8ac662f4b9c8fa /src/macros.h
parent0d32783f87b9a32fa8f0bf539514ed08faebbd2a (diff)
downloadopenttd-7577954ced47f09803bc1b3881d47f222dbd306b.tar.xz
(svn r9672) -Cleanup: lots of coding style fixes around operands.
Diffstat (limited to 'src/macros.h')
-rw-r--r--src/macros.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/macros.h b/src/macros.h
index 35964c07b..7b8b8dba6 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -82,9 +82,9 @@ template<typename T> static inline T TOGGLEBIT(T& x, int y)
/* checking more bits. Maybe unneccessary, but easy to use */
-#define HASBITS(x,y) ((x) & (y))
-#define SETBITS(x,y) ((x) |= (y))
-#define CLRBITS(x,y) ((x) &= ~(y))
+#define HASBITS(x, y) ((x) & (y))
+#define SETBITS(x, y) ((x) |= (y))
+#define CLRBITS(x, y) ((x) &= ~(y))
#define GENERAL_SPRITE_COLOR(color) ((color) + PALETTE_RECOLOR_START)
#define PLAYER_SPRITE_COLOR(owner) (GENERAL_SPRITE_COLOR(_player_colors[owner]))
@@ -98,7 +98,7 @@ extern const byte _ffb_64[128];
/* Returns x with the first bit that is not zero, counted from the left, set
* to zero. So, 10110100 returns 10110000, 00000001 returns 00000000, etc.
*/
-#define KILL_FIRST_BIT(x) _ffb_64[(x)+64]
+#define KILL_FIRST_BIT(x) _ffb_64[(x) + 64]
static inline int FindFirstBit2x64(int value)
{
@@ -133,13 +133,13 @@ static inline int KillFirstBit2x64(int value)
#define HAS_SINGLE_BIT(a) ( ((a) & ((a) - 1)) == 0)
/* [min,max), strictly less than */
-#define IS_BYTE_INSIDE(a,min,max) ((byte)((a)-(min)) < (byte)((max)-(min)))
-#define IS_INT_INSIDE(a,min,max) ((uint)((a)-(min)) < (uint)((max)-(min)))
+#define IS_BYTE_INSIDE(a, min, max) ((byte)((a) - (min)) < (byte)((max) - (min)))
+#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) \