From: Sami Kerola Date: Sun, 10 Jun 2012 14:49:51 +0000 (+0200) Subject: include: fix void pointer arithmetics warnings X-Git-Tag: v2.22-rc1~277^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=667d375ea8de0c47d604fff0a75c2d653a387537;p=thirdparty%2Futil-linux.git 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 --- diff --git a/include/all-io.h b/include/all-io.h index b79d702bd5..38a760ff6b 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* */