[Scummvm-git-logs] scummvm master -> ad486c22e26ba592fa9a6732b54bdef21caa28ba

digitall noreply at scummvm.org
Sat Apr 29 20:38:10 UTC 2023


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:
ad486c22e2 WATCHMAKER: Further Fixes For GCC Compiler Warnings


Commit: ad486c22e26ba592fa9a6732b54bdef21caa28ba
    https://github.com/scummvm/scummvm/commit/ad486c22e26ba592fa9a6732b54bdef21caa28ba
Author: D G Turner (digitall at scummvm.org)
Date: 2023-04-29T21:37:44+01:00

Commit Message:
WATCHMAKER: Further Fixes For GCC Compiler Warnings

Changed paths:
    engines/watchmaker/3d/animation.cpp
    engines/watchmaker/3d/geometry.cpp
    engines/watchmaker/classes/do_system.cpp
    engines/watchmaker/game.cpp
    engines/watchmaker/init/nl_parse.cpp
    engines/watchmaker/ll/ll_util.cpp


diff --git a/engines/watchmaker/3d/animation.cpp b/engines/watchmaker/3d/animation.cpp
index b4f3b9feaef..3965988aa86 100644
--- a/engines/watchmaker/3d/animation.cpp
+++ b/engines/watchmaker/3d/animation.cpp
@@ -585,8 +585,8 @@ t3dCHARACTER *t3dLoadCharacter(WGame &game, const char *pname, uint16 num) {
 	b->Body->NumNormals = 0;
 	b->Body->NumVerticesNormals = 0;
 
-	for (uint16 n = 0; n < b->Body->NumMeshes(); n++) {
-		t3dMESH &mesh = b->Body->MeshTable[n];
+	for (uint16 i = 0; i < b->Body->NumMeshes(); i++) {
+		t3dMESH &mesh = b->Body->MeshTable[i];
 		for (f = 0; f < mesh.NumFaces(); f++) {
 			mesh.FList[f].n = nullptr;
 		}
@@ -622,9 +622,9 @@ t3dCHARACTER *t3dLoadCharacter(WGame &game, const char *pname, uint16 num) {
 	    t3dVectFill(&b->Mesh->BBox[7].p,0.0f);
 	    b->Mesh->Flags|=T3D_MESH_NOBOUNDBOX;
 	*/
-	for (uint16 n = 0; n < b->Body->NumMeshes(); n++) {
-		b->Body->MeshTable[n].Flags |= T3D_MESH_CHARACTER;
-		b->Body->MeshTable[n].Flags &= ~T3D_MESH_MIRROR;
+	for (uint16 i = 0; i < b->Body->NumMeshes(); i++) {
+		b->Body->MeshTable[i].Flags |= T3D_MESH_CHARACTER;
+		b->Body->MeshTable[i].Flags &= ~T3D_MESH_MIRROR;
 	}
 
 	t3dVectFill(&b->Pos, 0.0f);
diff --git a/engines/watchmaker/3d/geometry.cpp b/engines/watchmaker/3d/geometry.cpp
index aef3cfd22bf..2814c8ebc7f 100644
--- a/engines/watchmaker/3d/geometry.cpp
+++ b/engines/watchmaker/3d/geometry.cpp
@@ -201,7 +201,6 @@ void t3dCheckBlockMesh(Common::Array<t3dMESH> &mt, uint32 NumMeshes, t3dMESH *bl
 	t3dF32  xa, za, xb, zb, xc, zc, xd, zd;
 	t3dF32  r, s, divisor;
 
-	uint32  i, j;
 	uint8   ref[4] = {2, 3, 6, 7};
 
 	if (!blockmesh || mt.empty() || !blockmesh->VertexBuffer) return;
@@ -216,7 +215,7 @@ void t3dCheckBlockMesh(Common::Array<t3dMESH> &mt, uint32 NumMeshes, t3dMESH *bl
 		t3dFACE &f = blockmesh->FList[j];
 		if (!f.n) continue;
 
-		for (i = 0; i < 3; i++) {
+		for (uint32 i = 0; i < 3; i++) {
 			if (blockmesh->VBptr[f.VertexIndex[i]].x < xa) {
 				xa = blockmesh->VBptr[f.VertexIndex[i]].x;
 				za = blockmesh->VBptr[f.VertexIndex[i]].z;
@@ -229,11 +228,12 @@ void t3dCheckBlockMesh(Common::Array<t3dMESH> &mt, uint32 NumMeshes, t3dMESH *bl
 	}
 	blockmesh->VBptr = nullptr;
 
-	for (i = 0; i < NumMeshes; i++) {
+	for (uint32 i = 0; i < NumMeshes; i++) {
 		t3dMESH &mesh = mt[i];
 		if ((mesh.Flags & T3D_MESH_HIDDEN) || (mesh.Flags & T3D_MESH_INVISIBLEFROMSECT))
 			continue;
 
+		uint32 j;
 		for (j = 0; j < 4; j++) {
 			xd = mesh.Trasl.x + mesh.BBox[ref[j]].p.x;
 			zd = mesh.Trasl.z + mesh.BBox[ref[j]].p.z;
@@ -882,7 +882,7 @@ void CalcBones(t3dMESH *mesh, t3dBONEANIM *Anim, int32 Frame) {
 	t3dBONE     *bone;
 	t3dM3X3F    *Matrix;
 	t3dV3F      *Trasl, Appov;
-	int32      i, cv, *pmodvert;
+	int32      i, cv;
 	gVertex     *Newptr;
 	uint8       *Average/*,first=0*/;
 	uint32      memalloc = 0;
@@ -1581,7 +1581,7 @@ void t3dCalcVolumetricLights(t3dMESH *m, t3dBODY *body) {
  * --------------------------------------------------*/
 void t3dLightCharacter(t3dCHARACTER *Ch) {
 	t3dMESH     *mesh;
-	uint32      i, j;
+	uint32      j;
 	t3dV3F      l;
 	t3dF32      dist, far_range, near_range, AttenIntensity;
 	t3dF32      ang, half_hotspot, half_falloff, SpotIntensity;
@@ -1617,7 +1617,7 @@ void t3dLightCharacter(t3dCHARACTER *Ch) {
 	}
 	t3dVectAdd(&ppos, &mesh->Trasl, &mesh->Pos);
 
-	//for (i = 0; i < Ch->CurRoom->NumLights(); i++, lt++) {
+	//for (uint32 i = 0; i < Ch->CurRoom->NumLights(); i++, lt++) {
 	for (auto &lt : Ch->CurRoom->LightTable) {
 		if (!(lt.Type & T3D_LIGHT_LIGHTON)) continue;
 		if (!(lt.Type & T3D_LIGHT_REALTIME)) continue;
@@ -2174,8 +2174,8 @@ void t3dRenderWater(t3dMESH &mesh, uint32 Type) {
 	        *texturedest=*(texturesource+((Xoffset*2+Yoffset*pitch)&(dimy*dimy*2-1)));
 	    }*/
 
-	for (uint32 j = 0; j < (dimy); j++)
-		for (uint32 i = 0; i < (dimx); i++, texturedest++, WaterBuffer++, textsource++) {
+	for (int32 j = 0; j < dimy; j++)
+		for (int32 i = 0; i < dimx; i++, texturedest++, WaterBuffer++, textsource++) {
 			if (Type & T3D_MESH_POOLWATER) {
 				Xoffset = ((*(WaterBuffer - 1)) - (*(WaterBuffer + 1))) >> 16;
 				Yoffset = ((*(WaterBuffer - dimx)) - (*(WaterBuffer + dimx))) >> 16;
@@ -2327,10 +2327,10 @@ void t3dSetFaceVisibility(t3dMESH *mesh, t3dCAMERA *cam) {
 			if (!(mesh->VBptr = mesh->VertexBuffer))
 				continue;
 
-			for (int i = 0; i < 3; i++) {
+			for (int j = 0; j < 3; j++) {
 				t3dV3F  v;
-				gVertex *gv = &mesh->VBptr[f.VertexIndex[i]];
-				t3dV3F *n = &mesh->NList[f.VertexIndex[i]]->n;
+				gVertex *gv = &mesh->VBptr[f.VertexIndex[j]];
+				t3dV3F *n = &mesh->NList[f.VertexIndex[j]]->n;
 				t3dVectTransform(&v, n, &m);
 				gv->u1 = (v.x);
 				gv->v1 = (v.y);
@@ -2430,6 +2430,10 @@ void t3dCAMERA::normalizedSight() {
  *                  t3dCalcHalos
  * --------------------------------------------------*/
 void t3dCalcHalos(t3dBODY *b) {
+	// The userVertexBuffer stuff is not ready yet, giving us nullptr writes.
+	warning("TODO: t3dCalcHalos");
+	return;
+
 	gMaterial   *Material;
 	int16      T1;
 	uint32      uvbc;
@@ -2439,10 +2443,6 @@ void t3dCalcHalos(t3dBODY *b) {
 	//uint16      *fp;
 	t3dV3F      v0, v1, v2, v3, tmp;
 
-	// The userVertexBuffer stuff is not ready yet, giving us nullptr writes.
-	warning("TODO: t3dCalcHalos");
-	return;
-
 	for (i = 0; i < b->NumLights(); i++) {
 		t3dLIGHT &l = b->LightTable[i];
 		if (!(l.Type & T3D_LIGHT_LIGHTON)) continue;
diff --git a/engines/watchmaker/classes/do_system.cpp b/engines/watchmaker/classes/do_system.cpp
index 54bd244addf..f3522c12aa4 100644
--- a/engines/watchmaker/classes/do_system.cpp
+++ b/engines/watchmaker/classes/do_system.cpp
@@ -516,7 +516,6 @@ void ProcessTime(WGame &game) {
 	// warning("STUBBED ProcessTime");
 
 //	LARGE_INTEGER pf,pt;
-	int32 i;
 	TheTime = ReadTime();
 
 //	QueryPerformanceFrequency(&pf);QueryPerformanceCounter(&pt);
diff --git a/engines/watchmaker/game.cpp b/engines/watchmaker/game.cpp
index 2a1123cdb42..fae7ac43f34 100644
--- a/engines/watchmaker/game.cpp
+++ b/engines/watchmaker/game.cpp
@@ -118,7 +118,6 @@ bool WGame::CheckAndLoadMoglieSupervisoreModel(int32 c) {
 	warning("CheckAndLoadMoglieSupervisoreModel(workDirs, %d)", c);
 	char RemoveName[128] = "";
 	char RemoveNameHI[128] = "";
-	int32 j;
 
 	if (c == ocMOGLIESUPERVISORE) {
 		if (bMoglieGym && (!Character[c]->Body->name.contains("MoglieGym"))) {
@@ -501,7 +500,6 @@ bool WGame::LoadAndSetup(const Common::String &name, uint8 lite) {
  *                  UpdateAll
  * --------------------------------------------------*/
 void WGame::UpdateAll() {
-	int32 i;
 	UpdateRoomVisibility(*this);
 	auto bodies = _roomManager->getLoadedFiles();
 	for (auto loadedBody : bodies) {
@@ -602,7 +600,7 @@ void WGame::LoadMisc() {
 
 void WGame::GameLoop() {
 	bool done = false;
-	bool bGotMsg = false;
+	//bool bGotMsg = false;
 	//MSG  msg;
 
 	// TODO: These two should be adjusted if the game loses focus or needs to get a new context.
@@ -636,12 +634,11 @@ void WGame::GameLoop() {
 }
 
 void WGame::CleanUpAndPostQuit() {
-	uint16 i;
-	extern char *TextBucket;
-
 	gameOptions.save(workDirs);
 	warning("STUBBED CleanupAndPostQuit");
 #if 0
+	extern char *TextBucket;
+
 	if (CreditsNames) t3dFree(CreditsNames);
 	if (CreditsRoles) t3dFree(CreditsRoles);
 
@@ -652,7 +649,7 @@ void WGame::CleanUpAndPostQuit() {
 
 	CheckExtraLocalizationStrings(0);
 
-	for (i = 0; i < T3D_MAX_CHARACTERS; i++) {
+	for (uint16 i = 0; i < T3D_MAX_CHARACTERS; i++) {
 		if ((i != ocCURPLAYER) && (Character[i]))
 			CharStop(i);
 
@@ -661,7 +658,7 @@ void WGame::CleanUpAndPostQuit() {
 		Character[i] = nullptr;
 	}
 	Player = nullptr;
-	for (i = 0; i < NumLoadedFiles; i++) {
+	for (uint16 i = 0; i < NumLoadedFiles; i++) {
 		t3dReleaseBody(LoadedFiles[i].b);
 		LoadedFiles[i].b = nullptr;
 	}
diff --git a/engines/watchmaker/init/nl_parse.cpp b/engines/watchmaker/init/nl_parse.cpp
index 1cb0931049c..b20a857d9fe 100644
--- a/engines/watchmaker/init/nl_parse.cpp
+++ b/engines/watchmaker/init/nl_parse.cpp
@@ -28,9 +28,6 @@
 namespace Watchmaker {
 
 unsigned int jStringLimit = J_MAXSTRLEN, jTillEOL = 0, jUsingComments = 0;
-unsigned int nlLineCounter;
-char nlCurFileName[200];
-static Common::SeekableReadStream *nlCurFile;
 
 // PELS: supporto per il parsing dei .nl **********************************
 static void (*ErrorFunc)(void) = nullptr;
@@ -44,7 +41,7 @@ int ParseError(const char *ln, ...) {
 	va_start(ap, ln);
 	vsprintf(err, ln, ap);
 	va_end(ap);
-	warning("%s,%d: %s", nlCurFileName, nlLineCounter, err);
+	warning("%s", err);
 	return 0;
 }
 
diff --git a/engines/watchmaker/ll/ll_util.cpp b/engines/watchmaker/ll/ll_util.cpp
index 0776d6ce366..0b01592b780 100644
--- a/engines/watchmaker/ll/ll_util.cpp
+++ b/engines/watchmaker/ll/ll_util.cpp
@@ -204,8 +204,6 @@ int32 WhatObj(WGame &game, int32 mx, int32 my, uint8 op) {
  *                  getRoomFromStr
  * --------------------------------------------------*/
 int16 getRoomFromStr(Init &init, const Common::String &s) {
-	char t[100]; //, *str;
-
 	auto end = s.findLastOf(".-");
 	if (end == s.npos) {
 		end = s.size() - 1;




More information about the Scummvm-git-logs mailing list