summaryrefslogtreecommitdiffstats
path: root/include/all-io.h
diff options
context:
space:
mode:
authorSami Kerola2012-06-10 16:49:51 +0200
committerSami Kerola2012-06-11 19:51:35 +0200
commit667d375ea8de0c47d604fff0a75c2d653a387537 (patch)
tree04ae5a0c733f2e7bdb695cc4de7e865bbcc44d76 /include/all-io.h
parentsysfs: fix printf format warnings (diff)
downloadkernel-qcow2-util-linux-667d375ea8de0c47d604fff0a75c2d653a387537.tar.gz
kernel-qcow2-util-linux-667d375ea8de0c47d604fff0a75c2d653a387537.tar.xz
kernel-qcow2-util-linux-667d375ea8de0c47d604fff0a75c2d653a387537.zip
include: fix void pointer arithmetics warnings
all-io.h:18:9: warning: pointer of type 'void *' used in arithmetic [-pedantic] all-io.h:38:9: warning: pointer of type 'void *' used in arithmetic [-pedantic] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'include/all-io.h')
-rw-r--r--include/all-io.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/all-io.h b/include/all-io.h
index b79d702bd..38a760ff6 100644
--- a/include/all-io.h
+++ b/include/all-io.h
@@ -15,7 +15,7 @@ static inline int write_all(int fd, const void *buf, size_t count)
if (tmp > 0) {
count -= tmp;
if (count)
- buf += tmp;
+ buf = (void *) ((char *) buf + tmp);
} else if (errno != EINTR && errno != EAGAIN)
return -1;
if (errno == EAGAIN) /* Try later, *sigh* */
@@ -35,7 +35,7 @@ static inline int fwrite_all(const void *ptr, size_t size,
if (tmp > 0) {
nmemb -= tmp;
if (nmemb)
- ptr += (tmp * size);
+ ptr = (void *) ((char *) ptr + (tmp * size));
} else if (errno != EINTR && errno != EAGAIN)
return -1;
if (errno == EAGAIN) /* Try later, *sigh* */