aboutsummaryrefslogtreecommitdiff
path: root/src/msgfile.c
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2009-03-19 15:46:16 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2009-03-19 15:46:16 +0000
commit7a060ad46daa6d37ec5ec37b42cf59a6146c5203 (patch)
tree96a1a1f95d6ebb8d9647a1728738ec9ca9c7f853 /src/msgfile.c
parent33f1507e6b0b3ca700f268fa610ee75e059524aa (diff)
fixed warnings
svn path=/trunk/externals/zexy/; revision=10873
Diffstat (limited to 'src/msgfile.c')
-rw-r--r--src/msgfile.c12
1 files changed, 7 insertions, 5 deletions
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);