Mercurial > hg > dmlib
diff dmresw.c @ 72:be6160981428
Improve and finish write functions in resource subsystem.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 01 Oct 2012 14:17:47 +0300 |
parents | c560703e85ed |
children | 3d9c044ec08d |
line wrap: on
line diff
--- a/dmresw.c Mon Oct 01 13:43:09 2012 +0300 +++ b/dmresw.c Mon Oct 01 14:17:47 2012 +0300 @@ -14,13 +14,12 @@ } -#define DM_DEFINE_FUNC(xname, xtype, xmacro) \ -BOOL dmf_write_ ## xname (DMResource *f, xtype *v) { \ - xtype result; \ - if (dmfwrite(&result, sizeof( xtype ), 1, f) != 1) \ - return FALSE; \ - *v = DM_ ## xmacro ## _TO_NATIVE (result); \ - return TRUE; \ +#define DM_DEFINE_FUNC(xname, xtype, xmacro) \ +BOOL dmf_write_ ## xname (DMResource *f, xtype v) { \ + xtype result = DM_NATIVE_TO_ ## xmacro (v); \ + if (dmfwrite(&result, sizeof( xtype ), 1, f) != 1) \ + return FALSE; \ + return TRUE; \ } DM_DEFINE_FUNC(le16, Uint16, LE16)