summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWincent Balin <wincent@rockbox.org>2010-05-20 04:23:40 +0000
committerWincent Balin <wincent@rockbox.org>2010-05-20 04:23:40 +0000
commitc208486fccbc2f4d91d732da67b4cabc3b33d6ca (patch)
treec377bdec65f0fb22415e7c50ae39f9c67ff6ddf1
parentae2659e6339fd4c6318a77f8533b47a0d903de1f (diff)
pdbox: Rewrote recently added bugfixes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26184 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/pdbox/PDa/src/g_array.c6
-rw-r--r--apps/plugins/pdbox/PDa/src/m_binbuf.c7
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,
for (i = 0; i < nelem; i++)
{
#ifdef ROCKBOX
- if(read(fd, &s, sizeof(s)) < (ssize_t) (1 * sizeof(s)))
+ if(read(fd, &s, sizeof(s)) < (ssize_t) sizeof(s))
#else
if (fread(&s, sizeof(s), 1, fd) < 1)
#endif
@@ -1413,7 +1413,7 @@ static void garray_write16(t_garray *x, t_symbol *filename, t_symbol *format)
}
memcpy((void *)(waveheader + 40), (void *)(&intbuf), 4);
#ifdef ROCKBOX
- if(write(fd, waveheader, sizeof(waveheader)) < (ssize_t) (1 * sizeof(waveheader)))
+ if(write(fd, waveheader, sizeof(waveheader)) < (ssize_t) sizeof(waveheader))
#else
if (fwrite(waveheader, sizeof(waveheader), 1, fd) < 1)
#endif
@@ -1434,7 +1434,7 @@ static void garray_write16(t_garray *x, t_symbol *filename, t_symbol *format)
xxx = foo[0]; foo[0] = foo[1]; foo[1] = xxx;
}
#ifdef ROCKBOX
- if(write(fd, &sh, sizeof(sh)) < (ssize_t) (1 * sizeof(sh)))
+ if(write(fd, &sh, sizeof(sh)) < (ssize_t) sizeof(sh))
#else
if (fwrite(&sh, sizeof(sh), 1, fd) < 1)
#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)
{
#ifdef ROCKBOX
int f = 0;
+ ssize_t bp_size;
#else /* ROCKBOX */
FILE *f = 0;
#endif /* ROCKBOX */
@@ -799,7 +800,8 @@ int binbuf_write(t_binbuf *x, char *filename, char *dir, int crflag)
if (ep - bp < length)
{
#ifdef ROCKBOX
- if(write(f, sbuf, bp-sbuf) < 1 * (bp-sbuf))
+ bp_size = bp - sbuf;
+ if(write(f, sbuf, bp_size) < bp_size)
#else /* ROCKBOX */
if (fwrite(sbuf, bp-sbuf, 1, f) < 1)
#endif /* ROCKBOX */
@@ -830,7 +832,8 @@ int binbuf_write(t_binbuf *x, char *filename, char *dir, int crflag)
}
}
#ifdef ROCKBOX
- if(write(f, sbuf, bp-sbuf) < 1 * (bp-sbuf))
+ bp_size = bp - sbuf;
+ if(write(f, sbuf, bp_size) < bp_size)
#else /* ROCKBOX */
if (fwrite(sbuf, bp-sbuf, 1, f) < 1)
#endif /* ROCKBOX */