diff options
author | D G Turner | 2019-09-14 00:07:47 +0100 |
---|---|---|
committer | D G Turner | 2019-09-14 00:07:47 +0100 |
commit | 117733ad0abd673261381dc72bb5415708be9290 (patch) | |
tree | 8af62ecc742971b1cb82d0c4a04135e737d5873f | |
parent | d5e7a2e5b1688805b94cdcfc3c9b792aff8074d1 (diff) | |
download | scummvm-rg350-117733ad0abd673261381dc72bb5415708be9290.tar.gz scummvm-rg350-117733ad0abd673261381dc72bb5415708be9290.tar.bz2 scummvm-rg350-117733ad0abd673261381dc72bb5415708be9290.zip |
HDB: Fix More GCC Compiler Warnings
-rw-r--r-- | engines/hdb/ai-inventory.cpp | 2 | ||||
-rw-r--r-- | engines/hdb/ai-waypoint.cpp | 4 | ||||
-rw-r--r-- | engines/hdb/ai.h | 10 |
3 files changed, 13 insertions, 3 deletions
diff --git a/engines/hdb/ai-inventory.cpp b/engines/hdb/ai-inventory.cpp index 272d41dc89..3c8d2c2b55 100644 --- a/engines/hdb/ai-inventory.cpp +++ b/engines/hdb/ai-inventory.cpp @@ -303,7 +303,7 @@ bool AI::completeDelivery(const char *id) { for (int i = 0; i < _numDeliveries; i++) { if (!scumm_stricmp(_deliveries[i].id, id)) { for (; i < _numDeliveries; i++) - memcpy(&_deliveries[i], &_deliveries[i + 1], sizeof(_deliveries[0])); + _deliveries[i] = _deliveries[i + 1]; _numDeliveries--; if (g_hdb->isPPC()) g_hdb->_sound->playSound(SND_QUEST_COMPLETE); diff --git a/engines/hdb/ai-waypoint.cpp b/engines/hdb/ai-waypoint.cpp index 702e41b243..a10b70d483 100644 --- a/engines/hdb/ai-waypoint.cpp +++ b/engines/hdb/ai-waypoint.cpp @@ -246,7 +246,9 @@ void AI::removeFirstWaypoint() { } void AI::clearWaypoints() { - memset(&_waypoints[0], 0, sizeof(_waypoints)); + for (uint8 i = 0; i < ARRAYSIZE(_waypoints); i++) { + _waypoints[i].reset(); + } _numWaypoints = 0; } diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index 37fc7efb3c..600fcaf5c6 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -644,7 +644,15 @@ struct DlvEnt { struct Waypoint { int x, y, level; - Waypoint() : x(0), y(0), level(0) {} + void reset() { + x = 0; + y = 0; + level = 0; + } + + Waypoint() { + reset(); + } }; struct LuaT { |