[Scummvm-git-logs] scummvm master -> ebb31903104933c87036890a217d288a2ba074f2
digitall
547637+digitall at users.noreply.github.com
Mon Mar 22 04:16:06 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ebb3190310 SWORD2: Fix Memset on Non-Trivial Structure GCC Compiler Warnings
Commit: ebb31903104933c87036890a217d288a2ba074f2
https://github.com/scummvm/scummvm/commit/ebb31903104933c87036890a217d288a2ba074f2
Author: D G Turner (digitall at scummvm.org)
Date: 2021-03-22T04:15:30Z
Commit Message:
SWORD2: Fix Memset on Non-Trivial Structure GCC Compiler Warnings
Changed paths:
engines/sword2/mouse.cpp
engines/sword2/mouse.h
diff --git a/engines/sword2/mouse.cpp b/engines/sword2/mouse.cpp
index ce050a2b25..ba9accc0c0 100644
--- a/engines/sword2/mouse.cpp
+++ b/engines/sword2/mouse.cpp
@@ -96,7 +96,9 @@ Mouse::Mouse(Sword2Engine *vm) {
_totalMasters = 0;
memset(_masterMenuList, 0, sizeof(_masterMenuList));
- memset(_mouseList, 0, sizeof(_mouseList));
+ for (uint i = 0; i < ARRAYSIZE(_mouseList); i++) {
+ _mouseList[i].clear();
+ }
memset(_subjectList, 0, sizeof(_subjectList));
_defaultResponseId = 0;
diff --git a/engines/sword2/mouse.h b/engines/sword2/mouse.h
index dc4bd5fc0a..a2bf02eed8 100644
--- a/engines/sword2/mouse.h
+++ b/engines/sword2/mouse.h
@@ -106,6 +106,17 @@ struct MouseUnit {
int32 id;
int32 pointer_text;
+
+ void clear() {
+ rect.top = 0;
+ rect.left = 0;
+ rect.bottom = 0;
+ rect.right = 0;
+ priority = 0;
+ pointer = 0;
+ id = 0;
+ pointer_text = 0;
+ }
};
// Array of these for subject menu build up
More information about the Scummvm-git-logs
mailing list