diff options
author | dreammaster | 2019-06-22 03:41:11 +0100 |
---|---|---|
committer | Paul Gilbert | 2019-06-22 14:40:50 -0700 |
commit | a3fa9d12a94494f86134f56df6c064d7e48e8580 (patch) | |
tree | 7de5f43a53a281039bfa574ccd7bcc91efa84cf6 /engines/glk/alan2/types.cpp | |
parent | dd4108e7c79770ec8235bd4440e0cdc06becd9d9 (diff) | |
download | scummvm-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.cpp | 28 |
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 |