summaryrefslogtreecommitdiff
path: root/stdafx.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-11-14 19:48:04 +0000
committertron <tron@openttd.org>2005-11-14 19:48:04 +0000
commitf7abff5f963cddfdd134ac52ffd8e72e3ed88f0c (patch)
treea9ba5d4f3c5c47ab3857060c5f95ed482530ed97 /stdafx.h
parentd8b56c123eab7f7b48f2af3579130e366f6106ab (diff)
downloadopenttd-f7abff5f963cddfdd134ac52ffd8e72e3ed88f0c.tar.xz
(svn r3181) -Bracing
-Indentation -Whitespace -DeMorgan's Law -Test with NULL or 0 for non-booleans -'\0' instead of 0 for chars -Remove redundantly redundant comments (like DoFoo(); // Do foo) -Join multiple short lines with a single statement -Split single lines with multiple statements -Avoid assignments in if
Diffstat (limited to 'stdafx.h')
-rw-r--r--stdafx.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/stdafx.h b/stdafx.h
index c790cdc90..74c44e46d 100644
--- a/stdafx.h
+++ b/stdafx.h
@@ -198,21 +198,21 @@ typedef unsigned char byte;
static inline uint16 TO_LE16(uint16 x) { return BSWAP16(x); }
static inline uint32 FROM_LE32(uint32 x) { return BSWAP32(x); }
static inline uint16 FROM_LE16(uint16 x) { return BSWAP16(x); }
-# define TO_BE32(x) x
-# define TO_BE16(x) x
-# define FROM_BE32(x) x
-# define FROM_BE16(x) x
-# define TO_BE32X(x) x
+# define TO_BE32(x) (x)
+# define TO_BE16(x) (x)
+# define FROM_BE32(x) (x)
+# define FROM_BE16(x) (x)
+# define TO_BE32X(x) (x)
#else
static inline uint32 TO_BE32(uint32 x) { return BSWAP32(x); }
static inline uint16 TO_BE16(uint16 x) { return BSWAP16(x); }
static inline uint32 FROM_BE32(uint32 x) { return BSWAP32(x); }
static inline uint16 FROM_BE16(uint16 x) { return BSWAP16(x); }
-# define TO_LE32(x) x
-# define TO_LE16(x) x
+# define TO_LE32(x) (x)
+# define TO_LE16(x) (x)
# define TO_BE32X(x) BSWAP32(x)
-# define FROM_LE32(x) x
-# define FROM_LE16(x) x
+# define FROM_LE32(x) (x)
+# define FROM_LE16(x) (x)
#endif /* TTD_BIG_ENDIAN */
#if !defined(GAME_DATA_DIR)
@@ -241,7 +241,7 @@ typedef unsigned char byte;
assert_compile(sizeof(uint32) == 4);
assert_compile(sizeof(uint16) == 2);
-assert_compile(sizeof(uint8) == 1);
+assert_compile(sizeof(uint8) == 1);
#define lengthof(x) (sizeof(x)/sizeof(x[0]))
#define endof(x) (&x[lengthof(x)])