From f08f5c3bbf882b817ed6fc04530044e406ddd04f Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 4 Jun 2009 20:51:24 +0000 Subject: SCI: Slightly modified kAddAfter so that it does not modify its arguments needlessly svn-id: r41174 --- engines/sci/engine/kgraphics.cpp | 2 +- engines/sci/engine/klists.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'engines/sci/engine') diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 4ccc125eb4..8413a7887b 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -769,7 +769,7 @@ static int collides_with(EngineState *s, Common::Rect area, reg_t other_obj, int return 0; } -reg_t kCanBeHere(EngineState *s, int funct_nr, int argc, reg_t * argv) { +reg_t kCanBeHere(EngineState *s, int funct_nr, int argc, reg_t *argv) { reg_t obj = argv[0]; reg_t cliplist_ref = KP_ALT(1, NULL_REG); List *cliplist = NULL; diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp index 029954d00f..43d1f25e01 100644 --- a/engines/sci/engine/klists.cpp +++ b/engines/sci/engine/klists.cpp @@ -310,7 +310,7 @@ reg_t kAddToFront(EngineState *s, int funct_nr, int argc, reg_t *argv) { } reg_t kAddAfter(EngineState *s, int funct_nr, int argc, reg_t *argv) { - List *l =lookup_list(s, argv[0]); + List *l = lookup_list(s, argv[0]); Node *firstnode = argv[1].isNull() ? NULL : lookup_node(s, argv[1]); Node *newnode = lookup_node(s, argv[2]); @@ -341,12 +341,11 @@ reg_t kAddAfter(EngineState *s, int funct_nr, int argc, reg_t *argv) { else lookup_node(s, oldnext)->pred = argv[2]; - return s->r_acc; } else { // !firstnode - // Prepare call to AddToFront... - argv[1] = argv[0]; - return kAddToFront(s, funct_nr, 2, argv + 1); // Set as initial list node + _k_add_to_front(s, argv[0], argv[2]); // Set as initial list node } + + return s->r_acc; } reg_t kAddToEnd(EngineState *s, int funct_nr, int argc, reg_t *argv) { -- cgit v1.2.3