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/dirac~.c | 67 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 33 insertions(+), 34 deletions(-) (limited to 'src/dirac~.c') diff --git a/src/dirac~.c b/src/dirac~.c index 3213c82..9c8745a 100644 --- a/src/dirac~.c +++ b/src/dirac~.c @@ -1,21 +1,21 @@ -/* +/* * dirac~: unity sample * * (c) 1999-2011 IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem) * * optimizations: - * (c) 2005 tim blechmann + * (c) 2005 tim blechmann * * This program is free software; you can redistribute it and/or * 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 . */ @@ -34,13 +34,12 @@ #include "zexy.h" -/* ------------------------ dirac~ ----------------------------- */ +/* ------------------------ dirac~ ----------------------------- */ static t_class *dirac_class; -typedef struct _dirac -{ +typedef struct _dirac { t_object x_obj; t_int position; t_int do_it; @@ -61,29 +60,28 @@ static t_int *dirac_perform(t_int *w) t_dirac *x = (t_dirac *)(w[1]); t_sample *out = (t_sample *)(w[2]); int n = (int)(w[3]); - + t_int do_it = x->do_it; zero_perform(w+1); - if (do_it >= n) + if (do_it >= n) { x->do_it -= n; - else if(do_it >= 0) - { - out[do_it] = 1.f; - x->do_it = -1; - } + } else if(do_it >= 0) { + out[do_it] = 1.f; + x->do_it = -1; + } return (w+4); } #ifndef __WIN32__ - /* LATER: investigate the occurence of zero_perf8() */ - /* it seems, like pd has the symbol zero_perf8(), - * but it is not exported by m_pd.h: - * so linux can use it, but w32 not - * have to tell miller about that - */ +/* LATER: investigate the occurence of zero_perf8() */ +/* it seems, like pd has the symbol zero_perf8(), + * but it is not exported by m_pd.h: + * so linux can use it, but w32 not + * have to tell miller about that + */ t_int *zero_perf8(t_int *w); #else /* on w32 we have no access to this hidden function anyhow... */ @@ -95,27 +93,27 @@ static t_int *dirac_perf8(t_int *w) t_dirac *x = (t_dirac *)(w[1]); t_sample *out = (t_sample *)(w[2]); int n = (int)(w[3]); - + t_int do_it = x->do_it; zero_perf8(w+1); - if (do_it >= n) + if (do_it >= n) { x->do_it -= n; - else if(do_it >= 0) - { - out[do_it] = 1.f; - x->do_it = -1; - } + } else if(do_it >= 0) { + out[do_it] = 1.f; + x->do_it = -1; + } return (w+4); } static void dirac_dsp(t_dirac *x, t_signal **sp) { - if (sp[0]->s_n & 7) + if (sp[0]->s_n & 7) { dsp_add(dirac_perform, 3, x, sp[0]->s_vec, sp[0]->s_n); - else + } else { dsp_add(dirac_perf8, 3, x, sp[0]->s_vec, sp[0]->s_n); + } } static void dirac_helper(void) @@ -139,19 +137,20 @@ static void *dirac_new(t_floatarg where) // x->do_it = where; x->do_it = -1; - if (where > 0) + if (where > 0) { x->position = where; - else + } else { x->position = -where; + } return (x); } - + void dirac_tilde_setup(void) { dirac_class = class_new(gensym("dirac~"), (t_newmethod)dirac_new, 0, sizeof(t_dirac), 0, A_DEFFLOAT, 0); - class_addfloat(dirac_class, dirac_float); - class_addbang(dirac_class, dirac_bang); + class_addfloat(dirac_class, dirac_float); + class_addbang(dirac_class, dirac_bang); class_addmethod(dirac_class, (t_method)dirac_dsp, gensym("dsp"), 0); class_addmethod(dirac_class, (t_method)dirac_helper, gensym("help"), 0); -- cgit v1.2.1