git.annexia.org
/
ocaml-bitstring.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
5997a66
)
Compilation fails due to void pointer arithmetic (issue 24).
author
Bernhard Schommer
<bernhardschommer@gmail.com>
Thu, 31 Jul 2014 11:05:38 +0000
(12:05 +0100)
committer
Richard W.M. Jones
<rjones@redhat.com>
Thu, 31 Jul 2014 11:06:34 +0000
(12:06 +0100)
bitstring_c.c
patch
|
blob
|
history
diff --git
a/bitstring_c.c
b/bitstring_c.c
index
3ea2547
..
d376f76
100644
(file)
--- a/
bitstring_c.c
+++ b/
bitstring_c.c
@@
-75,7
+75,7
@@
ocaml_bitstring_extract_fastpath_int##size##_##endian##_##signed \
(value strv, value offv) \
{ \
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); \
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); \
{ \
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); \
type r; \
memcpy(&r, ptr, sizeof(r)); \
swap_##endian(size,r); \