[Scummvm-git-logs] scummvm master -> 3494a0391d09b4939c107e33baab533bcc710e22

digitall noreply at scummvm.org
Mon Jan 16 23:42:21 UTC 2023


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0e08e91dbd TETRAEDGE: Fix Memset of Non-Trivial Data Structure GCC Compiler Warning
3494a0391d TETRAEDGE: Fix Misleading Code Indentation


Commit: 0e08e91dbd9a2db392996ff7f1b02c46332393bf
    https://github.com/scummvm/scummvm/commit/0e08e91dbd9a2db392996ff7f1b02c46332393bf
Author: D G Turner (digitall at scummvm.org)
Date: 2023-01-16T23:40:30Z

Commit Message:
TETRAEDGE: Fix Memset of Non-Trivial Data Structure GCC Compiler Warning

Changed paths:
    engines/tetraedge/te/micropather.cpp
    engines/tetraedge/te/micropather.h


diff --git a/engines/tetraedge/te/micropather.cpp b/engines/tetraedge/te/micropather.cpp
index 4ad0c1af493..4bae56328c9 100644
--- a/engines/tetraedge/te/micropather.cpp
+++ b/engines/tetraedge/te/micropather.cpp
@@ -855,7 +855,9 @@ const PathCache::Item* PathCache::Find( void* start, void* end )
 
 void MicroPather::GetCacheData( CacheData* data )
 {
-	memset( data, 0, sizeof(*data) );
+	if (data) {
+		data->reset();
+	}
 
 	if ( pathCache ) {
 		data->nBytesAllocated = pathCache->AllocatedBytes();
diff --git a/engines/tetraedge/te/micropather.h b/engines/tetraedge/te/micropather.h
index f4804f1a78a..e527a7ec288 100644
--- a/engines/tetraedge/te/micropather.h
+++ b/engines/tetraedge/te/micropather.h
@@ -345,7 +345,8 @@ namespace micropather
 	};
 
 	struct CacheData {
-		CacheData() : nBytesAllocated(0), nBytesUsed(0), memoryFraction(0), hit(0), miss(0), hitFraction(0) {}
+		CacheData() { reset(); }
+
 		int nBytesAllocated;
 		int nBytesUsed;
 		float memoryFraction;
@@ -353,6 +354,16 @@ namespace micropather
 		int hit;
 		int miss;
 		float hitFraction;
+
+		void reset() {
+			nBytesAllocated = 0;
+			nBytesUsed = 0;
+			memoryFraction = 0;
+
+			hit = 0;
+			miss = 0;
+			hitFraction = 0;
+		}
 	};
 
 	/**


Commit: 3494a0391d09b4939c107e33baab533bcc710e22
    https://github.com/scummvm/scummvm/commit/3494a0391d09b4939c107e33baab533bcc710e22
Author: D G Turner (digitall at scummvm.org)
Date: 2023-01-16T23:42:03Z

Commit Message:
TETRAEDGE: Fix Misleading Code Indentation

No functional change.

Changed paths:
    engines/tetraedge/te/micropather.cpp


diff --git a/engines/tetraedge/te/micropather.cpp b/engines/tetraedge/te/micropather.cpp
index 4bae56328c9..afd9813975f 100644
--- a/engines/tetraedge/te/micropather.cpp
+++ b/engines/tetraedge/te/micropather.cpp
@@ -867,9 +867,8 @@ void MicroPather::GetCacheData( CacheData* data )
 		data->hit = pathCache->hit;
 		data->miss = pathCache->miss;
 		if ( data->hit + data->miss ) {
-		data->hitFraction = (float)( (double)(data->hit) / (double)(data->hit + data->miss) );
-	}
-		else {
+			data->hitFraction = (float)( (double)(data->hit) / (double)(data->hit + data->miss) );
+		} else {
 			data->hitFraction = 0;
 		}
 	}




More information about the Scummvm-git-logs mailing list