diff options
author | D G Turner | 2019-12-09 16:59:10 +0000 |
---|---|---|
committer | D G Turner | 2019-12-09 16:59:10 +0000 |
commit | 2d90392ba52867334d30853d061514028bf5b633 (patch) | |
tree | 550f368551879241ef0d7c5016ce447dbea05d11 /common | |
parent | 1f77fd46e11525d1786e7fd79ba38e2d5f1efadf (diff) | |
download | scummvm-rg350-2d90392ba52867334d30853d061514028bf5b633.tar.gz scummvm-rg350-2d90392ba52867334d30853d061514028bf5b633.tar.bz2 scummvm-rg350-2d90392ba52867334d30853d061514028bf5b633.zip |
COMMON: Fix GCC-9 Warning in MacResManager Class
This is another case of a warning from using memset to clear a non-trivial
data structure.
GCC-9 detects this with the default warning of -Wclass-memaccess.
Diffstat (limited to 'common')
-rw-r--r-- | common/macresman.cpp | 17 | ||||
-rw-r--r-- | common/macresman.h | 9 |
2 files changed, 25 insertions, 1 deletions
diff --git a/common/macresman.cpp b/common/macresman.cpp index 553b138717..ac78ea0bd0 100644 --- a/common/macresman.cpp +++ b/common/macresman.cpp @@ -47,7 +47,22 @@ namespace Common { #define MAXNAMELEN 63 MacResManager::MacResManager() { - memset(this, 0, sizeof(MacResManager)); + _stream = nullptr; + // _baseFileName cleared by String constructor + + _mode = kResForkNone; + + _resForkOffset = 0; + _resForkSize = 0; + + _dataOffset = 0; + _dataLength = 0; + _mapOffset = 0; + _mapLength = 0; + _resMap.reset(); + _resTypes = nullptr; + _resLists = nullptr; + close(); } diff --git a/common/macresman.h b/common/macresman.h index 1be825b7b4..703f3a1d29 100644 --- a/common/macresman.h +++ b/common/macresman.h @@ -220,6 +220,15 @@ private: uint16 typeOffset; uint16 nameOffset; uint16 numTypes; + + void reset() { + resAttr = 0; + typeOffset = 0; + nameOffset = 0; + numTypes = 0; + } + + ResMap() { reset(); } }; struct ResType { |