aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2009-02-21 03:25:23 +0000
committerMax Horn2009-02-21 03:25:23 +0000
commit031e3e3b9081ad955d4ef814829c83f4b51792f0 (patch)
tree2929092e9a644ff04fc2ae011d08ad66029e1904 /engines
parente9e2136c1a83be24214ea4d6b0839dc9f621ca18 (diff)
downloadscummvm-rg350-031e3e3b9081ad955d4ef814829c83f4b51792f0.tar.gz
scummvm-rg350-031e3e3b9081ad955d4ef814829c83f4b51792f0.tar.bz2
scummvm-rg350-031e3e3b9081ad955d4ef814829c83f4b51792f0.zip
SCI: Fixed tons of bugs in error/warning format strings
svn-id: r38655
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kgraphics.cpp8
-rw-r--r--engines/sci/engine/klists.cpp2
-rw-r--r--engines/sci/engine/kscripts.cpp4
-rw-r--r--engines/sci/engine/kstring.cpp22
4 files changed, 17 insertions, 19 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 8f41ac2d91..64789031bd 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -208,10 +208,10 @@ void graph_restore_box(state_t *s, reg_t handle) {
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 @@ void graph_restore_box(state_t *s, reg_t handle) {
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 @@ reg_t kCanBeHere(state_t *s, int funct_nr, int argc, reg_t * argv) {
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)) {
diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp
index e08610a9af..66216fe813 100644
--- a/engines/sci/engine/klists.cpp
+++ b/engines/sci/engine/klists.cpp
@@ -341,7 +341,7 @@ reg_t kAddAfter(state_t *s, int funct_nr, int argc, reg_t *argv) {
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;
}
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp
index 0819965cfe..eb00bb9573 100644
--- a/engines/sci/engine/kscripts.cpp
+++ b/engines/sci/engine/kscripts.cpp
@@ -46,8 +46,8 @@ void write_selector(state_t *s, reg_t object, selector_t selector_id, reg_t valu
}
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;
}
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp
index 7f2d82858b..dbba274871 100644
--- a/engines/sci/engine/kstring.cpp
+++ b/engines/sci/engine/kstring.cpp
@@ -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 @@ kernel_lookup_text(state_t *s, reg_t address, int index)
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 @@ kernel_lookup_text(state_t *s, reg_t address, int index)
/**********/
#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 @@ vocab_match_simple(state_t *s, heap_ptr addr) {
#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 @@ kSetSynonyms(state_t *s, int funct_nr, int argc, reg_t *argv) {
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);
}