mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-31 16:03:24 +00:00
FULLPIPE: Silence GCC memset() warnings
Recent GCC versions complain if you memset() a class or struct that contain non-POD data types. Get around that by either initializing the object when created, or by adding a reset() method.
This commit is contained in:
parent
b5b136b177
commit
4eef7a42e3
@ -528,7 +528,7 @@ int AniHandler::seekWay(int idx, int st1idx, int st2idx, bool flip, bool flop) {
|
||||
debugC(2, kDebugPathfinding, "AniHandler::seekWay(%d, %d, %d, %d, %d)", idx, st1idx, st2idx, flip, flop);
|
||||
|
||||
if (st1idx == st2idx) {
|
||||
memset(&item.subItems[subIdx], 0, sizeof(item.subItems[subIdx]));
|
||||
item.subItems[subIdx].reset();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,15 @@ struct MGMSubItem {
|
||||
int y;
|
||||
|
||||
MGMSubItem();
|
||||
|
||||
void reset() {
|
||||
movement = nullptr;
|
||||
staticsIndex = 0;
|
||||
field_8 = 0;
|
||||
field_C = 0;
|
||||
x = 0;
|
||||
y = 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct MGMItem {
|
||||
@ -63,7 +72,21 @@ struct MakeQueueStruct {
|
||||
int y2;
|
||||
int flags;
|
||||
|
||||
MakeQueueStruct() { memset(this, 0, sizeof(MakeQueueStruct)); }
|
||||
MakeQueueStruct() { reset(); }
|
||||
|
||||
void reset() {
|
||||
ani = nullptr;
|
||||
staticsId1 = 0;
|
||||
staticsId2 = 0;
|
||||
movementId = 0;
|
||||
field_10 = 0;
|
||||
x1 = 0;
|
||||
y1 = 0;
|
||||
field_1C = 0;
|
||||
x2 = 0;
|
||||
y2 = 0;
|
||||
flags = 0;
|
||||
}
|
||||
};
|
||||
|
||||
class AniHandler : public CObject {
|
||||
|
@ -1230,7 +1230,7 @@ MessageQueue *MovGraph::makeWholeQueue(StaticANIObject *ani, MovArr *movarr, int
|
||||
|
||||
MakeQueueStruct mkQueue;
|
||||
|
||||
memset(&mkQueue, 0, sizeof(mkQueue));
|
||||
mkQueue.reset();
|
||||
mkQueue.ani = ani;
|
||||
mkQueue.staticsId2 = id2;
|
||||
mkQueue.staticsId1 = id1;
|
||||
@ -1996,7 +1996,7 @@ MessageQueue *MctlGraph::makeWholeQueue(MctlMQ &mctlMQ) {
|
||||
} else {
|
||||
MakeQueueStruct mkQueue;
|
||||
|
||||
memset(&mkQueue, 0, sizeof(mkQueue));
|
||||
mkQueue.reset();
|
||||
|
||||
mkQueue.ani = _items2[mctlMQ.index]._obj;
|
||||
mkQueue.staticsId2 = mg2i->_mov->_staticsObj2->_staticsId;
|
||||
|
@ -645,7 +645,7 @@ MessageQueue *sceneHandler04_kozFly5(StaticANIObject *ani, double phase) {
|
||||
|
||||
MessageQueue *mq1 = aniHandler.makeRunQueue(&mkQueue);
|
||||
|
||||
memset(&mkQueue, 0, sizeof(mkQueue));
|
||||
mkQueue.reset();
|
||||
mkQueue.ani = ani;
|
||||
mkQueue.staticsId1 = ST_KZW_JUMPOUT;
|
||||
mkQueue.staticsId2 = ST_KZW_SIT;
|
||||
|
Loading…
x
Reference in New Issue
Block a user