Skip to content

Commit

Permalink
EVENTRECORDER: Fix GCC Compiler Warnings
Browse files Browse the repository at this point in the history
These were memcpy usage to copy a non-trivial structure.
  • Loading branch information
digitall committed Sep 13, 2019
1 parent 011a9cd commit 019de0c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 10 additions & 0 deletions common/recorderfile.h
Expand Up @@ -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;
}
};


Expand Down
3 changes: 1 addition & 2 deletions gui/EventRecorder.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 019de0c

Please sign in to comment.