changeset 872:b01d04e44b6f

Assume we always have 64bit type.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 03 Feb 2015 20:58:34 +0200
parents fc272f5f2d15
children 26ea35e914ca
files src/dmfiletmpl.h src/dmlib.h src/dmres.c src/dmres.h src/dmresw.c src/dmresw.h
diffstat 6 files changed, 14 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/src/dmfiletmpl.h	Tue Feb 03 20:27:12 2015 +0200
+++ b/src/dmfiletmpl.h	Tue Feb 03 20:58:34 2015 +0200
@@ -7,11 +7,8 @@
 
 DM_DEFINE_FFUNC(le16, Uint16, LE16)
 DM_DEFINE_FFUNC(le32, Uint32, LE32)
+DM_DEFINE_FFUNC(le64, Uint64, LE64)
 
 DM_DEFINE_FFUNC(be16, Uint16, BE16)
 DM_DEFINE_FFUNC(be32, Uint32, BE32)
-
-#ifdef DM_HAVE_64BIT
-DM_DEFINE_FFUNC(le64, Uint64, LE64)
 DM_DEFINE_FFUNC(be64, Uint64, BE64)
-#endif
--- a/src/dmlib.h	Tue Feb 03 20:27:12 2015 +0200
+++ b/src/dmlib.h	Tue Feb 03 20:58:34 2015 +0200
@@ -455,7 +455,6 @@
     (((Uint32) (value) & (Uint32) 0x00ff0000U) >>  8) | \
     (((Uint32) (value) & (Uint32) 0xff000000U) >> 24)))
 
-#ifdef DM_HAVE_64BIT
 #define DM_SWAP_64_LE_BE(value) ((Uint64) (                           \
     (((Uint64) (value) & (Uint64) 0x00000000000000ffULL) << 56) |   \
     (((Uint64) (value) & (Uint64) 0x000000000000ff00ULL) << 40) |   \
@@ -480,12 +479,10 @@
 #  define DM_NATIVE_TO_BE16(value) ((Uint16) (value))
 #  define DM_NATIVE_TO_BE32(value) ((Uint32) (value))
 
-#  ifdef DM_HAVE_64BIT
-#    define DM_LE64_TO_NATIVE(value) DM_SWAP_64_LE_BE(value)
-#    define DM_NATIVE_TO_LE64(value) DM_SWAP_64_LE_BE(value)
-#    define DM_BE64_TO_NATIVE(value) ((Uint64) (value))
-#    define DM_NATIVE_TO_BE64(value) ((Uint64) (value))
-#  endif
+#  define DM_LE64_TO_NATIVE(value) DM_SWAP_64_LE_BE(value)
+#  define DM_NATIVE_TO_LE64(value) DM_SWAP_64_LE_BE(value)
+#  define DM_BE64_TO_NATIVE(value) ((Uint64) (value))
+#  define DM_NATIVE_TO_BE64(value) ((Uint64) (value))
 
 #elif (SDL_BYTEORDER == SDL_LIL_ENDIAN)
 
@@ -499,12 +496,10 @@
 #  define DM_NATIVE_TO_BE16(value) DM_SWAP_16_LE_BE(value)
 #  define DM_NATIVE_TO_BE32(value) DM_SWAP_32_LE_BE(value)
 
-#  ifdef DM_HAVE_64BIT
-#    define DM_LE64_TO_NATIVE(value) ((Uint64) (value))
-#    define DM_NATIVE_TO_LE64(value) ((Uint64) (value))
-#    define DM_BE64_TO_NATIVE(value) DM_SWAP_64_LE_BE(value)
-#    define DM_NATIVE_TO_BE64(value) DM_SWAP_64_LE_BE(value)
-#  endif
+#  define DM_LE64_TO_NATIVE(value) ((Uint64) (value))
+#  define DM_NATIVE_TO_LE64(value) ((Uint64) (value))
+#  define DM_BE64_TO_NATIVE(value) DM_SWAP_64_LE_BE(value)
+#  define DM_NATIVE_TO_BE64(value) DM_SWAP_64_LE_BE(value)
 #endif
 
 
--- a/src/dmres.c	Tue Feb 03 20:27:12 2015 +0200
+++ b/src/dmres.c	Tue Feb 03 20:58:34 2015 +0200
@@ -1171,7 +1171,5 @@
 DM_DEFINE_FUNC(be16, Uint16, BE16)
 DM_DEFINE_FUNC(be32, Uint32, BE32)
 
-#ifdef DM_HAVE_64BIT
 DM_DEFINE_FUNC(le64, Uint64, LE64)
 DM_DEFINE_FUNC(be64, Uint64, BE64)
-#endif
--- a/src/dmres.h	Tue Feb 03 20:27:12 2015 +0200
+++ b/src/dmres.h	Tue Feb 03 20:58:34 2015 +0200
@@ -174,13 +174,11 @@
 
 BOOL         dmf_read_be16(DMResource *, Uint16 *);
 BOOL         dmf_read_be32(DMResource *, Uint32 *);
+BOOL         dmf_read_be64(DMResource *, Uint64 *);
+
 BOOL         dmf_read_le16(DMResource *, Uint16 *);
 BOOL         dmf_read_le32(DMResource *, Uint32 *);
-
-#ifdef DM_HAVE_64BIT
-BOOL         dmf_read_be64(DMResource *, Uint64 *);
 BOOL         dmf_read_le64(DMResource *, Uint64 *);
-#endif
 
 
 #ifdef __cplusplus
--- a/src/dmresw.c	Tue Feb 03 20:27:12 2015 +0200
+++ b/src/dmresw.c	Tue Feb 03 20:58:34 2015 +0200
@@ -28,11 +28,8 @@
 
 DM_DEFINE_FUNC(le16, Uint16, LE16)
 DM_DEFINE_FUNC(le32, Uint32, LE32)
+DM_DEFINE_FUNC(le64, Uint64, LE64)
 
 DM_DEFINE_FUNC(be16, Uint16, BE16)
 DM_DEFINE_FUNC(be32, Uint32, BE32)
-
-#ifdef DM_HAVE_64BIT
-DM_DEFINE_FUNC(le64, Uint64, LE64)
 DM_DEFINE_FUNC(be64, Uint64, BE64)
-#endif
--- a/src/dmresw.h	Tue Feb 03 20:27:12 2015 +0200
+++ b/src/dmresw.h	Tue Feb 03 20:58:34 2015 +0200
@@ -18,13 +18,11 @@
 
 BOOL         dmf_write_be16(DMResource *, Uint16);
 BOOL         dmf_write_be32(DMResource *, Uint32);
+BOOL         dmf_write_be64(DMResource *, Uint64);
+
 BOOL         dmf_write_le16(DMResource *, Uint16);
 BOOL         dmf_write_le32(DMResource *, Uint32);
-
-#ifdef DM_HAVE_64BIT
-BOOL         dmf_write_be64(DMResource *, Uint64);
 BOOL         dmf_write_le64(DMResource *, Uint64);
-#endif
 
 
 #ifdef __cplusplus