mirror of
https://github.com/digarok/gsplus.git
synced 2024-11-30 16:50:45 +00:00
eliminate overflow warnings when byteswapping.
This commit is contained in:
parent
d0ed507ef4
commit
dccb965631
10
src/defc.h
10
src/defc.h
@ -44,11 +44,13 @@ void U_STACK_TRACE();
|
||||
|
||||
#ifdef GSPLUS_LITTLE_ENDIAN
|
||||
// @todo: look at using <byteswap.h> for fastest platform implementations
|
||||
# define BIGEND(a) ((((a) >> 24) & 0xff) + \
|
||||
# define BIGEND(a) (\
|
||||
(((a) >> 24) & 0xff) + \
|
||||
(((a) >> 8) & 0xff00) + \
|
||||
(((a) << 8) & 0xff0000) + \
|
||||
(((a) << 24) & 0xff000000))
|
||||
# define GET_BE_WORD16(a) ((((a) >> 8) & 0xff) + (((a) << 8) & 0xff00))
|
||||
(((a) & 0xff00) << 8) + \
|
||||
(((a) & 0xff ) << 24) \
|
||||
)
|
||||
# define GET_BE_WORD16(a) ((((a) >> 8) & 0xff) + ((((a) & 0xff) << 8)))
|
||||
# define GET_BE_WORD32(a) (BIGEND(a))
|
||||
#else
|
||||
# define BIGEND(a) (a)
|
||||
|
Loading…
Reference in New Issue
Block a user