diff options
Diffstat (limited to 'src/tabset.c')
-rw-r--r-- | src/tabset.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/tabset.c b/src/tabset.c index f7b0eec..33909f1 100644 --- a/src/tabset.c +++ b/src/tabset.c @@ -1,4 +1,4 @@ -/* +/* * tabset: set a table with a list of floats * * (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 <http://www.gnu.org/licenses/>. */ @@ -26,8 +26,7 @@ static t_class *tabset_class; -typedef struct _tabset -{ +typedef struct _tabset { t_object x_obj; t_symbol *x_arrayname; } t_tabset; @@ -38,12 +37,12 @@ static void tabset_float(t_tabset *x, t_floatarg f) int npoints; zarray_t *vec; - if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) + if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) { error("%s: no such array", x->x_arrayname->s_name); - else if (!zarray_getarray(A, &npoints, &vec)) + } else if (!zarray_getarray(A, &npoints, &vec)) { error("%s: bad template for tabset", x->x_arrayname->s_name); - else { - while(npoints--){ + } else { + while(npoints--) { zarray_setfloat(vec, 0, f); vec++; } @@ -51,31 +50,32 @@ static void tabset_float(t_tabset *x, t_floatarg f) } } -static void tabset_list(t_tabset *x, t_symbol* UNUSED(s), int argc, t_atom* argv) +static void tabset_list(t_tabset *x, t_symbol* UNUSED(s), int argc, + t_atom* argv) { t_garray *A; int npoints; zarray_t *vec; - if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) + if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class))) { error("%s: no such array", x->x_arrayname->s_name); - else if (!zarray_getarray(A, &npoints, &vec)) + } else if (!zarray_getarray(A, &npoints, &vec)) { error("%s: bad template for tabset", x->x_arrayname->s_name); - else { + } else { if (argc>=npoints) - while(npoints--){ + while(npoints--) { t_float f= atom_getfloat(argv++); zarray_setfloat(vec, 0, f); vec++; } else { npoints-=argc; - while (argc--){ + while (argc--) { t_float f= atom_getfloat(argv++); zarray_setfloat(vec, 0, f); vec++; } - while (npoints--){ + while (npoints--) { zarray_setfloat(vec, 0, 0); vec++; } @@ -108,11 +108,11 @@ static void tabset_helper(void) void tabset_setup(void) { tabset_class = class_new(gensym("tabset"), (t_newmethod)tabset_new, - 0, sizeof(t_tabset), 0, A_DEFSYM, 0); + 0, sizeof(t_tabset), 0, A_DEFSYM, 0); class_addfloat(tabset_class, (t_method)tabset_float); class_addlist (tabset_class, (t_method)tabset_list); class_addmethod(tabset_class, (t_method)tabset_set, gensym("set"), - A_SYMBOL, 0); + A_SYMBOL, 0); class_addmethod(tabset_class, (t_method)tabset_helper, gensym("help"), 0); zexy_register("tabset"); |