Index: sgame/saccessory.c =================================================================== RCS file: /fridge/cvs/xscorch/sgame/saccessory.c,v retrieving revision 1.30 diff -u -r1.30 saccessory.c --- sgame/saccessory.c 25 Mar 2004 04:55:06 -0000 1.30 +++ sgame/saccessory.c 9 Jul 2004 16:48:51 -0000 @@ -1,7 +1,7 @@ /* $Header: /fridge/cvs/xscorch/sgame/saccessory.c,v 1.30 2004/03/25 04:55:06 jacob Exp $ */ /* - xscorch - saccessory.c Copyright(c) 2000-2003 Jacob Luna Lundberg + xscorch - saccessory.c Copyright(c) 2000-2004 Jacob Luna Lundberg Copyright(c) 2000-2003 Justin David Smith jacob(at)chaos2.org http://chaos2.org/~jacob justins(at)chaos2.org http://chaos2.org/ @@ -64,7 +64,7 @@ -static bool _sc_accessory_test_count(void *data, int arg) { +static bool _sc_accessory_test_count(void *data, long arg) { /* _sc_accessory_test_count This is an sc_registry_test function. We will iterate, incrementing a counter, but always returning false. */ @@ -99,7 +99,7 @@ ata.flags = flags; ata.ac = ac; iter = sc_registry_iter_new(ac->registry, ac->registryclass, SC_REGISTRY_FORWARD, - _sc_accessory_test_count, (int)(&ata)); + _sc_accessory_test_count, (long)(&ata)); if(iter == NULL) return(0); /* Iterate using the fast registry iterators. */ @@ -135,7 +135,7 @@ -static bool _sc_accessory_test_lookup_name(void *data, int arg) { +static bool _sc_accessory_test_lookup_name(void *data, long arg) { /* _sc_accessory_test_lookup_name This is an sc_registry_test function. We will seek, search, discover the accessory by name. */ @@ -166,13 +166,9 @@ /* Set up for iteration. */ ata.name = name; - if(flags & SC_ACCESSORY_SCAN_REVERSE) { - iter = sc_registry_iter_new(ac->registry, ac->registryclass, SC_REGISTRY_REVERSE, - _sc_accessory_test_lookup_name, (int)(&ata)); - } else { - iter = sc_registry_iter_new(ac->registry, ac->registryclass, SC_REGISTRY_FORWARD, - _sc_accessory_test_lookup_name, (int)(&ata)); - } + iter = sc_registry_iter_new(ac->registry, ac->registryclass, + (flags & SC_ACCESSORY_SCAN_REVERSE) ? SC_REGISTRY_REVERSE : SC_REGISTRY_FORWARD, + _sc_accessory_test_lookup_name, (long)(&ata)); if(iter == NULL) return(NULL); /* Iterate using the fast registry iterators. */ @@ -191,7 +187,7 @@ -static bool _sc_accessory_test_viewable(void *data, int arg) { +static bool _sc_accessory_test_viewable(void *data, long arg) { /* _sc_accessory_test_viewable This is an sc_registry_test function. We will return true for the first viewable accessory. */ @@ -222,13 +218,9 @@ ata.flags = flags; /* Try and find the first/last accessory that meets our criteria. */ - if(flags & SC_ACCESSORY_SCAN_REVERSE) { - info = sc_registry_find_first(ac->registry, ac->registryclass, SC_REGISTRY_REVERSE, - _sc_accessory_test_viewable, (int)(&ata)); - } else { - info = sc_registry_find_first(ac->registry, ac->registryclass, SC_REGISTRY_FORWARD, - _sc_accessory_test_viewable, (int)(&ata)); - } + info = sc_registry_find_first(ac->registry, ac->registryclass, + (flags & SC_ACCESSORY_SCAN_REVERSE) ? SC_REGISTRY_REVERSE : SC_REGISTRY_FORWARD, + _sc_accessory_test_viewable, (long)(&ata)); return(info); @@ -239,7 +231,6 @@ /* sc_accessory_next Advance to the next/prev accessory in the list (with wrapping). */ - int regflag; sc_accessory_test_arg ata; sc_accessory_info *nxtnfo; @@ -248,14 +239,11 @@ /* Set up the flags and args for the mission. */ ata.ac = ac; ata.flags = flags; - if(flags & SC_ACCESSORY_SCAN_REVERSE) - regflag = SC_REGISTRY_REVERSE; - else - regflag = SC_REGISTRY_FORWARD; /* Try and find the first/last accessory that meets our criteria. */ - nxtnfo = sc_registry_find_next(ac->registry, ac->registryclass, info->ident, regflag, - _sc_accessory_test_viewable, (int)(&ata)); + nxtnfo = sc_registry_find_next(ac->registry, ac->registryclass, info->ident, + (flags & SC_ACCESSORY_SCAN_REVERSE) ? SC_REGISTRY_REVERSE : SC_REGISTRY_FORWARD, + _sc_accessory_test_viewable, (long)(&ata)); /* In case we iterated off the end of the list, wrap to the beginning. */ if(nxtnfo == NULL) @@ -431,7 +419,7 @@ -static bool _sc_accessory_inventory_clear_func(void *data, unused int arg) { +static bool _sc_accessory_inventory_clear_func(void *data, unused long arg) { /* _sc_accessory_inventory_clear_func Clear accessory inventory data, in registry fast iterators. */ Index: sgame/seconomy.c =================================================================== RCS file: /fridge/cvs/xscorch/sgame/seconomy.c,v retrieving revision 1.14 diff -u -r1.14 seconomy.c --- sgame/seconomy.c 26 Feb 2004 06:34:54 -0000 1.14 +++ sgame/seconomy.c 9 Jul 2004 16:48:51 -0000 @@ -204,7 +204,7 @@ -bool _sc_scoring_test_lookup_name(void *data, int arg) { +bool _sc_scoring_test_lookup_name(void *data, long arg) { /* _sc_scoring_test_lookup_name This is an sc_registry_test function. We will select from the registry by name. */ @@ -234,7 +234,7 @@ /* Set up for iteration. */ iter = sc_registry_iter_new(ec->registry, ec->registryclass, SC_REGISTRY_FORWARD, - _sc_scoring_test_lookup_name, (int)(name)); + _sc_scoring_test_lookup_name, (long)(name)); if(iter == NULL) return(NULL); /* Iterate using the fast registry iterators. */ Index: sgame/sregistry.c =================================================================== RCS file: /fridge/cvs/xscorch/sgame/sregistry.c,v retrieving revision 1.5 diff -u -r1.5 sregistry.c --- sgame/sregistry.c 26 Feb 2004 06:34:54 -0000 1.5 +++ sgame/sregistry.c 9 Jul 2004 16:48:51 -0000 @@ -1,7 +1,7 @@ /* $Header: /fridge/cvs/xscorch/sgame/sregistry.c,v 1.5 2004/02/26 06:34:54 justins Exp $ */ /* - xscorch - sregistry.c Copyright(c) 2003 Jacob Luna Lundberg + xscorch - sregistry.c Copyright(c) 2003-2004 Jacob Luna Lundberg jacob(at)chaos2.org http://chaos2.org/~jacob Scorched runtime fast data registry @@ -27,10 +27,6 @@ -bool (*test)(void *, int); - - - sc_registry *sc_registry_new(void) { /* sc_registry_new Allocate and initialize a new registry. */ @@ -190,7 +186,7 @@ -inline shashlist_item *_sc_registry_internal_iter(shashlist *list, shashlist_item *item, int class, sc_registry_direction direction, sc_registry_test_func function, int arg) { +inline shashlist_item *_sc_registry_internal_iter(shashlist *list, shashlist_item *item, int class, sc_registry_direction direction, sc_registry_test_func function, long arg) { /* _sc_registry_internal_iter Local function to find the next or prev entry in a set. */ @@ -213,7 +209,7 @@ -void *sc_registry_find_first(const sc_registry *registry, int class, sc_registry_direction direction, sc_registry_test_func function, int arg) { +void *sc_registry_find_first(const sc_registry *registry, int class, sc_registry_direction direction, sc_registry_test_func function, long arg) { /* sc_registry_find_first Find the first item of a given class. */ @@ -233,7 +229,7 @@ } -void *sc_registry_find_next(const sc_registry *registry, int class, int key, sc_registry_direction direction, sc_registry_test_func function, int arg) { +void *sc_registry_find_next(const sc_registry *registry, int class, int key, sc_registry_direction direction, sc_registry_test_func function, long arg) { /* sc_registry_find_next Find the next item of a given class, given an item. */ @@ -255,7 +251,7 @@ -sc_registry_iter *sc_registry_iter_new(const sc_registry *registry, int class, sc_registry_direction direction, sc_registry_test_func function, int arg) { +sc_registry_iter *sc_registry_iter_new(const sc_registry *registry, int class, sc_registry_direction direction, sc_registry_test_func function, long arg) { /* sc_registry_iter_new Allocate an sc_registry_iter struct for fast registry set iteration. */ Index: sgame/sregistry.h =================================================================== RCS file: /fridge/cvs/xscorch/sgame/sregistry.h,v retrieving revision 1.3 diff -u -r1.3 sregistry.h --- sgame/sregistry.h 26 Feb 2004 06:34:54 -0000 1.3 +++ sgame/sregistry.h 9 Jul 2004 16:48:51 -0000 @@ -1,7 +1,7 @@ /* $Header: /fridge/cvs/xscorch/sgame/sregistry.h,v 1.3 2004/02/26 06:34:54 justins Exp $ */ /* - xscorch - sregistry.h Copyright(c) 2003 Jacob Luna Lundberg + xscorch - sregistry.h Copyright(c) 2003-2004 Jacob Luna Lundberg jacob(at)chaos2.org http://chaos2.org/~jacob Scorched runtime fast data registry @@ -39,7 +39,7 @@ /* Footprint of registry iteration test functions. */ -typedef bool(*sc_registry_test_func)(void *, int); +typedef bool(*sc_registry_test_func)(void *, long); #define SC_REGISTRY_TEST_NULL (sc_registry_test_func)NULL @@ -64,12 +64,12 @@ * The basic level of selection is the class of the data item, * which is specified when it is entered into the registry. * However, the iterator functions also take a function in - * their args. The function, and one integer argument, will + * their args. The function, and one long int argument, will * be called on the data being tested for set membership. * If the function returns true, the data will be admitted. */ typedef struct _sc_registry_iter { - int arg; + long arg; int class; struct _shashlist_item *current; sc_registry_direction direction; @@ -99,12 +99,12 @@ /* Searching in the registry... */ void *sc_registry_find_by_int(const sc_registry *registry, int key); void *sc_registry_find_by_string(const sc_registry *registry, const char *key); -void *sc_registry_find_first(const sc_registry *registry, int class, sc_registry_direction direction, sc_registry_test_func function, int arg); -void *sc_registry_find_next(const sc_registry *registry, int class, int key, sc_registry_direction direction, sc_registry_test_func function, int arg); +void *sc_registry_find_first(const sc_registry *registry, int class, sc_registry_direction direction, sc_registry_test_func function, long arg); +void *sc_registry_find_next(const sc_registry *registry, int class, int key, sc_registry_direction direction, sc_registry_test_func function, long arg); /* Fast iteration through the registry. */ -sc_registry_iter *sc_registry_iter_new(const sc_registry *registry, int class, sc_registry_direction direction, sc_registry_test_func function, int arg); +sc_registry_iter *sc_registry_iter_new(const sc_registry *registry, int class, sc_registry_direction direction, sc_registry_test_func function, long arg); void sc_registry_iter_free(sc_registry_iter **iter); void *sc_registry_iterate(sc_registry_iter *iter); Index: sgame/sweapon.c =================================================================== RCS file: /fridge/cvs/xscorch/sgame/sweapon.c,v retrieving revision 1.71 diff -u -r1.71 sweapon.c --- sgame/sweapon.c 25 Mar 2004 04:55:06 -0000 1.71 +++ sgame/sweapon.c 9 Jul 2004 16:48:51 -0000 @@ -1,7 +1,7 @@ /* $Header: /fridge/cvs/xscorch/sgame/sweapon.c,v 1.71 2004/03/25 04:55:06 jacob Exp $ */ /* - xscorch - sweapon.c Copyright(c) 2000-2003 Jacob Luna Lundberg + xscorch - sweapon.c Copyright(c) 2000-2004 Jacob Luna Lundberg Copyright(c) 2000-2003 Justin David Smith jacob(at)chaos2.org http://chaos2.org/~jacob justins(at)chaos2.org http://chaos2.org/ @@ -76,7 +76,7 @@ -static bool _sc_weapon_test_count(void *data, int arg) { +static bool _sc_weapon_test_count(void *data, long arg) { /* _sc_weapon_test_count This is an sc_registry_test function. We will iterate, incrementing a counter, but always returning false. */ @@ -111,7 +111,7 @@ wta.flags = flags; wta.wc = wc; iter = sc_registry_iter_new(wc->registry, wc->registryclass, SC_REGISTRY_FORWARD, - _sc_weapon_test_count, (int)(&wta)); + _sc_weapon_test_count, (long)(&wta)); if(iter == NULL) return(0); /* Iterate using the fast registry iterators. */ @@ -147,7 +147,7 @@ -static bool _sc_weapon_test_lookup_name(void *data, int arg) { +static bool _sc_weapon_test_lookup_name(void *data, long arg) { /* _sc_weapon_test_lookup_name This is an sc_registry_test function. We will seek, search, discover the weapon by name. */ @@ -178,13 +178,9 @@ /* Set up for iteration. */ wta.name = name; - if(flags & SC_WEAPON_SCAN_REVERSE) { - iter = sc_registry_iter_new(wc->registry, wc->registryclass, SC_REGISTRY_REVERSE, - _sc_weapon_test_lookup_name, (int)(&wta)); - } else { - iter = sc_registry_iter_new(wc->registry, wc->registryclass, SC_REGISTRY_FORWARD, - _sc_weapon_test_lookup_name, (int)(&wta)); - } + iter = sc_registry_iter_new(wc->registry, wc->registryclass, + (flags & SC_WEAPON_SCAN_REVERSE) ? SC_REGISTRY_REVERSE : SC_REGISTRY_FORWARD, + _sc_weapon_test_lookup_name, (long)(&wta)); if(iter == NULL) return(NULL); /* Iterate using the fast registry iterators. */ @@ -203,7 +199,7 @@ -static bool _sc_weapon_test_viewable(void *data, int arg) { +static bool _sc_weapon_test_viewable(void *data, long arg) { /* _sc_weapon_test_viewable This is an sc_registry_test function. We will return true for the first viewable weapon. */ @@ -234,13 +230,9 @@ wta.flags = flags; /* Try and find the first/last weapon that meets our criteria. */ - if(flags & SC_WEAPON_SCAN_REVERSE) { - info = sc_registry_find_first(wc->registry, wc->registryclass, SC_REGISTRY_REVERSE, - _sc_weapon_test_viewable, (int)(&wta)); - } else { - info = sc_registry_find_first(wc->registry, wc->registryclass, SC_REGISTRY_FORWARD, - _sc_weapon_test_viewable, (int)(&wta)); - } + info = sc_registry_find_first(wc->registry, wc->registryclass, + (flags & SC_WEAPON_SCAN_REVERSE) ? SC_REGISTRY_REVERSE : SC_REGISTRY_FORWARD, + _sc_weapon_test_viewable, (long)(&wta)); return(info); @@ -251,7 +243,6 @@ /* sc_weapon_next Advance to the next/prev weapon in the list (with wrapping). */ - int regflag; sc_weapon_test_arg wta; sc_weapon_info *nxtnfo; @@ -260,14 +251,11 @@ /* Set up the flags and args for the mission. */ wta.wc = wc; wta.flags = flags; - if(flags & SC_WEAPON_SCAN_REVERSE) - regflag = SC_REGISTRY_REVERSE; - else - regflag = SC_REGISTRY_FORWARD; /* Try and find the first/last weapon that meets our criteria. */ - nxtnfo = sc_registry_find_next(wc->registry, wc->registryclass, info->ident, regflag, - _sc_weapon_test_viewable, (int)(&wta)); + nxtnfo = sc_registry_find_next(wc->registry, wc->registryclass, info->ident, + (flags & SC_WEAPON_SCAN_REVERSE) ? SC_REGISTRY_REVERSE : SC_REGISTRY_FORWARD, + _sc_weapon_test_viewable, (long)(&wta)); /* In case we iterated off the end of the list, wrap to the beginning. */ if(nxtnfo == NULL) @@ -891,7 +879,7 @@ -bool _sc_weapon_inventory_clear_func(void *data, unused int arg) { +bool _sc_weapon_inventory_clear_func(void *data, unused long arg) { /* _sc_weapon_inventory_clear_func Clear weapon inventory data, in registry fast iterators. */ Index: sgtk/sstatus-gtk.c =================================================================== RCS file: /fridge/cvs/xscorch/sgtk/sstatus-gtk.c,v retrieving revision 1.35 diff -u -r1.35 sstatus-gtk.c --- sgtk/sstatus-gtk.c 26 Feb 2004 06:34:55 -0000 1.35 +++ sgtk/sstatus-gtk.c 9 Jul 2004 16:48:51 -0000 @@ -111,7 +111,7 @@ if(!SC_STATE_IS_ENABLED(w->c->game) || SC_STATE_IS_PAUSE(w->c->game)) return(FALSE); /* What action to perform? */ - switch((int)spot->data) { + switch((long)spot->data) { case SC_STATUS_TOGGLE_WEAPON: sc_player_advance_weapon(w->c, curplayer, 1); return(TRUE); Index: sgtk/stank-gtk.c =================================================================== RCS file: /fridge/cvs/xscorch/sgtk/stank-gtk.c,v retrieving revision 1.20 diff -u -r1.20 stank-gtk.c --- sgtk/stank-gtk.c 26 Feb 2004 06:34:55 -0000 1.20 +++ sgtk/stank-gtk.c 9 Jul 2004 16:48:51 -0000 @@ -1,7 +1,7 @@ /* $Header: /fridge/cvs/xscorch/sgtk/stank-gtk.c,v 1.20 2004/02/26 06:34:55 justins Exp $ */ /* - xscorch - stank-gtk.c Copyright(c) 2000-2003 Justin David Smith + xscorch - stank-gtk.c Copyright(c) 2000-2004 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Tank configuration screen @@ -138,7 +138,7 @@ char buf[SC_GTK_STRING_BUFFER]; int fuel; - switch((int)spot->data) { + switch((long)spot->data) { case 1: if(sc_player_move(w->c, w->c->plorder[w->c->game->curplayer], -1)) { fuel = sc_player_total_fuel(w->c->accessories, w->c->plorder[w->c->game->curplayer]);