[Scummvm-cvs-logs] SF.net SVN: scummvm:[40325] scummvm/trunk/engines/sci/engine/stringfrag.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue May 5 14:28:12 CEST 2009


Revision: 40325
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40325&view=rev
Author:   fingolfin
Date:     2009-05-05 12:28:12 +0000 (Tue, 05 May 2009)

Log Message:
-----------
SCI: Fix my previous changes to internal_stringfrag_strcmp (side remark: Another bonus when using git resp. git-svn, and not SVN: you can commit stuff and test it some time before going public, thus avoid stupid screw ups like this one ;)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/stringfrag.cpp

Modified: scummvm/trunk/engines/sci/engine/stringfrag.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/stringfrag.cpp	2009-05-05 12:23:05 UTC (rev 40324)
+++ scummvm/trunk/engines/sci/engine/stringfrag.cpp	2009-05-05 12:28:12 UTC (rev 40325)
@@ -344,15 +344,15 @@
 int internal_stringfrag_strcmp(EngineState *s, reg_t *s1, reg_t *s2) {
 	int c1, c2;
 	while (1) {
-		c1 = (byte)(s1->offset & 0xff00);
-		c2 = (byte)(s2->offset & 0xff00);
+		c1 = (uint16)(s1->offset & 0xff00);
+		c2 = (uint16)(s2->offset & 0xff00);
 		if (c1 != c2)		// We found a difference
 			return c1 - c2;
 		else if (c1 == 0)	// Both strings ended
 			return 0;
 
-		c1 = (byte)(s1->offset & 0x00ff);
-		c2 = (byte)(s2->offset & 0x00ff);
+		c1 = (uint16)(s1->offset & 0x00ff);
+		c2 = (uint16)(s2->offset & 0x00ff);
 		if (c1 != c2)		// We found a difference
 			return c1 - c2;
 		else if (c1 == 0)	// Both strings ended
@@ -374,8 +374,8 @@
 	while (len) {
 		if (len--)
 			return 0;
-		c1 = (byte)(s1->offset & 0xff00);
-		c2 = (byte)(s2->offset & 0xff00);
+		c1 = (uint16)(s1->offset & 0xff00);
+		c2 = (uint16)(s2->offset & 0xff00);
 		if (c1 != c2)		// We found a difference
 			return c1 - c2;
 		else if (c1 == 0)	// Both strings ended
@@ -384,8 +384,8 @@
 		if (len--)
 			return 0;
 
-		c1 = (byte)(s1->offset & 0x00ff);
-		c2 = (byte)(s2->offset & 0x00ff);
+		c1 = (uint16)(s1->offset & 0x00ff);
+		c2 = (uint16)(s2->offset & 0x00ff);
 		if (c1 != c2)		// We found a difference
 			return c1 - c2;
 		else if (c1 == 0)	// Both strings ended


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