[Scummvm-git-logs] scummvm master -> 3b9547edde674d3517a60ec8189a063bfb6a4d13

dreammaster paulfgilbert at gmail.com
Sun Jul 7 02:04:06 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:
3b9547edde GLK: Fix various gcc warnings


Commit: 3b9547edde674d3517a60ec8189a063bfb6a4d13
    https://github.com/scummvm/scummvm/commit/3b9547edde674d3517a60ec8189a063bfb6a4d13
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-07-06T17:02:26-07:00

Commit Message:
GLK: Fix various gcc warnings

Changed paths:
    engines/glk/alan3/main.cpp
    engines/glk/glulxe/glulxe.h
    engines/glk/glulxe/string.cpp
    engines/glk/hugo/heexpr.cpp
    engines/glk/magnetic/emu.cpp
    engines/glk/magnetic/graphics.cpp
    engines/glk/magnetic/magnetic.cpp
    engines/glk/tads/os_glk.cpp
    engines/glk/tads/tads2/qa_scriptor.cpp


diff --git a/engines/glk/alan3/main.cpp b/engines/glk/alan3/main.cpp
index 27f87ad..8c815b3 100644
--- a/engines/glk/alan3/main.cpp
+++ b/engines/glk/alan3/main.cpp
@@ -138,6 +138,7 @@ static void readTemporaryHeader(CONTEXT, ACodeHeader *tmphdr) {
 
 
 /*----------------------------------------------------------------------*/
+#ifdef SCUMM_LITTLE_ENDIAN
 static void reverseMemory() {
 	if (debugOption || traceSectionOption || traceInstructionOption)
 		output("<Hmm, this is a little-endian machine, fixing byte ordering....");
@@ -145,7 +146,7 @@ static void reverseMemory() {
 	if (debugOption || traceSectionOption || traceInstructionOption)
 		output("OK.>$n");
 }
-
+#endif
 
 /*----------------------------------------------------------------------*/
 static void setupHeader(ACodeHeader tmphdr) {
diff --git a/engines/glk/glulxe/glulxe.h b/engines/glk/glulxe/glulxe.h
index 02c8ab9..150decd 100644
--- a/engines/glk/glulxe/glulxe.h
+++ b/engines/glk/glulxe/glulxe.h
@@ -432,12 +432,6 @@ public:
 	 * Display a warning in the error window, and then continue.
 	 */
 	void nonfatal_warning_handler(const char *str, const char *arg, bool useVal, int val);
-#define fatal_error(s)  (fatal_error_handler((s), nullptr, false, 0))
-#define fatal_error_2(s1, s2)  (fatal_error_handler((s1), (s2), false, 0))
-#define fatal_error_i(s, v)  (fatal_error_handler((s), nullptr, true, (v)))
-#define nonfatal_warning(s) (nonfatal_warning_handler((s), nullptr, false, 0))
-#define nonfatal_warning_2(s1, s2) (nonfatal_warning_handler((s1), (s2), false, 0))
-#define nonfatal_warning_i(s, v) (nonfatal_warning_handler((s), nullptr, true, (v)))
 
 	/**
 	 * \defgroup Files access methods
@@ -988,6 +982,13 @@ public:
 
 extern Glulxe *g_vm;
 
+#define fatal_error(s)  (fatal_error_handler((s), nullptr, false, 0))
+#define fatal_error_2(s1, s2)  (fatal_error_handler((s1), (s2), false, 0))
+#define fatal_error_i(s, v)  (fatal_error_handler((s), nullptr, true, (v)))
+#define nonfatal_warning(s) (nonfatal_warning_handler((s), nullptr, false, 0))
+#define nonfatal_warning_2(s1, s2) (nonfatal_warning_handler((s1), (s2), false, 0))
+#define nonfatal_warning_i(s, v) (nonfatal_warning_handler((s), nullptr, true, (v)))
+
 } // End of namespace Glulxe
 } // End of namespace Glk
 
diff --git a/engines/glk/glulxe/string.cpp b/engines/glk/glulxe/string.cpp
index 4a3229b..df7e505 100644
--- a/engines/glk/glulxe/string.cpp
+++ b/engines/glk/glulxe/string.cpp
@@ -49,7 +49,7 @@ void Glulxe::stream_set_iosys(uint mode, uint rock) {
 	switch (mode) {
 	default:
 		mode = 0;
-	/* ...and fall through to next case (no-op I/O). */
+		// fall through
 	case iosys_None:
 		rock = 0;
 		stream_char_handler = &Glulxe::nopio_char_han;
diff --git a/engines/glk/hugo/heexpr.cpp b/engines/glk/hugo/heexpr.cpp
index b0865e4..246273c 100644
--- a/engines/glk/hugo/heexpr.cpp
+++ b/engines/glk/hugo/heexpr.cpp
@@ -853,6 +853,8 @@ CheckAttribute:
 			if (!inobj)
 				{nattr = 1;
 				codeptr++;}
+			// fall through
+
 		case IN_T:
 		{
 			if (!inobj)
@@ -1080,8 +1082,10 @@ void Hugo::SetupExpr() {
 			*/
 			case EOL_T:
 				arrexpr = false;
+				// fall through
 			case COMMA_T:
 				multiprop = false;
+				// fall through
 			case SEMICOLON_T:
 			case CLOSE_SQUARE_T:
 			case JUMP_T:
diff --git a/engines/glk/magnetic/emu.cpp b/engines/glk/magnetic/emu.cpp
index 76d0fa7..1d63f59 100644
--- a/engines/glk/magnetic/emu.cpp
+++ b/engines/glk/magnetic/emu.cpp
@@ -25,8 +25,8 @@
 namespace Glk {
 namespace Magnetic {
 
-static const char *no_hints = "[Hints are not available.]\n";
-static const char *not_supported = "[This function is not supported.]\n";
+//static const char *no_hints = "[Hints are not available.]\n";
+//static const char *not_supported = "[This function is not supported.]\n";
 
 int Magnetic::ms_init(bool restarting) {
 	byte header[42];
diff --git a/engines/glk/magnetic/graphics.cpp b/engines/glk/magnetic/graphics.cpp
index 1c63578..5ba2053 100644
--- a/engines/glk/magnetic/graphics.cpp
+++ b/engines/glk/magnetic/graphics.cpp
@@ -86,7 +86,8 @@ bool Magnetic::is_blank(uint16 line, uint16 width) const {
 byte *Magnetic::ms_extract1(byte pic, uint16 * w, uint16 * h, uint16 * pal) {
 	byte *table, *data, bit, val, *buffer;
 	uint16 tablesize, count;
-	uint32 i, j, datasize, upsize, offset;
+	uint32 i, j, upsize, offset;
+	//uint32 datasize;
 
 	offset = READ_LE_UINT32(gfx_data + 4 * pic);
 	buffer = gfx_data + offset - 8;
@@ -97,7 +98,7 @@ byte *Magnetic::ms_extract1(byte pic, uint16 * w, uint16 * h, uint16 * pal) {
 	h[0] = READ_LE_UINT16(buffer + 6);
 
 	tablesize = READ_LE_UINT16(buffer + 0x3c);
-	datasize = READ_LE_UINT32(buffer + 0x3e);
+	//datasize = READ_LE_UINT32(buffer + 0x3e);
 	table = buffer + 0x42;
 	data = table + tablesize * 2 + 2;
 	upsize = h[0] * w[0];
@@ -193,8 +194,9 @@ byte *Magnetic::ms_extract2(const char *name, uint16 *w, uint16 *h, uint16 *pal,
 		anim_data = gfx2_buf + 48 + main_pic.data_size;
 		if ((anim_data[0] != 0xD0) || (anim_data[1] != 0x5E)) {
 			byte *current;
-			uint16 frame_count, command_count;
+			uint16 frame_count;
 			uint16 value1, value2;
+			//uint16 command_count;
 
 			if (is_anim != 0)
 				*is_anim = 1;
@@ -261,7 +263,7 @@ byte *Magnetic::ms_extract2(const char *name, uint16 *w, uint16 *h, uint16 *pal,
 			}
 
 			// Get the command sequence table
-			command_count = READ_LE_UINT16(current);
+			//command_count = READ_LE_UINT16(current);
 			command_table = current + 2;
 
 			for (i = 0; i < MAX_POSITIONS; i++)
diff --git a/engines/glk/magnetic/magnetic.cpp b/engines/glk/magnetic/magnetic.cpp
index 7bd3fd6..3f9917b 100644
--- a/engines/glk/magnetic/magnetic.cpp
+++ b/engines/glk/magnetic/magnetic.cpp
@@ -80,12 +80,12 @@ bool Magnetic::is_gamefile_valid() {
 	}
 
 	// We support version 2.0 through 3.1.*
-	version = _gameFile.readUint32BE();
-	if (version < 0x20000) {
+	uint32 vers = _gameFile.readUint32BE();
+	if (vers < 0x20000) {
 		GUIErrorMessage(_("This Glulx file is too old a version to execute."));
 		return false;
 	}
-	if (version >= 0x30200) {
+	if (vers >= 0x30200) {
 		GUIErrorMessage(_("This Glulx file is too new a version to execute."));
 		return false;
 	}
diff --git a/engines/glk/tads/os_glk.cpp b/engines/glk/tads/os_glk.cpp
index 03d8a3a..808eb10 100644
--- a/engines/glk/tads/os_glk.cpp
+++ b/engines/glk/tads/os_glk.cpp
@@ -1018,7 +1018,7 @@ void os_xlat_html4(unsigned int html4_char, char *result, size_t result_len) {
 		case 339:                                            /* oe ligature */
 			strcpy(result, "oe"); return;
 		case 159:                                                   /* Yuml */
-			result[0] = (char)255;
+			result[0] = (char)255; return;
 		case 376:                                        /* Y with diaresis */
 			result[0] = 'Y'; break;
 		case 352:                                           /* S with caron */
diff --git a/engines/glk/tads/tads2/qa_scriptor.cpp b/engines/glk/tads/tads2/qa_scriptor.cpp
index ec4e770..bb235d5 100644
--- a/engines/glk/tads/tads2/qa_scriptor.cpp
+++ b/engines/glk/tads/tads2/qa_scriptor.cpp
@@ -105,9 +105,7 @@ char *qasgets(char *buf, int bufl) {
                 /* return the command */
                 return buf;
             }
-        }
-        else if (c == EOF )
-        {
+        } else if ((int)c == EOF) {
             /* end of file - close the script and return eof */
             qasclose();
             return 0;





More information about the Scummvm-git-logs mailing list