diff src/dmres.c @ 1088:9f06f6661cdf

Cleanups for file endianess read/write helper functions.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 02 Mar 2015 20:16:43 +0200
parents a0c187dae495
children e06abfde6c39
line wrap: on
line diff
--- a/src/dmres.c	Mon Mar 02 20:10:44 2015 +0200
+++ b/src/dmres.c	Mon Mar 02 20:16:43 2015 +0200
@@ -1253,8 +1253,8 @@
     return tmp != EOF;
 }
 
-#define DM_DEFINE_FUNC(xname, xtype, xmacro)          \
-BOOL dmf_read_ ## xname (DMResource *f, xtype *v) {      \
+
+#define DM_DEFINE_FFUNC(xname, xtype, xmacro)          \
 BOOL dmf_read_ ## xname (DMResource *f, xtype *v) {   \
     xtype result;                                     \
     if (dmfread(&result, sizeof( xtype ), 1, f) != 1) \
@@ -1263,11 +1263,6 @@
     return TRUE;                                      \
 }
 
-DM_DEFINE_FUNC(le16, Uint16, LE16)
-DM_DEFINE_FUNC(le32, Uint32, LE32)
+#include "dmfiletmpl.h"
 
-DM_DEFINE_FUNC(be16, Uint16, BE16)
-DM_DEFINE_FUNC(be32, Uint32, BE32)
-
-DM_DEFINE_FUNC(le64, Uint64, LE64)
-DM_DEFINE_FUNC(be64, Uint64, BE64)
+#undef DM_DEFINE_FFUNC