[Scummvm-cvs-logs] CVS: scummvm/scumm script_v5.cpp,1.268,1.268.2.1

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Thu Jul 7 01:55:37 CEST 2005


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

Modified Files:
      Tag: branch-0-7-0
	script_v5.cpp 
Log Message:
Backported trivial (to fix - not to find) GCC 4 fix to hopefully allow
SCUMM games older than The Dig and Full Throttle to run again. I don't know
if we'll ever make another 0.7.x release, but it could possibly be of use
to package maintainers. For instance, GCC 4 is the default compiler in the
"unstable" Debian branch now.


Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.268
retrieving revision 1.268.2.1
diff -u -d -r1.268 -r1.268.2.1
--- script_v5.cpp	27 Nov 2004 00:25:59 -0000	1.268
+++ script_v5.cpp	7 Jul 2005 08:54:10 -0000	1.268.2.1
@@ -1434,7 +1434,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