aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorD G Turner2019-12-09 16:59:10 +0000
committerD G Turner2019-12-09 16:59:10 +0000
commit2d90392ba52867334d30853d061514028bf5b633 (patch)
tree550f368551879241ef0d7c5016ce447dbea05d11 /common
parent1f77fd46e11525d1786e7fd79ba38e2d5f1efadf (diff)
downloadscummvm-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.cpp17
-rw-r--r--common/macresman.h9
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 {