[Scummvm-cvs-logs] SF.net SVN: scummvm:[44503] scummvm/trunk/engines/sci/engine/klists.cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Thu Oct 1 00:54:00 CEST 2009
Revision: 44503
http://scummvm.svn.sourceforge.net/scummvm/?rev=44503&view=rev
Author: thebluegr
Date: 2009-09-30 22:54:00 +0000 (Wed, 30 Sep 2009)
Log Message:
-----------
Changed the list sanity checks to return warnings instead of errors in case of failure - apparently, this can occur in some games, e.g. Longbow and QFG1
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/klists.cpp
Modified: scummvm/trunk/engines/sci/engine/klists.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/klists.cpp 2009-09-30 22:43:29 UTC (rev 44502)
+++ scummvm/trunk/engines/sci/engine/klists.cpp 2009-09-30 22:54:00 UTC (rev 44503)
@@ -44,7 +44,7 @@
NodeTable *nt = (NodeTable *)mobj;
if (!nt->isValidEntry(addr.offset)) {
- error("Attempt to use non-node %04x:%04x as list node", PRINT_REG(addr));
+ warning("Attempt to use non-node %04x:%04x as list node", PRINT_REG(addr));
return NULL;
}
@@ -55,14 +55,14 @@
SegmentObj *mobj = GET_SEGMENT(*s->segMan, addr.segment, SEG_TYPE_LISTS);
if (!mobj) {
- error("Attempt to use non-list %04x:%04x as list", PRINT_REG(addr));
+ warning("Attempt to use non-list %04x:%04x as list", PRINT_REG(addr));
return NULL;
}
ListTable *lt = (ListTable *)mobj;
if (!lt->isValidEntry(addr.offset)) {
- error("Attempt to use non-list %04x:%04x as list", PRINT_REG(addr));
+ warning("Attempt to use non-list %04x:%04x as list", PRINT_REG(addr));
return NULL;
}
@@ -152,7 +152,7 @@
}
if (!sane_listp(s, argv[0]))
- error("List at %04x:%04x is not sane anymore", PRINT_REG(argv[0]));
+ warning("List at %04x:%04x is not sane anymore", PRINT_REG(argv[0]));
/* if (!l->first.isNull()) {
reg_t n_addr = l->first;
@@ -199,7 +199,7 @@
List *l = lookup_list(s, argv[0]);
if (l && !sane_listp(s, argv[0]))
- error("List at %04x:%04x is not sane anymore", PRINT_REG(argv[0]));
+ warning("List at %04x:%04x is not sane anymore", PRINT_REG(argv[0]));
if (l)
return l->first;
@@ -211,7 +211,7 @@
List *l = lookup_list(s, argv[0]);
if (l && !sane_listp(s, argv[0]))
- error("List at %04x:%04x is not sane anymore", PRINT_REG(argv[0]));
+ warning("List at %04x:%04x is not sane anymore", PRINT_REG(argv[0]));
if (l)
return l->last;
@@ -223,7 +223,7 @@
List *l = lookup_list(s, argv[0]);
if (!l || !sane_listp(s, argv[0]))
- error("List at %04x:%04x is invalid or not sane anymore", PRINT_REG(argv[0]));
+ warning("List at %04x:%04x is invalid or not sane anymore", PRINT_REG(argv[0]));
return make_reg(0, ((l) ? l->first.isNull() : 0));
}
@@ -238,7 +238,7 @@
if (!new_n)
warning("Attempt to add non-node (%04x:%04x) to list at %04x:%04x", PRINT_REG(nodebase), PRINT_REG(listbase));
if (!l || !sane_listp(s, listbase))
- error("List at %04x:%04x is not sane anymore", PRINT_REG(listbase));
+ warning("List at %04x:%04x is not sane anymore", PRINT_REG(listbase));
new_n->succ = l->first;
new_n->pred = NULL_REG;
@@ -262,7 +262,7 @@
if (!new_n)
warning("Attempt to add non-node (%04x:%04x) to list at %04x:%04x", PRINT_REG(nodebase), PRINT_REG(listbase));
if (!l || !sane_listp(s, listbase))
- error("List at %04x:%04x is not sane anymore", PRINT_REG(listbase));
+ warning("List at %04x:%04x is not sane anymore", PRINT_REG(listbase));
new_n->succ = NULL_REG;
new_n->pred = l->last;
@@ -279,7 +279,7 @@
reg_t kNextNode(EngineState *s, int argc, reg_t *argv) {
Node *n = lookup_node(s, argv[0]);
if (!sane_nodep(s, argv[0])) {
- error("List node at %04x:%04x is not sane anymore", PRINT_REG(argv[0]));
+ warning("List node at %04x:%04x is not sane anymore", PRINT_REG(argv[0]));
return NULL_REG;
}
@@ -289,7 +289,7 @@
reg_t kPrevNode(EngineState *s, int argc, reg_t *argv) {
Node *n = lookup_node(s, argv[0]);
if (!sane_nodep(s, argv[0]))
- error("List node at %04x:%04x is not sane anymore", PRINT_REG(argv[0]));
+ warning("List node at %04x:%04x is not sane anymore", PRINT_REG(argv[0]));
return n->pred;
}
@@ -297,7 +297,7 @@
reg_t kNodeValue(EngineState *s, int argc, reg_t *argv) {
Node *n = lookup_node(s, argv[0]);
if (!sane_nodep(s, argv[0])) {
- error("List node at %04x:%04x is not sane", PRINT_REG(argv[0]));
+ warning("List node at %04x:%04x is not sane", PRINT_REG(argv[0]));
return NULL_REG;
}
@@ -315,7 +315,7 @@
Node *newnode = lookup_node(s, argv[2]);
if (!l || !sane_listp(s, argv[0]))
- error("List at %04x:%04x is not sane anymore", PRINT_REG(argv[0]));
+ warning("List at %04x:%04x 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) {
@@ -361,7 +361,7 @@
debugC(2, kDebugLevelNodes, "Looking for key %04x:%04x in list %04x:%04x\n", PRINT_REG(key), PRINT_REG(list_pos));
if (!sane_listp(s, list_pos))
- error("List at %04x:%04x is not sane anymore", PRINT_REG(list_pos));
+ warning("List at %04x:%04x is not sane anymore", PRINT_REG(list_pos));
node_pos = lookup_list(s, list_pos)->first;
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