diff options
Diffstat (limited to 'engines/sci/engine/klists.cpp')
-rw-r--r-- | engines/sci/engine/klists.cpp | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp index da115499a0..2aa6ea2f48 100644 --- a/engines/sci/engine/klists.cpp +++ b/engines/sci/engine/klists.cpp @@ -38,7 +38,7 @@ Node *lookup_node(EngineState *s, reg_t addr, const char *file, int line) { // 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; - SCIkwarn(SCIkERROR, "%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\n", __FILE__, __LINE__, PRINT_REG(addr)); return NULL; } @@ -150,12 +150,13 @@ reg_t kDisposeList(EngineState *s, int funct_nr, int argc, reg_t *argv) { List *l = LOOKUP_LIST(argv[0]); if (!l) { - SCIkwarn(SCIkERROR, "Attempt to dispose non-list at "PREG"!\n", PRINT_REG(argv[0])); + // FIXME: This should be an error, but it's turned to a warning for now + warning("Attempt to dispose non-list at "PREG"!\n", PRINT_REG(argv[0])); return NULL_REG; } if (!sane_listp(s, argv[0])) - SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0])); + error("List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0])); /* if (!IS_NULL_REG(l->first)) { reg_t n_addr = l->first; @@ -202,7 +203,7 @@ reg_t kFirstNode(EngineState *s, int funct_nr, int argc, reg_t *argv) { List *l = LOOKUP_LIST(argv[0]); if (l && !sane_listp(s, argv[0])) - SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0])); + error("List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0])); if (l) return l->first; @@ -214,7 +215,7 @@ reg_t kLastNode(EngineState *s, int funct_nr, int argc, reg_t *argv) { List *l = LOOKUP_LIST(argv[0]); if (l && !sane_listp(s, argv[0])) - SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0])); + error("List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0])); if (l) return l->last; @@ -226,7 +227,7 @@ reg_t kEmptyList(EngineState *s, int funct_nr, int argc, reg_t *argv) { List *l = LOOKUP_LIST(argv[0]); if (!l || !sane_listp(s, argv[0])) - SCIkwarn(SCIkERROR, "List at "PREG" is invalid or not sane anymore!\n", PRINT_REG(argv[0])); + error("List at "PREG" is invalid or not sane anymore!\n", PRINT_REG(argv[0])); return make_reg(0, ((l) ? IS_NULL_REG(l->first) : 0)); } @@ -237,10 +238,11 @@ void _k_add_to_front(EngineState *s, reg_t listbase, reg_t nodebase) { SCIkdebug(SCIkNODES, "Adding node "PREG" to end of list "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase)); + // FIXME: This should be an error, but it's turned to a warning for now if (!new_n) - SCIkwarn(SCIkERROR, "Attempt to add non-node ("PREG") to list at "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase)); + warning("Attempt to add non-node ("PREG") to list at "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase)); if (!l || !sane_listp(s, listbase)) - SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(listbase)); + error("List at "PREG" is not sane anymore!\n", PRINT_REG(listbase)); new_n->succ = l->first; new_n->pred = NULL_REG; @@ -260,10 +262,11 @@ void _k_add_to_end(EngineState *s, reg_t listbase, reg_t nodebase) { SCIkdebug(SCIkNODES, "Adding node "PREG" to end of list "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase)); + // FIXME: This should be an error, but it's turned to a warning for now if (!new_n) - SCIkwarn(SCIkERROR, "Attempt to add non-node ("PREG") to list at "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase)); + warning("Attempt to add non-node ("PREG") to list at "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase)); if (!l || !sane_listp(s, listbase)) - SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(listbase)); + error("List at "PREG" is not sane anymore!\n", PRINT_REG(listbase)); new_n->succ = NULL_REG; new_n->pred = l->last; @@ -280,7 +283,7 @@ void _k_add_to_end(EngineState *s, reg_t listbase, reg_t nodebase) { reg_t kNextNode(EngineState *s, int funct_nr, int argc, reg_t *argv) { Node *n = LOOKUP_NODE(argv[0]); if (!sane_nodep(s, argv[0])) { - SCIkwarn(SCIkERROR, "List node at "PREG" is not sane anymore!\n", PRINT_REG(argv[0])); + error("List node at "PREG" is not sane anymore!\n", PRINT_REG(argv[0])); script_error_flag = script_debug_flag = 0; return NULL_REG; } @@ -291,7 +294,7 @@ reg_t kNextNode(EngineState *s, int funct_nr, int argc, reg_t *argv) { reg_t kPrevNode(EngineState *s, int funct_nr, int argc, reg_t *argv) { Node *n = LOOKUP_NODE(argv[0]); if (!sane_nodep(s, argv[0])) - SCIkwarn(SCIkERROR, "List node at "PREG" is not sane anymore!\n", PRINT_REG(argv[0])); + error("List node at "PREG" is not sane anymore!\n", PRINT_REG(argv[0])); return n->pred; } @@ -299,7 +302,7 @@ reg_t kPrevNode(EngineState *s, int funct_nr, int argc, reg_t *argv) { reg_t kNodeValue(EngineState *s, int funct_nr, int argc, reg_t *argv) { Node *n = LOOKUP_NODE(argv[0]); if (!sane_nodep(s, argv[0])) { - SCIkwarn(SCIkERROR, "List node at "PREG" is not sane!\n", PRINT_REG(argv[0])); + error("List node at "PREG" is not sane!\n", PRINT_REG(argv[0])); script_debug_flag = script_error_flag = 0; return NULL_REG; } @@ -318,10 +321,11 @@ reg_t kAddAfter(EngineState *s, int funct_nr, int argc, reg_t *argv) { Node *newnode = LOOKUP_NODE(argv[2]); if (!l || !sane_listp(s, argv[0])) - SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0])); + error("List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0])); + // FIXME: This should be an error, but it's turned to a warning for now if (!newnode) { - SCIkwarn(SCIkERROR, "New 'node' "PREG" is not a node!\n", argv[1], argv[2]); + warning("New 'node' "PREG" is not a node!\n", argv[1], argv[2]); return NULL_REG; } @@ -364,7 +368,7 @@ reg_t kFindKey(EngineState *s, int funct_nr, int argc, reg_t *argv) { SCIkdebug(SCIkNODES, "Looking for key "PREG" in list "PREG"\n", PRINT_REG(key), PRINT_REG(list_pos)); if (!sane_listp(s, list_pos)) - SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(list_pos)); + error("List at "PREG" is not sane anymore!\n", PRINT_REG(list_pos)); node_pos = LOOKUP_LIST(list_pos)->first; |