diff options
author | Torbjörn Andersson | 2019-01-05 20:12:17 +0100 |
---|---|---|
committer | Filippos Karapetis | 2019-07-14 14:58:18 +0300 |
commit | b5b136b1770dd3ed4b750b9df9c10881dded1aba (patch) | |
tree | 084196df19057cf81e3a823a95aee55409a41eac /engines/agos | |
parent | 71a9def71e8cd73dd4c93fd4f2bc0a096e0a79fb (diff) | |
download | scummvm-rg350-b5b136b1770dd3ed4b750b9df9c10881dded1aba.tar.gz scummvm-rg350-b5b136b1770dd3ed4b750b9df9c10881dded1aba.tar.bz2 scummvm-rg350-b5b136b1770dd3ed4b750b9df9c10881dded1aba.zip |
AGOS: Silence GCC memset() warnings
Recent GCC versions complain if you memset() a class or struct that
contain non-POD data types. Get around that by either initializing
the object when created, or by adding a reset() method.
Diffstat (limited to 'engines/agos')
-rw-r--r-- | engines/agos/agos.h | 13 | ||||
-rw-r--r-- | engines/agos/vga.cpp | 2 |
2 files changed, 13 insertions, 2 deletions
diff --git a/engines/agos/agos.h b/engines/agos/agos.h index 551df6e19b..2874c3378a 100644 --- a/engines/agos/agos.h +++ b/engines/agos/agos.h @@ -132,7 +132,18 @@ struct VgaSprite { uint16 priority; uint16 windowNum; uint16 zoneNum; - VgaSprite() { memset(this, 0, sizeof(*this)); } + VgaSprite() { reset(); } + + void reset() { + id = 0; + image = 0; + palette = 0; + x = y = 0; + flags = 0; + priority = 0; + windowNum = 0; + zoneNum = 0; + } }; struct VgaSleepStruct { diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp index 2a675bf6e8..7926f7f4fe 100644 --- a/engines/agos/vga.cpp +++ b/engines/agos/vga.cpp @@ -1083,7 +1083,7 @@ void AGOSEngine::vc27_resetSprite() { _lastVgaWaitFor = 0; - memset(&bak, 0, sizeof(bak)); + bak.reset(); vsp = _vgaSprites; while (vsp->id) { |