From fe09f471efc3988ecffec49ed5acd0bec926f4a3 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Thu, 31 Jul 2014 12:05:38 +0100 Subject: [PATCH 1/1] Compilation fails due to void pointer arithmetic (issue 24). --- bitstring_c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); \ -- 1.8.3.1