[Scummvm-cvs-logs] SF.net SVN: scummvm:[39227] scummvm/trunk/engines/agos/string.cpp

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Sun Mar 8 15:16:03 CET 2009


Revision: 39227
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39227&view=rev
Author:   Kirben
Date:     2009-03-08 14:15:59 +0000 (Sun, 08 Mar 2009)

Log Message:
-----------
Cleanup.

Modified Paths:
--------------
    scummvm/trunk/engines/agos/string.cpp

Modified: scummvm/trunk/engines/agos/string.cpp
===================================================================
--- scummvm/trunk/engines/agos/string.cpp	2009-03-08 13:43:11 UTC (rev 39226)
+++ scummvm/trunk/engines/agos/string.cpp	2009-03-08 14:15:59 UTC (rev 39227)
@@ -1493,7 +1493,7 @@
 }
 
 char *AGOSEngine_PN::getMessage(char *msg, uint16 num) {
-	char *origPtr, *strPtr2, *strPtr1 = msg;
+	char *origPtr, *strPtr1 = msg;
 	uint8 count;
 
 	getObjectName(strPtr1, num);
@@ -1512,7 +1512,7 @@
 	}
 
 	origPtr = strPtr1;
-	while (strPtr1[0] != 13)
+	while (*strPtr1 != 13)
 		strPtr1++;
 
 	strPtr1[0] = 32;
@@ -1522,28 +1522,23 @@
 	if (_videoLockOut & 0x10) {
 		strPtr1 = origPtr;
 		count = 6;
-		while (strPtr1[0] != 0) {
-			if (strPtr1[0] == 32) {
+		while (*strPtr1) {
+			if (*strPtr1 == 32) {
 				count = 6;
 			} else {
 				count--;
 				if (count == 0) {
 					char *tmpPtr = strPtr1;
-					strPtr2 = strPtr1;
+					char *strPtr2 = strPtr1;
 
-					while (strPtr2[0] != 0 && strPtr2[0] != 32) 
+					while (*strPtr2 != 0 && *strPtr2 != 32) 
 						strPtr2++;
 
-					while (strPtr2[0] != 0) {
-						strPtr1[0] = strPtr2[0];
-						strPtr2++;
-						strPtr1++;
+					while (*strPtr2) {
+						*strPtr1++ = *strPtr2++;
 					}
+					*strPtr1++ = *strPtr2++;
 
-					strPtr1[0] = strPtr2[0];
-					strPtr2++;
-					strPtr1++;
-
 					strPtr1 = tmpPtr;
 					count = 6;
 				}


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