[Scummvm-git-logs] scummvm master -> 2d1b4dc9778856ad981b0d4cd49416e973ba5b9c
digitall
dgturner at iee.org
Wed Jul 24 23:02:44 CEST 2019
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
af850a3e37 CGE: Fix GCC Warnings by Explicit Structure Initialization
2d1b4dc977 COMMON: Add Default Values for Joystick State Structure
Commit: af850a3e372495fe527be4c81ced3a57cbbe490d
https://github.com/scummvm/scummvm/commit/af850a3e372495fe527be4c81ced3a57cbbe490d
Author: D G Turner (digitall at scummvm.org)
Date: 2019-07-24T21:57:35+01:00
Commit Message:
CGE: Fix GCC Warnings by Explicit Structure Initialization
Some of the members of the structures do not need this as they have
constructors which do this implicitly.
Changed paths:
engines/cge/events.cpp
diff --git a/engines/cge/events.cpp b/engines/cge/events.cpp
index d7c065e..0cc32ce 100644
--- a/engines/cge/events.cpp
+++ b/engines/cge/events.cpp
@@ -238,8 +238,15 @@ void Mouse::newMouse(Common::Event &event) {
EventManager::EventManager(CGEEngine *vm) : _vm(vm){
_eventQueueHead = 0;
_eventQueueTail = 0;
- memset(&_eventQueue, 0, kEventMax * sizeof(CGEEvent));
- memset(&_event, 0, sizeof(Common::Event));
+ for (uint16 k = 0; k < kEventMax; k++) {
+ _eventQueue[k]._mask = 0;
+ _eventQueue[k]._x = 0;
+ _eventQueue[k]._y = 0;
+ _eventQueue[k]._spritePtr = nullptr;
+ }
+ _event.joystick.axis = 0;
+ _event.joystick.position = 0;
+ _event.joystick.button = 0;
}
void EventManager::poll() {
Commit: 2d1b4dc9778856ad981b0d4cd49416e973ba5b9c
https://github.com/scummvm/scummvm/commit/2d1b4dc9778856ad981b0d4cd49416e973ba5b9c
Author: D G Turner (digitall at scummvm.org)
Date: 2019-07-24T22:00:26+01:00
Commit Message:
COMMON: Add Default Values for Joystick State Structure
This ensures that this has a defined value when used without the
engine needing to set the field values directly i.e. as per CGE.
Changed paths:
common/events.h
diff --git a/common/events.h b/common/events.h
index 4b45d53..cbd6153 100644
--- a/common/events.h
+++ b/common/events.h
@@ -111,6 +111,8 @@ struct JoystickState {
* buttons. See JoystickButton.
*/
int8 button;
+
+ JoystickState() : axis(0), position(0), button(0) {}
};
/**
More information about the Scummvm-git-logs
mailing list