summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwithmorten <morten.with@gmail.com>2021-06-26 19:19:45 +0200
committerwithmorten <morten.with@gmail.com>2021-06-26 19:19:45 +0200
commit4819d195d8c8723f73d76d9869fa9d4b5686e56f (patch)
tree1ce3f745a1ecd3e1dee46b0cd9d0068d33db1ffd
parentf3a931e1c99372ae4bc224ef482d4052a09580cb (diff)
fix WriteSaveHeader
-rw-r--r--src/save/SaveBuf.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/save/SaveBuf.h b/src/save/SaveBuf.h
index ed48a650..1b79c956 100644
--- a/src/save/SaveBuf.h
+++ b/src/save/SaveBuf.h
@@ -38,15 +38,15 @@ WriteSaveBuf(uint8 *&buf, const T &value)
#define SAVE_HEADER_SIZE (4 * sizeof(char) + sizeof(uint32))
-#define WriteSaveHeader(buf, a, b, c, d, size) \
- WriteSaveBuf(buf, a); \
- WriteSaveBuf(buf, b); \
- WriteSaveBuf(buf, c); \
- WriteSaveBuf(buf, d); \
- WriteSaveBuf(buf, (uint32)size);
+#define WriteSaveHeader(buf, a, b, c, d, size) \
+ WriteSaveBuf(buf, a); \
+ WriteSaveBuf(buf, b); \
+ WriteSaveBuf(buf, c); \
+ WriteSaveBuf(buf, d); \
+ WriteSaveBuf(buf, (uint32)(size));
#ifdef VALIDATE_SAVE_SIZE
-#define CheckSaveHeader(buf, a, b, c, d, size) { \
+#define CheckSaveHeader(buf, a, b, c, d, size) do { \
char _C; uint32 _size;\
ReadSaveBuf(&_C, buf);\
assert(_C == a);\
@@ -58,7 +58,7 @@ WriteSaveBuf(uint8 *&buf, const T &value)
assert(_C == d);\
ReadSaveBuf(&_size, buf);\
assert(_size == size);\
- }
+ } while(0)
#else
#define CheckSaveHeader(buf, a, b, c, d, size) SkipSaveBuf(buf, 8);
#endif \ No newline at end of file