

When compiling with -pedantic (-ansi was just fine) I found out a couple of
void * arithmetic that could be messy.

This patch fixes it up by using the right pointer type (almost unsigned char *
most of the time, because we address buffers byte by byte) on each case.



---

 cur-root/libjio.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -puN libjio.c~pointer_arithmetic libjio.c
--- cur/libjio.c~pointer_arithmetic	2004-05-04 22:41:46.000000000 -0300
+++ cur-root/libjio.c	2004-05-05 15:05:37.000000000 -0300
@@ -57,7 +57,7 @@ static ssize_t spread(int fd, void *buf,
 	c = 0;
 
 	while (c < count) {
-		rv = pread(fd, buf + c, count - c, offset + c);
+		rv = pread(fd, (char *) buf + c, count - c, offset + c);
 		
 		if (rv == count)
 			/* we're done */
@@ -84,7 +84,7 @@ static ssize_t spwrite(int fd, const voi
 	c = 0;
 
 	while (c < count) {
-		rv = pwrite(fd, buf + c, count - c, offset + c);
+		rv = pwrite(fd, (char *) buf + c, count - c, offset + c);
 		
 		if (rv == count)
 			/* we're done */
@@ -267,7 +267,7 @@ int jtrans_commit(struct jtrans *ts)
 {
 	int id, fd, rv, t;
 	char *name;
-	void *buf_init, *bufp;
+	unsigned char *buf_init, *bufp;
 	
 	name = (char *) malloc(PATH_MAX);
 	if (name == NULL)
@@ -763,7 +763,7 @@ int jfsck(char *name, struct jfsck_resul
 		}
 		
 		/* load from disk, header first */
-		buf = (char *) malloc(J_DISKTFIXSIZE);
+		buf = (unsigned char *) malloc(J_DISKTFIXSIZE);
 		if (buf == NULL) {
 			res->load_error++;
 			goto loop;

_
