bdiff: avoid pointer arithmetic on void*
authorMatt Harbison <matt_harbison@yahoo.com>
Sat, 03 Mar 2018 23:29:40 -0500
changeset 36681 340e4b711df7
parent 36680 66f2e622a2ed
child 36682 68328202f270
bdiff: avoid pointer arithmetic on void* MSVC 2008 complains: mercurial/cext/bdiff.c(106) : error C2036: 'void *' : unknown size mercurial/cext/bdiff.c(107) : error C2036: 'void *' : unknown size Maybe it's a gcc extension? https://stackoverflow.com/questions/37460579/error-c2036-void-unknown-size
mercurial/cext/bdiff.c
--- a/mercurial/cext/bdiff.c	Sat Mar 03 19:26:30 2018 -0500
+++ b/mercurial/cext/bdiff.c	Sat Mar 03 23:29:40 2018 -0500
@@ -103,8 +103,8 @@
 	}
 	/* we can almost add: if (li == lmax) lcommon = li; */
 
-	an = bdiff_splitlines(ba.buf + lcommon, la - lcommon, &al);
-	bn = bdiff_splitlines(bb.buf + lcommon, lb - lcommon, &bl);
+	an = bdiff_splitlines((char *)ba.buf + lcommon, la - lcommon, &al);
+	bn = bdiff_splitlines((char *)bb.buf + lcommon, lb - lcommon, &bl);
 	if (!al || !bl) {
 		PyErr_NoMemory();
 		goto cleanup;