From: Bernhard Schommer Date: Thu, 31 Jul 2014 11:05:38 +0000 (+0100) Subject: Compilation fails due to void pointer arithmetic (issue 24). X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=fe09f471efc3988ecffec49ed5acd0bec926f4a3;hp=5997a66d9b078d75f821eedc9ba615c9df321e98;p=ocaml-bitstring.git Compilation fails due to void pointer arithmetic (issue 24). --- diff --git a/bitstring_c.c b/bitstring_c.c index 3ea2547..d376f76 100644 --- a/bitstring_c.c +++ b/bitstring_c.c @@ -75,7 +75,7 @@ ocaml_bitstring_extract_fastpath_int##size##_##endian##_##signed \ (value strv, value offv) \ { \ - type *ptr = (type *) ((void *) String_val (strv) + Int_val (offv)); \ + type *ptr = (type *) ((char *) String_val (strv) + Int_val (offv)); \ type r; \ memcpy(&r, ptr, sizeof(r)); \ swap_##endian(size,r); \ @@ -96,7 +96,7 @@ fastpath1(16,ne,signed,int16_t) { \ CAMLparam2 (strv, offv); \ CAMLlocal1 (rv); \ - type *ptr = (type *) ((void *) String_val (strv) + Int_val (offv)); \ + type *ptr = (type *) ((char *) String_val (strv) + Int_val (offv)); \ type r; \ memcpy(&r, ptr, sizeof(r)); \ swap_##endian(size,r); \