[Scummvm-cvs-logs] CVS: scummvm/scumm script_v5.cpp,1.289,1.290

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Wed Jul 6 23:47:40 CEST 2005


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24954

Modified Files:
	script_v5.cpp 
Log Message:
This allows ScummVM to run pre-Dig/FT SCUMM games again when compiled with
GCC 4.0, at least for me. I'm not enough of a language lawyer to say for
certain whether the old code was really undefined, but it's a simple enough
change that shouldn't possibly do any harm.


Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.289
retrieving revision 1.290
diff -u -d -r1.289 -r1.290
--- script_v5.cpp	24 Jun 2005 15:23:15 -0000	1.289
+++ script_v5.cpp	7 Jul 2005 06:45:33 -0000	1.290
@@ -1446,7 +1446,15 @@
 }
 
 void ScummEngine_v5::o5_jumpRelative() {
-	_scriptPointer += (int16)fetchScriptWord();
+	// Note that calling fetchScriptWord() will also modify _scriptPointer,
+	// so *don't* do this: _scriptPointer += (int16)fetchScriptWord();
+	//
+	// I'm not enough of a language lawyer to say for certain that this is
+	// undefined, but I do know that GCC 4.0 doesn't think it means what
+	// we want it to mean.
+
+	int16 offset = (int16)fetchScriptWord();
+	_scriptPointer += offset;
 }
 
 void ScummEngine_v5::o5_lights() {





More information about the Scummvm-git-logs mailing list