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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Feb 21 04:25:23 CET 2009


Revision: 38655
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38655&view=rev
Author:   fingolfin
Date:     2009-02-21 03:25:23 +0000 (Sat, 21 Feb 2009)

Log Message:
-----------
SCI: Fixed tons of bugs in error/warning format strings

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/klists.cpp
    scummvm/trunk/engines/sci/engine/kscripts.cpp
    scummvm/trunk/engines/sci/engine/kstring.cpp

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-02-21 03:24:35 UTC (rev 38654)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-02-21 03:25:23 UTC (rev 38655)
@@ -208,10 +208,10 @@
 		return;
 	}
 
-	ptr = (gfxw_snapshot_t **) kmem(s, handle);
+	ptr = (gfxw_snapshot_t **)kmem(s, handle);
 
 	if (!ptr) {
-		warning("Attempt to restore invalid handle %04x", handle);
+		warning("Attempt to restore invalid handle "PREG, PRINT_REG(handle));
 		return;
 	}
 
@@ -241,7 +241,7 @@
 
 
 	if (!ptr) {
-		error("Attempt to restore invalid snaphot with handle %04x", handle);
+		error("Attempt to restore invalid snaphot with handle "PREG, PRINT_REG(handle));
 		return;
 	}
 
@@ -846,7 +846,7 @@
 			SCIkdebug(SCIkBRESEN, "  comparing against "PREG"\n", PRINT_REG(other_obj));
 
 			if (!is_object(s, other_obj)) {
-				warning("CanBeHere() cliplist contains non-object %04x", other_obj);
+				warning("CanBeHere() cliplist contains non-object "PREG, PRINT_REG(other_obj));
 			} else if (!REG_EQ(other_obj, obj)) { // Clipping against yourself is not recommended
 
 				if (collides_with(s, abs_zone, other_obj, 0, GASEOUS_VIEW_MASK_PASSIVE, funct_nr, argc, argv)) {

Modified: scummvm/trunk/engines/sci/engine/klists.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/klists.cpp	2009-02-21 03:24:35 UTC (rev 38654)
+++ scummvm/trunk/engines/sci/engine/klists.cpp	2009-02-21 03:25:23 UTC (rev 38655)
@@ -341,7 +341,7 @@
 		error("List at "PREG" is not sane anymore", PRINT_REG(argv[0]));
 
 	if (!newnode) {
-		error("New 'node' "PREG" is not a node", argv[1], argv[2]);
+		error("New 'node' "PREG" is not a node", PRINT_REG(argv[2]));
 		return NULL_REG;
 	}
 

Modified: scummvm/trunk/engines/sci/engine/kscripts.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kscripts.cpp	2009-02-21 03:24:35 UTC (rev 38654)
+++ scummvm/trunk/engines/sci/engine/kscripts.cpp	2009-02-21 03:25:23 UTC (rev 38655)
@@ -46,8 +46,8 @@
 	}
 
 	if (lookup_selector(s, object, selector_id, &address, NULL) != SELECTOR_VARIABLE)
-		warning("Selector '%s' of object at %04x could not be"
-		         " written to (%s L%d)", s->selector_names[selector_id], object, fname, line);
+		warning("Selector '%s' of object at "PREG" could not be"
+		         " written to (%s L%d)", s->selector_names[selector_id], PRINT_REG(object), fname, line);
 	else
 		*address = value;
 }

Modified: scummvm/trunk/engines/sci/engine/kstring.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kstring.cpp	2009-02-21 03:24:35 UTC (rev 38654)
+++ scummvm/trunk/engines/sci/engine/kstring.cpp	2009-02-21 03:25:23 UTC (rev 38655)
@@ -35,22 +35,20 @@
 		return rv;\
 	}
 
-char *
-kernel_lookup_text(state_t *s, reg_t address, int index)
 /* Returns the string the script intended to address */
-{
+char *kernel_lookup_text(state_t *s, reg_t address, int index) {
 	char *seeker;
 	resource_t *textres;
 
 	if (address.segment)
-		return (char *) kernel_dereference_bulk_pointer(s, address, 0);
+		return (char *)kernel_dereference_bulk_pointer(s, address, 0);
 	else {
 		int textlen;
 		int _index = index;
 		textres = scir_find_resource(s->resmgr, sci_text, address.offset, 0);
 
 		if (!textres) {
-			error("text.%03d not found\n", address);
+			error("text.%03d not found", address.offset);
 			return NULL; /* Will probably segfault */
 		}
 
@@ -58,12 +56,13 @@
 		seeker = (char *) textres->data;
 
 		while (index--)
-			while ((textlen--) && (*seeker++));
+			while ((textlen--) && (*seeker++))
+				;
 
 		if (textlen)
 			return seeker;
 		else {
-			error("Index %d out of bounds in text.%03d\n", _index, address);
+			error("Index %d out of bounds in text.%03d\n", _index, address.offset);
 			return 0;
 		}
 
@@ -76,8 +75,7 @@
 /**********/
 
 #ifdef SCI_SIMPLE_SAID_CODE
-int
-vocab_match_simple(state_t *s, heap_ptr addr) {
+int vocab_match_simple(state_t *s, heap_ptr addr) {
 	int nextitem;
 	int listpos = 0;
 
@@ -112,8 +110,7 @@
 #endif /* SCI_SIMPLE_SAID_CODE */
 
 
-reg_t
-kSaid(state_t *s, int funct_nr, int argc, reg_t *argv) {
+reg_t kSaid(state_t *s, int funct_nr, int argc, reg_t *argv) {
 	reg_t heap_said_block = argv[0];
 	byte *said_block;
 	int new_lastmatch;
@@ -235,7 +232,8 @@
 
 						synpos++;
 					}
-			} else warning("Synonyms of script.%03d were requested, but script is not available");
+			} else
+				warning("Synonyms of script.%03d were requested, but script is not available", script);
 
 		}
 


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