diff options
-rw-r--r-- | apps/plugins/pdbox/PDa/src/g_array.c | 6 | ||||
-rw-r--r-- | apps/plugins/pdbox/PDa/src/m_binbuf.c | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/apps/plugins/pdbox/PDa/src/g_array.c b/apps/plugins/pdbox/PDa/src/g_array.c index eba01a67ee..8b8c6bcd5a 100644 --- a/apps/plugins/pdbox/PDa/src/g_array.c +++ b/apps/plugins/pdbox/PDa/src/g_array.c | |||
@@ -1264,7 +1264,7 @@ static void garray_read16(t_garray *x, t_symbol *filename, | |||
1264 | for (i = 0; i < nelem; i++) | 1264 | for (i = 0; i < nelem; i++) |
1265 | { | 1265 | { |
1266 | #ifdef ROCKBOX | 1266 | #ifdef ROCKBOX |
1267 | if(read(fd, &s, sizeof(s)) < (ssize_t) (1 * sizeof(s))) | 1267 | if(read(fd, &s, sizeof(s)) < (ssize_t) sizeof(s)) |
1268 | #else | 1268 | #else |
1269 | if (fread(&s, sizeof(s), 1, fd) < 1) | 1269 | if (fread(&s, sizeof(s), 1, fd) < 1) |
1270 | #endif | 1270 | #endif |
@@ -1413,7 +1413,7 @@ static void garray_write16(t_garray *x, t_symbol *filename, t_symbol *format) | |||
1413 | } | 1413 | } |
1414 | memcpy((void *)(waveheader + 40), (void *)(&intbuf), 4); | 1414 | memcpy((void *)(waveheader + 40), (void *)(&intbuf), 4); |
1415 | #ifdef ROCKBOX | 1415 | #ifdef ROCKBOX |
1416 | if(write(fd, waveheader, sizeof(waveheader)) < (ssize_t) (1 * sizeof(waveheader))) | 1416 | if(write(fd, waveheader, sizeof(waveheader)) < (ssize_t) sizeof(waveheader)) |
1417 | #else | 1417 | #else |
1418 | if (fwrite(waveheader, sizeof(waveheader), 1, fd) < 1) | 1418 | if (fwrite(waveheader, sizeof(waveheader), 1, fd) < 1) |
1419 | #endif | 1419 | #endif |
@@ -1434,7 +1434,7 @@ static void garray_write16(t_garray *x, t_symbol *filename, t_symbol *format) | |||
1434 | xxx = foo[0]; foo[0] = foo[1]; foo[1] = xxx; | 1434 | xxx = foo[0]; foo[0] = foo[1]; foo[1] = xxx; |
1435 | } | 1435 | } |
1436 | #ifdef ROCKBOX | 1436 | #ifdef ROCKBOX |
1437 | if(write(fd, &sh, sizeof(sh)) < (ssize_t) (1 * sizeof(sh))) | 1437 | if(write(fd, &sh, sizeof(sh)) < (ssize_t) sizeof(sh)) |
1438 | #else | 1438 | #else |
1439 | if (fwrite(&sh, sizeof(sh), 1, fd) < 1) | 1439 | if (fwrite(&sh, sizeof(sh), 1, fd) < 1) |
1440 | #endif | 1440 | #endif |
diff --git a/apps/plugins/pdbox/PDa/src/m_binbuf.c b/apps/plugins/pdbox/PDa/src/m_binbuf.c index 3515714dc9..6c7316aca7 100644 --- a/apps/plugins/pdbox/PDa/src/m_binbuf.c +++ b/apps/plugins/pdbox/PDa/src/m_binbuf.c | |||
@@ -754,6 +754,7 @@ int binbuf_write(t_binbuf *x, char *filename, char *dir, int crflag) | |||
754 | { | 754 | { |
755 | #ifdef ROCKBOX | 755 | #ifdef ROCKBOX |
756 | int f = 0; | 756 | int f = 0; |
757 | ssize_t bp_size; | ||
757 | #else /* ROCKBOX */ | 758 | #else /* ROCKBOX */ |
758 | FILE *f = 0; | 759 | FILE *f = 0; |
759 | #endif /* ROCKBOX */ | 760 | #endif /* ROCKBOX */ |
@@ -799,7 +800,8 @@ int binbuf_write(t_binbuf *x, char *filename, char *dir, int crflag) | |||
799 | if (ep - bp < length) | 800 | if (ep - bp < length) |
800 | { | 801 | { |
801 | #ifdef ROCKBOX | 802 | #ifdef ROCKBOX |
802 | if(write(f, sbuf, bp-sbuf) < 1 * (bp-sbuf)) | 803 | bp_size = bp - sbuf; |
804 | if(write(f, sbuf, bp_size) < bp_size) | ||
803 | #else /* ROCKBOX */ | 805 | #else /* ROCKBOX */ |
804 | if (fwrite(sbuf, bp-sbuf, 1, f) < 1) | 806 | if (fwrite(sbuf, bp-sbuf, 1, f) < 1) |
805 | #endif /* ROCKBOX */ | 807 | #endif /* ROCKBOX */ |
@@ -830,7 +832,8 @@ int binbuf_write(t_binbuf *x, char *filename, char *dir, int crflag) | |||
830 | } | 832 | } |
831 | } | 833 | } |
832 | #ifdef ROCKBOX | 834 | #ifdef ROCKBOX |
833 | if(write(f, sbuf, bp-sbuf) < 1 * (bp-sbuf)) | 835 | bp_size = bp - sbuf; |
836 | if(write(f, sbuf, bp_size) < bp_size) | ||
834 | #else /* ROCKBOX */ | 837 | #else /* ROCKBOX */ |
835 | if (fwrite(sbuf, bp-sbuf, 1, f) < 1) | 838 | if (fwrite(sbuf, bp-sbuf, 1, f) < 1) |
836 | #endif /* ROCKBOX */ | 839 | #endif /* ROCKBOX */ |