diff options
author | Miller Puckette <millerpuckette@users.sourceforge.net> | 2008-05-22 18:25:27 +0000 |
---|---|---|
committer | Miller Puckette <millerpuckette@users.sourceforge.net> | 2008-05-22 18:25:27 +0000 |
commit | 619bf2d74ef3e5431cb6057698f324590368122b (patch) | |
tree | 6f94196bba4a6bd11bb51b2feb598e7d242aec16 /pd/src/x_arithmetic.c | |
parent | 7007d5067b69480ad5d61edee496a50b6114a0c1 (diff) |
0.42-0 test 01. No real work yet, just bug fixes and updates.
svn path=/trunk/; revision=9867
Diffstat (limited to 'pd/src/x_arithmetic.c')
-rw-r--r-- | pd/src/x_arithmetic.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/pd/src/x_arithmetic.c b/pd/src/x_arithmetic.c index f64c8cbd..0dd19937 100644 --- a/pd/src/x_arithmetic.c +++ b/pd/src/x_arithmetic.c @@ -623,7 +623,6 @@ static void log_float(t_object *x, t_float f) outlet_float(x->ob_outlet, r); } - static t_class *exp_class; /* ----------- exp --------------- */ static void *exp_new(void) @@ -659,6 +658,20 @@ static void abs_float(t_object *x, t_float f) outlet_float(x->ob_outlet, fabsf(f)); } +static t_class *wrap_class; /* ----------- wrap --------------- */ + +static void *wrap_new(void) +{ + t_object *x = (t_object *)pd_new(wrap_class); + outlet_new(x, &s_float); + return (x); +} + +static void wrap_float(t_object *x, t_float f) +{ + outlet_float(x->ob_outlet, f - floor(f)); +} + /* ------------------------ misc ------------------------ */ static t_class *clip_class; @@ -898,6 +911,11 @@ void x_arithmetic_setup(void) class_addfloat(abs_class, (t_method)abs_float); class_sethelpsymbol(abs_class, math_sym); + wrap_class = class_new(gensym("wrap"), wrap_new, 0, + sizeof(t_object), 0, 0); + class_addfloat(wrap_class, (t_method)wrap_float); + class_sethelpsymbol(wrap_class, math_sym); + /* ------------------------ misc ------------------------ */ clip_setup(); |