From e295e46e3eccd58626ce2b02aab24b96c025636b Mon Sep 17 00:00:00 2001 From: darkvater Date: Sun, 12 Sep 2004 21:49:38 +0000 Subject: (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 --- macros.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'macros.h') 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); } -- cgit v1.2.3-54-g00ecf