From 667d375ea8de0c47d604fff0a75c2d653a387537 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 10 Jun 2012 16:49:51 +0200 Subject: 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 --- include/all-io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/all-io.h') 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* */ -- cgit v1.2.3-55-g7522