[Scummvm-cvs-logs] SF.net SVN: scummvm: [32466] tools/trunk/kyra_ins.cpp

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Sun Jun 1 17:10:54 CEST 2008


Revision: 32466
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32466&view=rev
Author:   athrxx
Date:     2008-06-01 08:10:54 -0700 (Sun, 01 Jun 2008)

Log Message:
-----------
- fix 'order of evaluation' bug (MSVC release build)

Modified Paths:
--------------
    tools/trunk/kyra_ins.cpp

Modified: tools/trunk/kyra_ins.cpp
===================================================================
--- tools/trunk/kyra_ins.cpp	2008-06-01 14:05:39 UTC (rev 32465)
+++ tools/trunk/kyra_ins.cpp	2008-06-01 15:10:54 UTC (rev 32466)
@@ -107,7 +107,8 @@
 	int16 b = ((_bitsLeft << 8) | _index) - 1;
 	_bitsLeft = b >> 8;
 	_index = b & 0xff;
-	return (((val & 3) + 4) << _index) + 0x101 + getKeyMasked(_index);
+	uint16 res = (((val & 3) + 4) << _index) + 0x101;
+	return res + getKeyMasked(_index);
 }
 
 void FileExpanderSource::advSrcRefresh() {
@@ -273,9 +274,11 @@
 				cmd -= 0xfe;
 				int16 offset = ((int16*) _tables[4])[_src->getKeyLower()];
 				_src->advSrcBitsByIndex(offset < 0 ? calcCmdAndIndex(_tables[5], offset) : _tables[1][offset]);
+
 				if ((offset & 0xff) >= 4) {
 					uint8 newIndex = ((offset & 0xff) >> 1) - 1;
-					offset = (((offset & 1) + 2) << newIndex) + _src->getKeyMasked(newIndex);
+					offset = (((offset & 1) + 2) << newIndex);
+					offset += _src->getKeyMasked(newIndex);
 				}
 
 				uint8 *s2 = d - 1 - offset;


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