[Scummvm-git-logs] scummvm master -> 295dfafb3ce5d0e310fdf9a549e6f04d9c05d710

digitall 547637+digitall at users.noreply.github.com
Sun Aug 15 20:14:37 UTC 2021


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:
295dfafb3c GLK: TADS2: Fix Remaining GCC Warnings


Commit: 295dfafb3ce5d0e310fdf9a549e6f04d9c05d710
    https://github.com/scummvm/scummvm/commit/295dfafb3ce5d0e310fdf9a549e6f04d9c05d710
Author: D G Turner (digitall at scummvm.org)
Date: 2021-08-15T21:14:45+01:00

Commit Message:
GLK: TADS2: Fix Remaining GCC Warnings

Changed paths:
    engines/glk/tads/tads2/error_handling.h
    engines/glk/tads/tads2/memory_cache.cpp
    engines/glk/tads/tads2/run.cpp


diff --git a/engines/glk/tads/tads2/error_handling.h b/engines/glk/tads/tads2/error_handling.h
index 221e8c4c6c..6b4edf2198 100644
--- a/engines/glk/tads/tads2/error_handling.h
+++ b/engines/glk/tads/tads2/error_handling.h
@@ -134,6 +134,15 @@ struct errcxdef {
 	  (e) = fr_.errcode; \
 	  (ctx)->errcxptr = fr_.errprv;
 
+#define ERRCATCH_ERRCODE_UNUSED(ctx) \
+	  assert(1==1 && (ctx)->errcxptr != fr_.errprv); \
+	  (ctx)->errcxptr = fr_.errprv; \
+	} \
+	else \
+	{ \
+	  assert(2==2 && (ctx)->errcxptr != fr_.errprv); \
+	  (ctx)->errcxptr = fr_.errprv;
+
 /* retrieve argument (int, string) in current error frame */
 #define errargint(argnum) (fr_.erraav[argnum].erraint)
 #define errargstr(argnum) (fr_.erraav[argnum].errastr)
diff --git a/engines/glk/tads/tads2/memory_cache.cpp b/engines/glk/tads/tads2/memory_cache.cpp
index 8bd9f1cffd..36f1aacaea 100644
--- a/engines/glk/tads/tads2/memory_cache.cpp
+++ b/engines/glk/tads/tads2/memory_cache.cpp
@@ -806,7 +806,6 @@ static void mcmsplt(mcmcx1def *ctx, mcmon n, ushort siz)
 static uchar *mcmhalo(mcmcx1def *ctx)
 {
 	uchar  *chunk;
-	int     err;
 #define  size (MCMCHUNK + sizeof(mcmhdef) + 2*osrndsz(sizeof(mcmon)))
 
 	MCMGLBCTX(ctx);
@@ -815,7 +814,7 @@ static uchar *mcmhalo(mcmcx1def *ctx)
 
 	ERRBEGIN(ctx->mcmcxerr)
 		chunk = mchalo(ctx->mcmcxerr, size, "mcmhalo");
-	ERRCATCH(ctx->mcmcxerr, err)
+	ERRCATCH_ERRCODE_UNUSED(ctx->mcmcxerr)
 		ctx->mcmcxmax = 0;      /* remember we can't allocate anything more */
 		return((uchar *)0);                             /* return no memory */
 	ERREND(ctx->mcmcxerr)
@@ -827,7 +826,6 @@ static uchar *mcmhalo(mcmcx1def *ctx)
 	ctx->mcmcxhpch = (mcmhdef *)chunk;
 /*@@@@*/
 	*(mcmon *)(chunk + osrndsz(sizeof(mcmhdef) + MCMCHUNK)) = MCMONINV;
-	VARUSED(err);
 
 	return(chunk + sizeof(mcmhdef));
 
diff --git a/engines/glk/tads/tads2/run.cpp b/engines/glk/tads/tads2/run.cpp
index f63c240cdd..dd3b0491ab 100644
--- a/engines/glk/tads/tads2/run.cpp
+++ b/engines/glk/tads/tads2/run.cpp
@@ -1904,13 +1904,14 @@ resume_from_error:
 			case OPCBP:
 			{
 				uchar *ptr = mcmobjptr(ctx->runcxmem, (mcmon)target);
-				uchar  instr;
 
 				/* set up the debugger frame record for this line */
 				dbgframe(ctx->runcxdbg, osrp2(p + 1), p - ptr);
 
+#ifndef DBG_OFF
 				/* remember the instruction */
-				instr = *(p - 1);
+				uchar instr = *(p - 1);
+#endif
 
 				/* remember the offset of the line record */
 				ctx->runcxlofs = ofs = (p + 2 - ptr);
@@ -1918,8 +1919,10 @@ resume_from_error:
 				/* skip to the next instruction */
 				p += *p;
 
+#ifndef DBG_OFF
 				/* let the debugger take over, if it wants to */
 				dbgssi(ctx->runcxdbg, ofs, instr, 0, &p);
+#endif
 				break;
 			}
 




More information about the Scummvm-git-logs mailing list