aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/blockswap~.c2
-rw-r--r--src/freadln.c1
-rw-r--r--src/fwriteln.c88
-rw-r--r--src/list2lists.c1
-rw-r--r--src/msgfile.c12
-rw-r--r--src/pack~.c4
-rw-r--r--src/regex.c1
-rw-r--r--src/winNT_portio.c2
-rw-r--r--src/zexy.c2
9 files changed, 55 insertions, 58 deletions
diff --git a/src/blockswap~.c b/src/blockswap~.c
index fe19703..23926bc 100644
--- a/src/blockswap~.c
+++ b/src/blockswap~.c
@@ -94,7 +94,7 @@ static void *blockswap_new(void)
void blockswap_tilde_setup(void)
{
- blockswap_class = class_new(gensym("blockswap~"), (t_newmethod)blockswap_new, 0,
+ blockswap_class = class_new(gensym("blockswap~"), (t_newmethod)blockswap_new, (t_method)blockswap_free,
sizeof(t_blockswap), 0, A_NULL);
class_addmethod(blockswap_class, nullfn, gensym("signal"), 0);
class_addmethod(blockswap_class, (t_method)blockswap_dsp, gensym("dsp"), 0);
diff --git a/src/freadln.c b/src/freadln.c
index f2c7cfd..3bbcbb1 100644
--- a/src/freadln.c
+++ b/src/freadln.c
@@ -161,7 +161,6 @@ static void freadln_readline (t_freadln *x)
t_binbuf *bbuf;
t_atom *abuf;
int abuf_length;
- t_symbol *s;
int rewind_after;
if (!x->x_file) {
diff --git a/src/fwriteln.c b/src/fwriteln.c
index a6a9689..669c5ae 100644
--- a/src/fwriteln.c
+++ b/src/fwriteln.c
@@ -63,7 +63,7 @@ static void fwriteln_close (t_fwriteln *x)
static void string_copy(const char* const from, char** to)
{
- if (*to = malloc(strlen(from) + 1)) {
+ if ((*to = malloc(strlen(from) + 1))) {
strcpy(*to, from);
}
}
@@ -118,48 +118,50 @@ static void fwriteln_write (t_fwriteln *x, t_symbol *s, int argc, t_atom *argv)
{
switch (argv->a_type) {
case A_FLOAT:
- snprintf(text,MAXPDSTRING,x->format_string_afloats,
- atom_getfloat(argv));
- text[MAXPDSTRING-1]=0;
- length=strlen(text);
- if (fwrite(text, length*sizeof(char),1,x->x_file) < 1) {
- pd_error(x, "failed to write %128s",x->x_filename);
- freebytes (text, MAXPDSTRING * sizeof(char));
- fwriteln_close(x);
- return;
- }
- break;
- case A_SYMBOL:
- snprintf(text,MAXPDSTRING,"%s ", atom_getsymbol(argv)->s_name);
- text[MAXPDSTRING-1]=0;
- length=strlen(text);
- if (fwrite(text, length*sizeof(char),1,x->x_file) < 1) {
- pd_error(x, "failed to write %128s",x->x_filename);
- freebytes (text, MAXPDSTRING * sizeof(char));
- fwriteln_close(x);
- return;
- }
- break;
- case A_COMMA:
- snprintf(text,MAXPDSTRING,", ");
- length=strlen(text);
- if (fwrite(text, length*sizeof(char),1,x->x_file) < 1) {
- pd_error(x, "failed to write %128s",x->x_filename);
- freebytes (text, MAXPDSTRING * sizeof(char));
- fwriteln_close(x);
- return;
- }
- break;
- case A_SEMI:
- snprintf(text,MAXPDSTRING,"; ");
- length=strlen(text);
- if (fwrite(text, length*sizeof(char),1,x->x_file) < 1) {
- pd_error(x, "failed to write %128s",x->x_filename);
- freebytes (text, MAXPDSTRING * sizeof(char));
- fwriteln_close(x);
- return;
- }
- break;
+ snprintf(text,MAXPDSTRING,x->format_string_afloats,
+ atom_getfloat(argv));
+ text[MAXPDSTRING-1]=0;
+ length=strlen(text);
+ if (fwrite(text, length*sizeof(char),1,x->x_file) < 1) {
+ pd_error(x, "failed to write %128s",x->x_filename);
+ freebytes (text, MAXPDSTRING * sizeof(char));
+ fwriteln_close(x);
+ return;
+ }
+ break;
+ case A_SYMBOL:
+ snprintf(text,MAXPDSTRING,"%s ", atom_getsymbol(argv)->s_name);
+ text[MAXPDSTRING-1]=0;
+ length=strlen(text);
+ if (fwrite(text, length*sizeof(char),1,x->x_file) < 1) {
+ pd_error(x, "failed to write %128s",x->x_filename);
+ freebytes (text, MAXPDSTRING * sizeof(char));
+ fwriteln_close(x);
+ return;
+ }
+ break;
+ case A_COMMA:
+ snprintf(text,MAXPDSTRING,", ");
+ length=strlen(text);
+ if (fwrite(text, length*sizeof(char),1,x->x_file) < 1) {
+ pd_error(x, "failed to write %128s",x->x_filename);
+ freebytes (text, MAXPDSTRING * sizeof(char));
+ fwriteln_close(x);
+ return;
+ }
+ break;
+ case A_SEMI:
+ snprintf(text,MAXPDSTRING,"; ");
+ length=strlen(text);
+ if (fwrite(text, length*sizeof(char),1,x->x_file) < 1) {
+ pd_error(x, "failed to write %128s",x->x_filename);
+ freebytes (text, MAXPDSTRING * sizeof(char));
+ fwriteln_close(x);
+ return;
+ }
+ break;
+ default:
+ break;
}
argv++;
}
diff --git a/src/list2lists.c b/src/list2lists.c
index 9f858d4..1b74f67 100644
--- a/src/list2lists.c
+++ b/src/list2lists.c
@@ -90,7 +90,6 @@ static void list2lists_output(t_list2lists*x, int argc, t_atom*argv)
static void list2lists_list(t_list2lists *x, t_symbol *s, int argc, t_atom *argv)
{
int i;
- int offset=0;
if(x->x_lcount<1) {
outlet_anything(x->x_obj.ob_outlet, s, argc, argv);
diff --git a/src/msgfile.c b/src/msgfile.c
index f92fa3d..39216ea 100644
--- a/src/msgfile.c
+++ b/src/msgfile.c
@@ -26,6 +26,8 @@
#include <fcntl.h>
#include <string.h>
+#include <unistd.h>
+
/* ****************************************************************************** */
/* msgfile : save and load messages... */
@@ -89,13 +91,15 @@ static void write_currentnode(t_msgfile *x, int ac, t_atom *av)
/* append list to the current node list */
t_msglist *cur=x->current;
+ t_atom *ap=NULL;
+ int newsize = 0;
+
if(!cur || (ac && av && A_SYMBOL==av->a_type && gensym("")==atom_getsymbol(av))){
/* ignoring empty symbols! */
return;
}
- t_atom *ap;
- int newsize = cur->n + ac;
+ newsize = cur->n + ac;
ap = (t_atom *)getbytes(newsize * sizeof(t_atom));
memcpy(ap, cur->thislist, cur->n * sizeof(t_atom));
@@ -566,7 +570,7 @@ static void msgfile_read2(t_msgfile *x, t_symbol *filename, t_symbol *format)
int fd=0;
FILE*fil=NULL;
long readlength, length, pos;
- char filnam[MAXPDSTRING], namebuf[MAXPDSTRING];
+ char filnam[MAXPDSTRING];
char buf[MAXPDSTRING], *bufptr, *readbuf;
char *charbinbuf=NULL, *cbb;
int charbinbuflength=0;
@@ -634,7 +638,6 @@ static void msgfile_read2(t_msgfile *x, t_symbol *filename, t_symbol *format)
break;
}
-
/* read */
if ((readlength = fread(readbuf, sizeof(char), length, fil)) < length) {
pd_error(x, "msgfile_read: unable to read %s: %d of %d", filnam, readlength, length);
@@ -709,7 +712,6 @@ static void msgfile_write(t_msgfile *x, t_symbol *filename, t_symbol *format)
FILE *f=0;
-
while(cur) {
binbuf_add(bbuf, cur->n, cur->thislist);
binbuf_addsemi(bbuf);
diff --git a/src/pack~.c b/src/pack~.c
index 8cdd03f..cdb3665 100644
--- a/src/pack~.c
+++ b/src/pack~.c
@@ -32,7 +32,7 @@ typedef struct _sigpack
int x_outputindsp;
} t_sigpack;
-static void *sigpack_tick(t_sigpack*x)
+static void sigpack_tick(t_sigpack*x)
{
outlet_list(x->x_obj.ob_outlet, &s_list, x->vector_length, x->buffer);
}
@@ -68,7 +68,7 @@ static void sigpack_dsp(t_sigpack *x, t_signal **sp)
dsp_add(sigpack_perform, 3, sp[0]->s_vec, x, sp[0]->s_n);
}
-static void *sigpack_free(t_sigpack*x)
+static void sigpack_free(t_sigpack*x)
{
clock_free(x->x_clock);
}
diff --git a/src/regex.c b/src/regex.c
index 264bfeb..8e3e8af 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -195,7 +195,6 @@ static void regex_symbol(t_regex *x, t_symbol *s, int argc, t_atom*argv)
int num_matches=x->x_matchnum;
regmatch_t*match=(regmatch_t*)getbytes(sizeof(regmatch_t)*num_matches);
t_atom*ap=(t_atom*)getbytes(sizeof(t_atom)*(3*num_matches));
- int ap_length=0;
int err=0;
diff --git a/src/winNT_portio.c b/src/winNT_portio.c
index 470df14..1138ca7 100644
--- a/src/winNT_portio.c
+++ b/src/winNT_portio.c
@@ -125,6 +125,4 @@ int open_port(int port)
return(0);
}
}
-#else
-static int i=0;
#endif /* __WIN32__ & Z_WANT_LPT */
diff --git a/src/zexy.c b/src/zexy.c
index c3e95fc..9bff9ce 100644
--- a/src/zexy.c
+++ b/src/zexy.c
@@ -162,8 +162,6 @@ void zexy_setup(void)
void verbose(int level, const char *fmt, ...){
char buf[MAXPDSTRING];
va_list ap;
- t_int arg[8];
- int i;
va_start(ap, fmt);
vsnprintf(buf, MAXPDSTRING-1, fmt, ap);