[Scummvm-cvs-logs] SF.net SVN: scummvm:[40680] scummvm/trunk/engines/sci/engine
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Mon May 18 13:53:04 CEST 2009
Revision: 40680
http://scummvm.svn.sourceforge.net/scummvm/?rev=40680&view=rev
Author: lordhoto
Date: 2009-05-18 11:53:04 +0000 (Mon, 18 May 2009)
Log Message:
-----------
Fix some error/warning calls. (might need some review, from someone familiar with SCI)
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kgraphics.cpp
scummvm/trunk/engines/sci/engine/klists.cpp
scummvm/trunk/engines/sci/engine/kstring.cpp
Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-05-18 10:40:22 UTC (rev 40679)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-05-18 11:53:04 UTC (rev 40680)
@@ -226,7 +226,7 @@
while (port_nr > 2 && !(s->port->_flags & GFXW_FLAG_IMMUNE_TO_SNAPSHOTS) && (gfxw_widget_matches_snapshot(*ptr, s->port))) {
// This shouldn't ever happen, actually, since windows (ports w/ ID > 2) should all be immune
GfxPort *newport = gfxw_find_port(s->visual, port_nr);
- error("Port %d is not immune against snapshots!\n", s->port->_ID);
+ error("Port %d is not immune against snapshots", s->port->_ID);
port_nr--;
if (newport)
s->port = newport;
@@ -240,7 +240,7 @@
} while (parent && (gfxw_widget_matches_snapshot(*ptr, parent)));
if (!parent) {
- error("Attempted widget mass destruction by a snapshot\n");
+ error("Attempted widget mass destruction by a snapshot");
BREAKPOINT();
}
@@ -249,7 +249,7 @@
if (!ptr) {
- error("Attempt to restore invalid snaphot with handle %04x!\n", handle);
+ error("Attempt to restore invalid snaphot with handle "PREG, PRINT_REG(handle));
return;
}
@@ -343,7 +343,7 @@
break;
}
default :
- error("kSetCursor: Unhandled case: %d arguments given!\n", argc);
+ error("kSetCursor: Unhandled case: %d arguments given", argc);
break;
}
return s->r_acc;
@@ -698,7 +698,7 @@
maxloops = gfxop_lookup_view_get_loops(s->gfx_state, view);
if (maxloops == GFX_ERROR) {
- error("Invalid view.%03d\n", view);
+ error("Invalid view.%03d", view);
return;
} else if ((loop > 1) && (maxloops < 4))
return;
@@ -886,7 +886,7 @@
}
if (gfxop_get_cel_parameters(s->gfx_state, view, loop, cel, &width, &height, &offset)) {
- error("Invalid loop (%d) or cel (%d) in view.%d (0x%x), or view invalid\n", loop, cel, view, view);
+ error("Invalid loop (%d) or cel (%d) in view.%d (0x%x), or view invalid", loop, cel, view, view);
return NULL_REG;
} else
return make_reg(0, height);
@@ -904,7 +904,7 @@
}
if (gfxop_get_cel_parameters(s->gfx_state, view, loop, cel, &width, &height, &offset)) {
- error("Invalid loop (%d) or cel (%d) in view.%d (0x%x), or view invalid\n", loop, cel, view, view);
+ error("Invalid loop (%d) or cel (%d) in view.%d (0x%x), or view invalid", loop, cel, view, view);
return NULL_REG;
} else
return make_reg(0, width);
@@ -916,11 +916,11 @@
int loops_nr = gfxop_lookup_view_get_loops(s->gfx_state, view);
if (loops_nr < 0) {
- error("view.%d (0x%x) not found\n", view, view);
+ error("view.%d (0x%x) not found", view, view);
return NULL_REG;
}
- SCIkdebug(SCIkGRAPHICS, "NumLoops(view.%d) = %d\n", view, loops_nr);
+ SCIkdebug(SCIkGRAPHICS, "NumLoops(view.%d) = %d", view, loops_nr);
return make_reg(0, loops_nr);
}
@@ -935,7 +935,7 @@
if (gfxop_check_cel(s->gfx_state, view, &loop, &cel)) {
// OK, this is a hack and there's a
// real function to calculate cel numbers...
- error("view.%d (0x%x) not found\n", view, view);
+ error("view.%d (0x%x) not found", view, view);
return NULL_REG;
}
Modified: scummvm/trunk/engines/sci/engine/klists.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/klists.cpp 2009-05-18 10:40:22 UTC (rev 40679)
+++ scummvm/trunk/engines/sci/engine/klists.cpp 2009-05-18 11:53:04 UTC (rev 40680)
@@ -38,14 +38,14 @@
// seem to have any apparent ill-effects, though, so it's been changed to non-fatal, for now
//sciprintf("%s, L%d: Attempt to use non-node "PREG" as list node\n", __FILE__, __LINE__, PRINT_REG(addr));
//script_debug_flag = script_error_flag = 1;
- warning("%s, L%d: Attempt to use non-node "PREG" as list node\n", __FILE__, __LINE__, PRINT_REG(addr));
+ warning("%s, L%d: Attempt to use non-node "PREG" as list node", __FILE__, __LINE__, PRINT_REG(addr));
return NULL;
}
NodeTable *nt = (NodeTable *)mobj;
if (!ENTRY_IS_VALID(nt, addr.offset)) {
- sciprintf("%s, L%d: Attempt to use non-node "PREG" as list node\n", __FILE__, __LINE__, PRINT_REG(addr));
+ sciprintf("%s, L%d: Attempt to use non-node "PREG" as list node", __FILE__, __LINE__, PRINT_REG(addr));
script_debug_flag = script_error_flag = 1;
return NULL;
}
@@ -57,7 +57,7 @@
MemObject *mobj = GET_SEGMENT(*s->seg_manager, addr.segment, MEM_OBJ_LISTS);
if (!mobj) {
- sciprintf("%s, L%d: Attempt to use non-list "PREG" as list\n", __FILE__, __LINE__, PRINT_REG(addr));
+ sciprintf("%s, L%d: Attempt to use non-list "PREG" as list", __FILE__, __LINE__, PRINT_REG(addr));
script_debug_flag = script_error_flag = 1;
return NULL;
}
@@ -302,7 +302,7 @@
reg_t kNodeValue(EngineState *s, int funct_nr, int argc, reg_t *argv) {
Node *n = lookup_node(s, argv[0]);
if (!sane_nodep(s, argv[0])) {
- error("List node at "PREG" is not sane!\n", PRINT_REG(argv[0]));
+ error("List node at "PREG" is not sane", PRINT_REG(argv[0]));
script_debug_flag = script_error_flag = 0;
return NULL_REG;
}
@@ -321,11 +321,11 @@
Node *newnode = lookup_node(s, argv[2]);
if (!l || !sane_listp(s, argv[0]))
- error("List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0]));
+ error("List at "PREG" is not sane anymore", PRINT_REG(argv[0]));
// FIXME: This should be an error, but it's turned to a warning for now
if (!newnode) {
- warning("New 'node' "PREG" is not a node!\n", argv[1], argv[2]);
+ warning("New 'node' "PREG" is not a node", PRINT_REG(argv[2]));
return NULL_REG;
}
@@ -368,7 +368,7 @@
SCIkdebug(SCIkNODES, "Looking for key "PREG" in list "PREG"\n", PRINT_REG(key), PRINT_REG(list_pos));
if (!sane_listp(s, list_pos))
- error("List at "PREG" is not sane anymore!\n", PRINT_REG(list_pos));
+ error("List at "PREG" is not sane anymore", PRINT_REG(list_pos));
node_pos = lookup_list(s, list_pos)->first;
Modified: scummvm/trunk/engines/sci/engine/kstring.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kstring.cpp 2009-05-18 10:40:22 UTC (rev 40679)
+++ scummvm/trunk/engines/sci/engine/kstring.cpp 2009-05-18 11:53:04 UTC (rev 40680)
@@ -34,7 +34,7 @@
#define CHECK_OVERFLOW1(pt, size, rv) \
if (((pt) - (str_base)) + (size) > maxsize) { \
- error("String expansion exceeded heap boundaries\n"); \
+ error("String expansion exceeded heap boundaries"); \
return rv;\
}
@@ -51,7 +51,7 @@
textres = s->resmgr->findResource(kResourceTypeText, address.offset, 0);
if (!textres) {
- error("text.%03d not found\n", address);
+ error("text.%03d not found", address.offset);
return NULL; /* Will probably segfault */
}
@@ -65,7 +65,7 @@
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", _index, address.offset);
return 0;
}
@@ -706,7 +706,7 @@
if (!textres) {
- error("text.%d does not exist\n", UKPV(0));
+ error("text.%d does not exist", UKPV(0));
return NULL_REG;
}
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