[PATCH] resolve-undo.c: silence compiler complaints by casting void * to char *

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Brandon Casey <drafnel@xxxxxxxxx>

Some compilers produce errors when arithmetic is attempted on pointers to
void.  We want computations done on byte addresses, so cast them to char *
to work them around.

Signed-off-by: Brandon Casey <casey@xxxxxxxxxxxxxxx>
---
 resolve-undo.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/resolve-undo.c b/resolve-undo.c
index 37d73cd..c259fe6 100644
--- a/resolve-undo.c
+++ b/resolve-undo.c
@@ -75,7 +75,7 @@ struct string_list *resolve_undo_read(void *data, unsigned long size)
 			lost->util = xcalloc(1, sizeof(*ui));
 		ui = lost->util;
 		size -= len;
-		data += len;
+		data = (char*) data + len;
 
 		for (i = 0; i < 3; i++) {
 			ui->mode[i] = strtoul(data, &endptr, 8);
@@ -85,7 +85,7 @@ struct string_list *resolve_undo_read(void *data, unsigned long size)
 			if (size <= len)
 				goto error;
 			size -= len;
-			data += len;
+			data = (char*) data + len;
 		}
 
 		for (i = 0; i < 3; i++) {
@@ -95,7 +95,7 @@ struct string_list *resolve_undo_read(void *data, unsigned long size)
 				goto error;
 			hashcpy(ui->sha1[i], data);
 			size -= 20;
-			data += 20;
+			data = (char*) data + 20;
 		}
 	}
 	return resolve_undo;
-- 
1.6.6

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]