[Scummvm-cvs-logs] SF.net SVN: scummvm:[40577] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Fri May 15 01:09:04 CEST 2009


Revision: 40577
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40577&view=rev
Author:   fingolfin
Date:     2009-05-14 23:09:04 +0000 (Thu, 14 May 2009)

Log Message:
-----------
Fixed various GCC 4.2 warnings, among them an actual longstanding bug (3 years :) in the quicktime midi code

Modified Paths:
--------------
    scummvm/trunk/backends/midi/quicktime.cpp
    scummvm/trunk/engines/agos/script_pn.cpp
    scummvm/trunk/engines/agos/string.cpp
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/kstring.cpp
    scummvm/trunk/engines/sci/engine/vm.cpp
    scummvm/trunk/engines/tucker/resource.cpp

Modified: scummvm/trunk/backends/midi/quicktime.cpp
===================================================================
--- scummvm/trunk/backends/midi/quicktime.cpp	2009-05-14 22:56:13 UTC (rev 40576)
+++ scummvm/trunk/backends/midi/quicktime.cpp	2009-05-14 23:09:04 UTC (rev 40577)
@@ -101,7 +101,7 @@
 
 	simpleNoteRequest.info.flags = 0;
 	WRITE_BE_UINT16(& simpleNoteRequest.info.polyphony, 11);        // simultaneous tones
-	WRITE_BE_UINT16(& simpleNoteRequest.info.typicalPolyphony, 0x00010000);
+	WRITE_BE_UINT32(& simpleNoteRequest.info.typicalPolyphony, 0x00010000);
 
 	qtErr = NAStuffToneDescription(qtNoteAllocator, 1, &simpleNoteRequest.tone);
 	if (qtErr != noErr)

Modified: scummvm/trunk/engines/agos/script_pn.cpp
===================================================================
--- scummvm/trunk/engines/agos/script_pn.cpp	2009-05-14 22:56:13 UTC (rev 40576)
+++ scummvm/trunk/engines/agos/script_pn.cpp	2009-05-14 23:09:04 UTC (rev 40577)
@@ -891,7 +891,9 @@
 	}
 
 carryon:
-	while((x = doaction()) && !shouldQuit());
+	do {
+		x = doaction();
+	} while (x && !shouldQuit());
 
 skipln:	_linebase += 127 & *_linebase;
 	_linembr++;

Modified: scummvm/trunk/engines/agos/string.cpp
===================================================================
--- scummvm/trunk/engines/agos/string.cpp	2009-05-14 22:56:13 UTC (rev 40576)
+++ scummvm/trunk/engines/agos/string.cpp	2009-05-14 23:09:04 UTC (rev 40577)
@@ -916,7 +916,8 @@
 	uint32 b = base;
 	int ct = n;
 	while (ct) {
-		while(_textBase[b++]);
+		while(_textBase[b++])
+			;
 		ct--;
 	}
 	return b;
@@ -927,7 +928,8 @@
 	uint8 *tokbase;
 	tokbase = _textBase + getlong(30);
 	x = n;
-	while (x-=(*tokbase++ > 127)); 
+	while (x-=(*tokbase++ > 127))
+		;
 	while (*tokbase < 128)
 		*c++=*tokbase++;
 	*c++ = *tokbase & 127;
@@ -1043,7 +1045,8 @@
 	uint8 *tokbase;
 	tokbase = _textBase + getlong(30);
 	x = n;
-	while (x -= (*tokbase++ > 127)); 
+	while (x -= (*tokbase++ > 127))
+		;
 	while (*tokbase < 128)
 		pcf(*tokbase++);
 	pcf((uint8)(*tokbase & 127));

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-05-14 22:56:13 UTC (rev 40576)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-05-14 23:09:04 UTC (rev 40577)
@@ -1457,10 +1457,12 @@
 				} else if (modifiers & SCI_EVM_ALT) { // Ctrl has precedence over Alt
 					switch (key) {
 					case 0x2100 /* A-f */:
-						while ((cursor < textlen) && (text[cursor++] != ' '));
+						while ((cursor < textlen) && (text[cursor++] != ' '))
+							;
 						break;
 					case 0x3000 /* A-b */:
-						while ((cursor > 0) && (text[--cursor - 1] != ' '));
+						while ((cursor > 0) && (text[--cursor - 1] != ' '))
+							;
 						break;
 					case 0x2000 /* A-d */: {
 						while ((cursor < textlen) && (text[cursor] == ' ')) {

Modified: scummvm/trunk/engines/sci/engine/kstring.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kstring.cpp	2009-05-14 22:56:13 UTC (rev 40576)
+++ scummvm/trunk/engines/sci/engine/kstring.cpp	2009-05-14 23:09:04 UTC (rev 40577)
@@ -712,8 +712,10 @@
 
 	seeker = (char *) textres->data;
 
-	while (counter--)
-		while (*seeker++);
+	while (counter--) {
+		while (*seeker++)
+			;
+	}
 	/* The second parameter (counter) determines the number of the string inside the text
 	** resource.
 	*/

Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp	2009-05-14 22:56:13 UTC (rev 40576)
+++ scummvm/trunk/engines/sci/engine/vm.cpp	2009-05-14 23:09:04 UTC (rev 40577)
@@ -788,7 +788,7 @@
 		case 0x01: // add
 			r_temp = POP32();
 			if (r_temp.segment || s->r_acc.segment) {
-				reg_t r_ptr;
+				reg_t r_ptr = NULL_REG;
 				int offset;
 				// Pointer arithmetics!
 				if (s->r_acc.segment) {
@@ -815,7 +815,7 @@
 		case 0x02: // sub
 			r_temp = POP32();
 			if (r_temp.segment || s->r_acc.segment) {
-				reg_t r_ptr;
+				reg_t r_ptr = NULL_REG;
 				int offset;
 				// Pointer arithmetics!
 				if (s->r_acc.segment) {

Modified: scummvm/trunk/engines/tucker/resource.cpp
===================================================================
--- scummvm/trunk/engines/tucker/resource.cpp	2009-05-14 22:56:13 UTC (rev 40576)
+++ scummvm/trunk/engines/tucker/resource.cpp	2009-05-14 23:09:04 UTC (rev 40577)
@@ -1016,7 +1016,9 @@
 			}
 			break;
 		}
-		while ((table = executeTableInstruction()) == 0);
+		do {
+			table = executeTableInstruction();
+		} while (table == 0);
 	} while (table == 3);
 	if (table == 2) {
 		_nextAction = 0;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list