[Scummvm-git-logs] scummvm master -> 117733ad0abd673261381dc72bb5415708be9290

digitall dgturner at iee.org
Sat Sep 14 01:10:33 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:
117733ad0a HDB: Fix More GCC Compiler Warnings


Commit: 117733ad0abd673261381dc72bb5415708be9290
    https://github.com/scummvm/scummvm/commit/117733ad0abd673261381dc72bb5415708be9290
Author: D G Turner (digitall at scummvm.org)
Date: 2019-09-14T00:07:47+01:00

Commit Message:
HDB: Fix More GCC Compiler Warnings

Changed paths:
    engines/hdb/ai-inventory.cpp
    engines/hdb/ai-waypoint.cpp
    engines/hdb/ai.h


diff --git a/engines/hdb/ai-inventory.cpp b/engines/hdb/ai-inventory.cpp
index 272d41d..3c8d2c2 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 702e41b..a10b70d 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 37fc7ef..600fcaf 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 {





More information about the Scummvm-git-logs mailing list