summaryrefslogtreecommitdiff
path: root/macros.h
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2004-09-12 21:49:38 +0000
committerdarkvater <darkvater@openttd.org>2004-09-12 21:49:38 +0000
commite295e46e3eccd58626ce2b02aab24b96c025636b (patch)
tree849dacad3729ee4bbd27669505a1932ca301592d /macros.h
parent1b498bca57457a5f46cc43baef225687e312692b (diff)
downloadopenttd-e295e46e3eccd58626ce2b02aab24b96c025636b.tar.xz
(svn r223) -Fix: Const correctness and miscellaneous fixes. Thank you Tron for your diligent fixing of warnings (and some possibly bugs) (Tron)
-CodeLayout: Remove trailing spaces and Windows linebreaks
Diffstat (limited to 'macros.h')
-rw-r--r--macros.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/macros.h b/macros.h
index 9669431ce..5e0ff540c 100644
--- a/macros.h
+++ b/macros.h
@@ -203,18 +203,18 @@ static INLINE void swap_tile(TileIndex *a, TileIndex *b) { TileIndex t = *a; *a
#if defined(TTD_LITTLE_ENDIAN)
-# define READ_LE_UINT16(b) (*(uint16*)(b))
+# define READ_LE_UINT16(b) (*(const uint16*)(b))
# define ADD_WORD(x) (x)&0xFF, ((x) >> 8)&0xFF
# define ADD_DWORD(x) (x)&0xFF, ((x) >> 8)&0xFF, ((x) >> 16)&0xFF, ((x) >> 24)&0xFF
#elif defined(TTD_BIG_ENDIAN)
static INLINE uint16 READ_LE_UINT16(const void *b) {
- return ((byte*)b)[0] + (((byte*)b)[1] << 8);
+ return ((const byte*)b)[0] + (((const byte*)b)[1] << 8);
}
# define ADD_WORD(x) ((x) >> 8)&0xFF, (x)&0xFF
# define ADD_DWORD(x) ((x) >> 24)&0xFF, ((x) >> 16)&0xFF, ((x) >> 8)&0xFF, (x)&0xFF
#endif
-static INLINE void WRITE_LE_UINT16(const void *b, uint16 x) {
+static INLINE void WRITE_LE_UINT16(void *b, uint16 x) {
((byte*)b)[0] = (byte)x;
((byte*)b)[1] = (byte)(x >> 8);
}