EVENTRECORDER: Fix GCC Compiler Warnings

These were memcpy usage to copy a non-trivial structure.
This commit is contained in:
D G Turner 2019-09-14 00:54:10 +01:00
parent 011a9cd43f
commit 019de0cc23
2 changed files with 11 additions and 2 deletions

View file

@ -44,6 +44,16 @@ enum RecorderEventType {
struct RecorderEvent : Event { struct RecorderEvent : Event {
RecorderEventType recordedtype; RecorderEventType recordedtype;
uint32 time; uint32 time;
RecorderEvent() {
recordedtype = kRecorderEventTypeNormal;
time = 0;
}
RecorderEvent(const Event &e) : Event(e) {
recordedtype = kRecorderEventTypeNormal;
time = 0;
}
}; };

View file

@ -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()) { if (((evt.type == Common::EVENT_LBUTTONDOWN) || (evt.type == Common::EVENT_LBUTTONUP) || (evt.type == Common::EVENT_MOUSEMOVE)) && _controlPanel->isMouseOver()) {
return Common::List<Common::Event>(); return Common::List<Common::Event>();
} else { } else {
Common::RecorderEvent e; Common::RecorderEvent e(ev);
memcpy(&e, &ev, sizeof(ev));
e.recordedtype = Common::kRecorderEventTypeNormal; e.recordedtype = Common::kRecorderEventTypeNormal;
e.time = _fakeTimer; e.time = _fakeTimer;
_playbackFile->writeEvent(e); _playbackFile->writeEvent(e);