aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2009-04-09 14:14:16 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2009-04-09 14:14:16 +0000
commit0d84ac0971e30a21fcbdb6ff68c18e998f61feef (patch)
treebfe2d19407143980cb61e5f259ee92326051464e /src
parent08156b6ef3700baeb785bc1477b1d152d2ee7f46 (diff)
indentation
svn path=/trunk/externals/zexy/; revision=11001
Diffstat (limited to 'src')
-rw-r--r--src/msgfile.c60
-rw-r--r--src/sort.c22
2 files changed, 41 insertions, 41 deletions
diff --git a/src/msgfile.c b/src/msgfile.c
index 39216ea..71509a0 100644
--- a/src/msgfile.c
+++ b/src/msgfile.c
@@ -36,11 +36,11 @@
#define CSV_MODE 2
/* modi
PD : separate items by ' '; seperate lines by ";\n"
- looks like a PD-file
+ looks like a PD-file
CR : separate items by ' '; seperate lines by " \n"
- how you would expect a file to look like
+ how you would expect a file to look like
CSV: separate items by ','; seperate lines by " \n"
- spreadsheet: each argument gets its own column
+ spreadsheet: each argument gets its own column
*/
@@ -413,7 +413,7 @@ static void msgfile_this(t_msgfile *x)
}
static void msgfile_next(t_msgfile *x)
{
- if ((x->current) && (x->current->next)) {
+ if ((x->current) && (x->current->next)) {
t_msglist *next = x->current->next;
if (next->thislist)
outlet_list(x->x_obj.ob_outlet, gensym("list"), next->n, next->thislist);
@@ -449,8 +449,8 @@ static void msgfile_bang(t_msgfile *x)
}
/*
- msgfile_this(x);
- msgfile_skip(x, 1);
+ msgfile_this(x);
+ msgfile_skip(x, 1);
*/
}
@@ -586,7 +586,7 @@ static void msgfile_read2(t_msgfile *x, t_symbol *filename, t_symbol *format)
#endif
if ((fd = open_via_path(dirname,
- filename->s_name, "", buf, &bufptr, MAXPDSTRING, 0)) < 0) {
+ filename->s_name, "", buf, &bufptr, MAXPDSTRING, 0)) < 0) {
if((fd=open(filename->s_name, rmode)) < 0) {
pd_error(x, "can't open in %s/%s", dirname, filename->s_name);
@@ -719,7 +719,7 @@ static void msgfile_write(t_msgfile *x, t_symbol *filename, t_symbol *format)
}
canvas_makefilename(x->x_canvas, filename->s_name,
- buf, MAXPDSTRING);
+ buf, MAXPDSTRING);
if(format&&gensym("")!=format) {
if(gensym("cr")==format) {
@@ -765,7 +765,7 @@ static void msgfile_write(t_msgfile *x, t_symbol *filename, t_symbol *format)
if (!(f = fopen(filnam, "w"))) {
pd_error(x, "msgfile : failed to open %s", filnam);
} else {
- /* write */
+ /* write */
if (fwrite(mytext, textlen*sizeof(char), 1, f) < 1) {
pd_error(x, "msgfile : failed to write %s", filnam);
}
@@ -815,39 +815,39 @@ static void msgfile_free(t_msgfile *x)
static void *msgfile_new(t_symbol *s, int argc, t_atom *argv)
{
- t_msgfile *x = (t_msgfile *)pd_new(msgfile_class);
+ t_msgfile *x = (t_msgfile *)pd_new(msgfile_class);
- /* an empty node indicates the end of our listbuffer */
- x->current = 0;
- x->start = 0;
- x->previous= 0;
+ /* an empty node indicates the end of our listbuffer */
+ x->current = 0;
+ x->start = 0;
+ x->previous= 0;
- x->mode=PD_MODE; /* that's the default */
+ x->mode=PD_MODE; /* that's the default */
- if ((argc==1) && (argv->a_type == A_SYMBOL)) {
- t_symbol*mode=atom_getsymbol(argv);
- if (gensym("cr") == mode) x->mode = CR_MODE;
- else if (gensym("csv")== mode) x->mode = CSV_MODE;
- else if (gensym("pd") == mode) x->mode = PD_MODE;
- else {
- pd_error(x, "msgfile: unknown argument %s", argv->a_w.w_symbol->s_name);
- }
+ if ((argc==1) && (argv->a_type == A_SYMBOL)) {
+ t_symbol*mode=atom_getsymbol(argv);
+ if (gensym("cr") == mode) x->mode = CR_MODE;
+ else if (gensym("csv")== mode) x->mode = CSV_MODE;
+ else if (gensym("pd") == mode) x->mode = PD_MODE;
+ else {
+ pd_error(x, "msgfile: unknown argument %s", argv->a_w.w_symbol->s_name);
}
+ }
- outlet_new(&x->x_obj, &s_list);
- x->x_secondout = outlet_new(&x->x_obj, &s_float);
- x->x_canvas = canvas_getcurrent();
+ outlet_new(&x->x_obj, &s_list);
+ x->x_secondout = outlet_new(&x->x_obj, &s_float);
+ x->x_canvas = canvas_getcurrent();
- x->eol=' ';
- x->separator=',';
+ x->eol=' ';
+ x->separator=',';
- return (x);
+ return (x);
}
void msgfile_setup(void)
{
msgfile_class = class_new(gensym("msgfile"), (t_newmethod)msgfile_new,
- (t_method)msgfile_free, sizeof(t_msgfile), 0, A_GIMME, 0);
+ (t_method)msgfile_free, sizeof(t_msgfile), 0, A_GIMME, 0);
class_addmethod(msgfile_class, (t_method)msgfile_goto, gensym("goto"), A_DEFFLOAT, 0);
class_addmethod(msgfile_class, (t_method)msgfile_rewind, gensym("rewind"), 0);
class_addmethod(msgfile_class, (t_method)msgfile_rewind, gensym("begin"), 0);
diff --git a/src/sort.c b/src/sort.c
index eff1e36..f86694d 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -25,7 +25,7 @@
/* ------------------------- sort ------------------------------- */
/*
-SHELL SORT: simple and easy
+ SHELL SORT: simple and easy
*/
static t_class *sort_class;
@@ -46,7 +46,7 @@ typedef struct _sort
static void sort_dir(t_sort *x, t_float f)
{
- x->ascending = (f < 0.f)?0:1;
+ x->ascending = (f < 0.f)?0:1;
}
static void sort_buffer(t_sort *x, int argc, t_atom *argv)
@@ -92,14 +92,14 @@ static void sort_list(t_sort *x, t_symbol *s, int argc, t_atom *argv)
while(i--) { /* there might be some optimization in here */
for (n=0; n<(argc-step); n++) {
- if (buf[n] > buf[n+step]) {
- t_int i_tmp = idx[n];
- t_float f_tmp = buf[n];
- buf[n] = buf[n+step];
- buf[n+step] = f_tmp;
- idx[n] = idx[n+step];
- idx[n+step] = i_tmp;
- }
+ if (buf[n] > buf[n+step]) {
+ t_int i_tmp = idx[n];
+ t_float f_tmp = buf[n];
+ buf[n] = buf[n+step];
+ buf[n+step] = f_tmp;
+ idx[n] = idx[n+step];
+ idx[n+step] = i_tmp;
+ }
}
}
}
@@ -144,7 +144,7 @@ static void sort_help(t_sort*x)
void sort_setup(void)
{
sort_class = class_new(gensym("sort"), (t_newmethod)sort_new,
- 0, sizeof(t_sort), 0, A_DEFFLOAT, 0);
+ 0, sizeof(t_sort), 0, A_DEFFLOAT, 0);
class_addlist (sort_class, sort_list);
class_addmethod (sort_class, (t_method)sort_dir, gensym("direction"), A_DEFFLOAT, 0);