summaryrefslogtreecommitdiff
path: root/src/i_swap.h
diff options
context:
space:
mode:
authorSimon Howard2007-08-31 08:59:34 +0000
committerSimon Howard2007-08-31 08:59:34 +0000
commit58fdd042a19e6db2739755a03293f669cb4f2df9 (patch)
tree2b75057a1b0438ea5cf021581f6b10ee2ddf80e8 /src/i_swap.h
parentdad445bb3ee8ca8d55e5c77d621f1a925ccbe9fb (diff)
downloadchocolate-doom-58fdd042a19e6db2739755a03293f669cb4f2df9.tar.gz
chocolate-doom-58fdd042a19e6db2739755a03293f669cb4f2df9.tar.bz2
chocolate-doom-58fdd042a19e6db2739755a03293f669cb4f2df9.zip
Make SHORT and LONG macros return signed values; this is the behaviour
of the versions in the original source and some code depends on it. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 962
Diffstat (limited to 'src/i_swap.h')
-rw-r--r--src/i_swap.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/i_swap.h b/src/i_swap.h
index d24f500e..065037a4 100644
--- a/src/i_swap.h
+++ b/src/i_swap.h
@@ -35,8 +35,11 @@
// Just use SDL's endianness swapping functions.
-#define SHORT(x) SDL_SwapLE16(x)
-#define LONG(x) SDL_SwapLE32(x)
+// These are deliberately cast to signed values; this is the behaviour
+// of the macros in the original source and some code relies on it.
+
+#define SHORT(x) ((signed short) SDL_SwapLE16(x))
+#define LONG(x) ((signed long) SDL_SwapLE32(x))
// Defines for checking the endianness of the system.