[Scummvm-git-logs] scummvm master -> 019de0cc23b698bff56601e662fb5c44cf99a98e

digitall dgturner at iee.org
Sat Sep 14 01:57:53 CEST 2019


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:
019de0cc23 EVENTRECORDER: Fix GCC Compiler Warnings


Commit: 019de0cc23b698bff56601e662fb5c44cf99a98e
    https://github.com/scummvm/scummvm/commit/019de0cc23b698bff56601e662fb5c44cf99a98e
Author: D G Turner (digitall at scummvm.org)
Date: 2019-09-14T00:54:10+01:00

Commit Message:
EVENTRECORDER: Fix GCC Compiler Warnings

These were memcpy usage to copy a non-trivial structure.

Changed paths:
    common/recorderfile.h
    gui/EventRecorder.cpp


diff --git a/common/recorderfile.h b/common/recorderfile.h
index d34a442..b100162 100644
--- a/common/recorderfile.h
+++ b/common/recorderfile.h
@@ -44,6 +44,16 @@ enum RecorderEventType {
 struct RecorderEvent : Event {
 	RecorderEventType recordedtype;
 	uint32 time;
+
+	RecorderEvent() {
+		recordedtype = kRecorderEventTypeNormal;
+		time = 0;
+	}
+
+	RecorderEvent(const Event &e) : Event(e) {
+		recordedtype = kRecorderEventTypeNormal;
+		time = 0;
+	}
 };
 
 
diff --git a/gui/EventRecorder.cpp b/gui/EventRecorder.cpp
index 560df0e..d249ea4 100644
--- a/gui/EventRecorder.cpp
+++ b/gui/EventRecorder.cpp
@@ -455,8 +455,7 @@ Common::List<Common::Event> EventRecorder::mapEvent(const Common::Event &ev, Com
 		if (((evt.type == Common::EVENT_LBUTTONDOWN) || (evt.type == Common::EVENT_LBUTTONUP) || (evt.type == Common::EVENT_MOUSEMOVE)) && _controlPanel->isMouseOver()) {
 			return Common::List<Common::Event>();
 		} else {
-			Common::RecorderEvent e;
-			memcpy(&e, &ev, sizeof(ev));
+			Common::RecorderEvent e(ev);
 			e.recordedtype = Common::kRecorderEventTypeNormal;
 			e.time = _fakeTimer;
 			_playbackFile->writeEvent(e);





More information about the Scummvm-git-logs mailing list