aboutsummaryrefslogtreecommitdiff
path: root/cyclone/hammer/offer.c
diff options
context:
space:
mode:
authorN.N. <krzyszcz@users.sourceforge.net>2004-12-08 15:40:14 +0000
committerN.N. <krzyszcz@users.sourceforge.net>2004-12-08 15:40:14 +0000
commitd5a39ff6469f8762218c00a34f4b0a120a56332b (patch)
tree8b5d6f1008f1ce09daf3e2a63b71f9c142911e80 /cyclone/hammer/offer.c
parentb88a64023a08ed9a0e520058ef8be200515d9639 (diff)
various bug-fixes, maxmode, toxy .#args
svn path=/trunk/externals/miXed/; revision=2360
Diffstat (limited to 'cyclone/hammer/offer.c')
-rw-r--r--cyclone/hammer/offer.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/cyclone/hammer/offer.c b/cyclone/hammer/offer.c
index 3823c85..1e247e7 100644
--- a/cyclone/hammer/offer.c
+++ b/cyclone/hammer/offer.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2002-2003 krzYszcz and others.
+/* Copyright (c) 2002-2004 krzYszcz and others.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
@@ -7,9 +7,9 @@
#include "hammer/tree.h"
/* As a class `derived' from the common hammertree code (also in funbuff),
- offer uses the auxiliary list, generally not needed here.
- As a side-effect, it gets a bonus of a small speedup of deletion,
- and a penalty of a small slowdown of insertion. */
+ offer maintains the auxiliary list, the main purpose of which is faster
+ traversal (not needed here). As a side-effect, there is a bonus of a small
+ speedup of deletion, and a penalty of a small slowdown of insertion. */
typedef struct _offer
{
@@ -29,13 +29,12 @@ static void offer_float(t_offer *x, t_float f)
t_hammernode *np;
if (x->x_valueset)
{
- if (np = hammertree_insert(&x->x_tree, ndx))
- np->n_value = x->x_value;
+ hammertree_insertfloat(&x->x_tree, ndx, x->x_value, 1);
x->x_valueset = 0;
}
else if (np = hammertree_search(&x->x_tree, ndx))
{
- outlet_float(((t_object *)x)->ob_outlet, np->n_value);
+ outlet_float(((t_object *)x)->ob_outlet, HAMMERNODE_GETFLOAT(np));
hammertree_delete(&x->x_tree, np);
}
}
@@ -57,7 +56,7 @@ static void offer_clear(t_offer *x)
#ifdef HAMMERTREE_DEBUG
static void offer_debug(t_offer *x, t_floatarg f)
{
- hammertree_debug(&x->x_tree, (int)f);
+ hammertree_debug(&x->x_tree, (int)f, 0);
}
#endif
@@ -70,7 +69,7 @@ static void *offer_new(void)
{
t_offer *x = (t_offer *)pd_new(offer_class);
x->x_valueset = 0;
- hammertree_init(&x->x_tree, 0);
+ hammertree_inittyped(&x->x_tree, HAMMERTYPE_FLOAT, 0);
inlet_new((t_object *)x, (t_pd *)x, &s_float, gensym("ft1"));
outlet_new((t_object *)x, &s_float);
return (x);