From 4f8c7c28f8ece71d15ed28ae30f253725f1efa39 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sat, 20 Oct 2012 18:32:25 +0000 Subject: update code format to pd-style: astyle --style=ansi --align-pointer=name *.c svn path=/trunk/externals/moonlib/; revision=16427 --- tabsort2.c | 114 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 57 insertions(+), 57 deletions(-) (limited to 'tabsort2.c') diff --git a/tabsort2.c b/tabsort2.c index b447bf2..67232de 100644 --- a/tabsort2.c +++ b/tabsort2.c @@ -1,5 +1,5 @@ /* -Copyright (C) 2002 Antoine Rousseau +Copyright (C) 2002 Antoine Rousseau This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -13,7 +13,7 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -46,102 +46,102 @@ static void *tabsort2_new(t_symbol *tab1,t_symbol *tab2,t_symbol *tab3) x->x_arrayname2 = tab2; x->x_arrayname3 = tab3; x->x_clock = clock_new(x, (t_method)tabsort2_tick); - outlet_new((t_object*)x, &s_float); + outlet_new((t_object *)x, &s_float); return (x); } static void tabsort2_set1(t_tabsort2 *x, t_symbol *s) { - x->x_arrayname1 = s; + x->x_arrayname1 = s; } static void tabsort2_set2(t_tabsort2 *x, t_symbol *s) { - x->x_arrayname2 = s; + x->x_arrayname2 = s; } static void tabsort2_set3(t_tabsort2 *x, t_symbol *s) { - x->x_arrayname3 = s; + x->x_arrayname3 = s; } static void tabsort2_float(t_tabsort2 *x, t_floatarg n) { - t_garray *a; - int n1,n2,n3,i,j,h,sqn; - t_float *vec1,*vec2,*vec3,tmp; + t_garray *a; + int n1,n2,n3,i,j,h,sqn; + t_float *vec1,*vec2,*vec3,tmp; if (!(a = (t_garray *)pd_findbyclass(x->x_arrayname1, garray_class))) { - if (*x->x_arrayname1->s_name) pd_error(x, "tabsort2: %s: no such array", - x->x_arrayname1->s_name); - return; + if (*x->x_arrayname1->s_name) pd_error(x, "tabsort2: %s: no such array", + x->x_arrayname1->s_name); + return; } else if (!garray_getfloatarray(a, &n1, &vec1)) { - error("%s: bad template for tabsort2", x->x_arrayname1->s_name); - return; + error("%s: bad template for tabsort2", x->x_arrayname1->s_name); + return; } if (!(a = (t_garray *)pd_findbyclass(x->x_arrayname2, garray_class))) { - if (*x->x_arrayname2->s_name) pd_error(x, "tabsort2: %s: no such array", - x->x_arrayname2->s_name); - return; + if (*x->x_arrayname2->s_name) pd_error(x, "tabsort2: %s: no such array", + x->x_arrayname2->s_name); + return; } else if (!garray_getfloatarray(a, &n2, &vec2)) { - error("%s: bad template for tabsort2", x->x_arrayname2->s_name); - return; + error("%s: bad template for tabsort2", x->x_arrayname2->s_name); + return; } if (!(a = (t_garray *)pd_findbyclass(x->x_arrayname3, garray_class))) { - if (*x->x_arrayname3->s_name) pd_error(x, "tabsort2: %s: no such array", - x->x_arrayname3->s_name); - return; + if (*x->x_arrayname3->s_name) pd_error(x, "tabsort2: %s: no such array", + x->x_arrayname3->s_name); + return; } else if (!garray_getfloatarray(a, &n3, &vec3)) { - error("%s: bad template for tabsort2", x->x_arrayname3->s_name); - return; + error("%s: bad template for tabsort2", x->x_arrayname3->s_name); + return; } - if(n>n1) n=n1; - if(n>n2) n=n2; - if(n>n3) n=n3; - - for(i=0;ii;j--) - if(vec1[(int)vec3[j-1]]i;j--) - if(vec2[(int)vec3[h*sqn+j-1]]ob_outlet,(t_float)sqn); + if(n>n1) n=n1; + if(n>n2) n=n2; + if(n>n3) n=n3; + + for(i=0; ii; j--) + if(vec1[(int)vec3[j-1]]i; j--) + if(vec2[(int)vec3[h*sqn+j-1]]ob_outlet,(t_float)sqn); } static void tabsort2_tick(t_tabsort2 *x) /* callback function for the env clock */ { - //clock_delay(x->x_clock, 0L); + //clock_delay(x->x_clock, 0L); } static void tabsort2_ff(t_tabsort2 *x) /* cleanup on free */ @@ -153,11 +153,11 @@ static void tabsort2_ff(t_tabsort2 *x) /* cleanup on free */ void tabsort2_setup(void ) { tabsort2_class = class_new(gensym("tabsort2"), (t_newmethod)tabsort2_new, - (t_method)tabsort2_ff, sizeof(t_tabsort2), 0, A_DEFSYM, A_DEFSYM, A_DEFSYM, 0); + (t_method)tabsort2_ff, sizeof(t_tabsort2), 0, A_DEFSYM, A_DEFSYM, A_DEFSYM, 0); class_addmethod(tabsort2_class, (t_method)tabsort2_set1, - gensym("set1"), A_DEFSYM, 0); + gensym("set1"), A_DEFSYM, 0); class_addmethod(tabsort2_class, (t_method)tabsort2_set2, - gensym("set2"), A_DEFSYM, 0); + gensym("set2"), A_DEFSYM, 0); class_addfloat(tabsort2_class, tabsort2_float); } -- cgit v1.2.1