From 739a8290a8b05645a2d055aed8e5eb76ba2e24e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 28 Aug 2015 17:55:26 +0000 Subject: one-true indentation svn path=/trunk/externals/zexy/; revision=17537 --- src/wrap.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'src/wrap.c') diff --git a/src/wrap.c b/src/wrap.c index 1ecc7c1..fb1c598 100644 --- a/src/wrap.c +++ b/src/wrap.c @@ -1,4 +1,4 @@ -/* +/* * wrap: wrap floats between two limits * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) @@ -7,12 +7,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ @@ -28,18 +28,22 @@ typedef struct _wrap { static void wrap_float(t_wrap *x, t_float f) { - if (x->f_lower==x->f_upper) + if (x->f_lower==x->f_upper) { outlet_float(x->x_obj.ob_outlet, x->f_lower); - else { + } else { t_float modulo = fmod((f-x->f_lower),(x->f_upper-x->f_lower)); - if (modulo<0)modulo+=(x->f_upper-x->f_lower); - + if (modulo<0) { + modulo+=(x->f_upper-x->f_lower); + } + outlet_float(x->x_obj.ob_outlet, x->f_lower+modulo); } } -static void wrap_set(t_wrap *x, t_symbol* UNUSED(s), int argc, t_atom *argv){ +static void wrap_set(t_wrap *x, t_symbol* UNUSED(s), int argc, + t_atom *argv) +{ t_float f1, f2; - switch (argc){ + switch (argc) { case 0: f1=0.0; f2=1.0; @@ -72,11 +76,12 @@ static void wrap_help(t_wrap*x) post("\n"HEARTSYMBOL" wrap\t\t:: wrap a float between to boundaries"); } -void wrap_setup(void) { +void wrap_setup(void) +{ wrap_class = class_new(gensym("wrap"), - (t_newmethod)wrap_new, - 0, sizeof(t_wrap), - CLASS_DEFAULT, A_GIMME, A_NULL); + (t_newmethod)wrap_new, + 0, sizeof(t_wrap), + CLASS_DEFAULT, A_GIMME, A_NULL); class_addfloat (wrap_class, wrap_float); class_addmethod(wrap_class, (t_method)wrap_set, gensym("set"), A_GIMME, 0); -- cgit v1.2.1