From dccb965631655ccbe181665979eba4759f347360 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Wed, 6 Feb 2019 22:48:04 -0500 Subject: [PATCH] eliminate overflow warnings when byteswapping. --- src/defc.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/defc.h b/src/defc.h index d817191..2b0a322 100644 --- a/src/defc.h +++ b/src/defc.h @@ -44,11 +44,13 @@ void U_STACK_TRACE(); #ifdef GSPLUS_LITTLE_ENDIAN // @todo: look at using for fastest platform implementations -# 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)) +# define BIGEND(a) (\ + (((a) >> 24) & 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)