aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/alan2/types.cpp
diff options
context:
space:
mode:
authordreammaster2019-06-22 03:41:11 +0100
committerPaul Gilbert2019-06-22 14:40:50 -0700
commita3fa9d12a94494f86134f56df6c064d7e48e8580 (patch)
tree7de5f43a53a281039bfa574ccd7bcc91efa84cf6 /engines/glk/alan2/types.cpp
parentdd4108e7c79770ec8235bd4440e0cdc06becd9d9 (diff)
downloadscummvm-rg350-a3fa9d12a94494f86134f56df6c064d7e48e8580.tar.gz
scummvm-rg350-a3fa9d12a94494f86134f56df6c064d7e48e8580.tar.bz2
scummvm-rg350-a3fa9d12a94494f86134f56df6c064d7e48e8580.zip
GLK: ALAN2: Fix gcc errors for references to packed struct fields
Diffstat (limited to 'engines/glk/alan2/types.cpp')
-rw-r--r--engines/glk/alan2/types.cpp28
1 files changed, 17 insertions, 11 deletions
diff --git a/engines/glk/alan2/types.cpp b/engines/glk/alan2/types.cpp
index 8419e33ff4..9ce4a657b0 100644
--- a/engines/glk/alan2/types.cpp
+++ b/engines/glk/alan2/types.cpp
@@ -25,21 +25,27 @@
namespace Glk {
namespace Alan2 {
+// This works around gcc errors for passing packed structure fields
+static void syncVal(Common::Serializer &s, int *fld) {
+ int &v = *fld;
+ s.syncAsSint32LE(v);
+}
+
void CurVars::synchronize(Common::Serializer &s) {
- s.syncAsSint32LE(vrb);
- s.syncAsSint32LE(obj);
- s.syncAsSint32LE(loc);
- s.syncAsSint32LE(act);
- s.syncAsSint32LE(tick);
- s.syncAsSint32LE(score);
- s.syncAsSint32LE(visits);
+ syncVal(s, &vrb);
+ syncVal(s, &obj);
+ syncVal(s, &loc);
+ syncVal(s, &act);
+ syncVal(s, &tick);
+ syncVal(s, &score);
+ syncVal(s, &visits);
}
void EvtqElem::synchronize(Common::Serializer &s) {
- s.syncAsSint32LE(time);
- s.syncAsSint32LE(event);
- s.syncAsSint32LE(where);
-};
+ syncVal(s, &time);
+ syncVal(s, &event);
+ syncVal(s, &where);
+}
} // End of namespace Alan2
} // End of namespace Glk