The following commit has been merged in the master branch:
commit 172aa08cb103c79f11fdb640a8eb9855b98aa004
Author: Stephane Glondu <st...@glondu.net>
Date:   Thu Aug 4 10:22:05 2011 +0200

    New upstream release

diff --git a/debian/changelog b/debian/changelog
index 03c23b6..07c89da 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+bin-prot (2.0.1-1) UNRELEASED; urgency=low
+
+  * New upstream release
+    - drop all patches
+
+ -- St├ęphane Glondu <glo...@debian.org>  Thu, 04 Aug 2011 10:23:44 +0200
+
 bin-prot (1.3.1-3) unstable; urgency=low
 
   * Fix FTBFS on armel:
diff --git a/debian/patches/0001-Fix-bigstring-layout-bug.patch 
b/debian/patches/0001-Fix-bigstring-layout-bug.patch
deleted file mode 100644
index cd327d5..0000000
--- a/debian/patches/0001-Fix-bigstring-layout-bug.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From: Markus Mottl <markus.mo...@gmail.com>
-Date: Wed, 13 Jul 2011 09:16:25 +0200
-Subject: Fix bigstring layout bug
-
-This should only affect value comparisons with OCaml 3.12.1 or later
-(and fixes FTBFS). Extracted from Markus Mottl's repository.
-
-Origin: http://hg.ocaml.info/release/bin-prot/raw-rev/bf832c1bc4af
----
- lib/read_ml.ml       |    2 +-
- lib/read_stubs.c     |    8 ++++----
- lib/unsafe_read_c.ml |    2 +-
- 3 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/lib/read_ml.ml b/lib/read_ml.ml
-index dacb49e..6f054fc 100644
---- a/lib/read_ml.ml
-+++ b/lib/read_ml.ml
-@@ -398,7 +398,7 @@ let bin_read_list bin_read_el buf ~pos_ref =
-   List.rev rev_lst
- 
- #ifndef ARCH_SIXTYFOUR
--let dummy_float_buf = Array1.create char c_layout 8
-+let dummy_float_buf = create_buf 8
- let () = ignore (Write_ml.bin_write_float dummy_float_buf ~pos:0 3.1)
- let max_array_length_2 = Sys.max_array_length / 2
- #endif
-diff --git a/lib/read_stubs.c b/lib/read_stubs.c
-index 396c345..dfdef9e 100644
---- a/lib/read_stubs.c
-+++ b/lib/read_stubs.c
-@@ -517,7 +517,7 @@ CAMLprim inline value read_raw_string_stub(
- 
- /* Reading bigarrays */
- 
--#define MK_BA1_READER(NAME, TYPE, TFLAG) \
-+#define MK_BA1_READER(NAME, TYPE, TFLAG, TLAYOUT) \
-   CAMLprim inline value read_##NAME##_stub(char **sptr_ptr, char *eptr) \
-   { \
-     unsigned long len = read_nat0(sptr_ptr, eptr); \
-@@ -531,7 +531,7 @@ CAMLprim inline value read_raw_string_stub(
-     dim = len; \
-     v_res = \
-       caml_ba_alloc( \
--        CAML_BA_##TFLAG | CAML_BA_FORTRAN_LAYOUT, 1, NULL, &dim); \
-+        CAML_BA_##TFLAG | CAML_BA_##TLAYOUT##_LAYOUT, 1, NULL, &dim); \
-     *sptr_ptr = next; \
-     if (unlikely(tot_size > 65536)) { \
-       Begin_roots1(v_res); \
-@@ -545,10 +545,10 @@ CAMLprim inline value read_raw_string_stub(
-   \
-   MK_ML_READER(NAME)
- 
--MK_BA1_READER(bigstring, char, UINT8)
-+MK_BA1_READER(bigstring, char, UINT8, C)
- 
- #define MK_VEC_MAT_READERS(NAME, TYPE, TFLAG) \
--  MK_BA1_READER(NAME##_vec, TYPE, TFLAG) \
-+  MK_BA1_READER(NAME##_vec, TYPE, TFLAG, FORTRAN) \
-   \
-   CAMLprim inline value read_##NAME##_mat_stub(char **sptr_ptr, char *eptr) \
-   { \
-diff --git a/lib/unsafe_read_c.ml b/lib/unsafe_read_c.ml
-index 731a366..10f5d2c 100644
---- a/lib/unsafe_read_c.ml
-+++ b/lib/unsafe_read_c.ml
-@@ -98,7 +98,7 @@ let bin_read_list bin_read_el sptr_ptr eptr =
-   List.rev rev_lst
- 
- #ifndef ARCH_SIXTYFOUR
--let dummy_float_buf = Array1.create char c_layout 8
-+let dummy_float_buf = create_buf 8
- let () = ignore (Write_ml.bin_write_float dummy_float_buf ~pos:0 3.1)
- let dummy_float_buf_eptr = get_eptr dummy_float_buf ~pos:0
- let max_array_length_2 = Sys.max_array_length / 2
--- 
diff --git 
a/debian/patches/0002-Use-cpp-as-default-preprocessor-on-unknown-OS.patch 
b/debian/patches/0002-Use-cpp-as-default-preprocessor-on-unknown-OS.patch
deleted file mode 100644
index 0e66cf0..0000000
--- a/debian/patches/0002-Use-cpp-as-default-preprocessor-on-unknown-OS.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From: Stephane Glondu <st...@glondu.net>
-Date: Wed, 13 Jul 2011 09:22:50 +0200
-Subject: Use cpp as default preprocessor on unknown OS
-
-One could also add "GNU" (Hurd) and "GNU/kFreeBSD" as cases handled
-the same way as Linux (but they are probably not the only ones). This
-should be fix FTBFS on Debian's hurd-any and kfreebsd-any.
-
-Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=631829
----
- myocamlbuild.ml |    3 +--
- 1 files changed, 1 insertions(+), 2 deletions(-)
-
-diff --git a/myocamlbuild.ml b/myocamlbuild.ml
-index 7f9d7ea..0f1653d 100644
---- a/myocamlbuild.ml
-+++ b/myocamlbuild.ml
-@@ -469,9 +469,8 @@ let dispatch_default = MyOCamlbuildBase.dispatch_default 
package_default;;
- let cpp =
-   let base_cpp =
-     match Ocamlbuild_pack.My_unix.run_and_open "uname -s" input_line with
--    | "Linux" -> "cpp"
-     | "Darwin" -> "cc -E -x c -w"
--    | s -> failwith ("unknow os: " ^ s)
-+    | _ -> "cpp"
-   in
-   match Sys.word_size with
-   | 64 -> S [A"-pp"; P(base_cpp ^" -DARCH_SIXTYFOUR")]
--- 
diff --git a/debian/patches/0003-Fix-alignment.patch 
b/debian/patches/0003-Fix-alignment.patch
deleted file mode 100644
index 9b0cdaf..0000000
--- a/debian/patches/0003-Fix-alignment.patch
+++ /dev/null
@@ -1,375 +0,0 @@
-From: Stephane Glondu <st...@glondu.net>
-Date: Wed, 13 Jul 2011 21:02:17 +0200
-Subject: Fix alignment
-
-This patch fixes various aligment issues. Fixes FTBFS on e.g. armel
-and mipsel.
-
-Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=631829
----
- lib/read_stubs.c  |   56 +++++++++++++++++++++++---------------
- lib/write_stubs.c |   76 ++++++++++++++++++++++++++++++++---------------------
- 2 files changed, 80 insertions(+), 52 deletions(-)
-
-diff --git a/lib/read_stubs.c b/lib/read_stubs.c
-index dfdef9e..c6b6fee 100644
---- a/lib/read_stubs.c
-+++ b/lib/read_stubs.c
-@@ -90,7 +90,7 @@ static inline void raise_Read_error(int loc, unsigned long 
pos)
-     TYPE n; \
-     if (unlikely(next > eptr)) \
-       caml_raise_constant(*v_bin_prot_exc_Buffer_short); \
--    n = *(TYPE *) *sptr_ptr; \
-+    memcpy(&n, sptr, LEN); \
-     CHECK \
-     *sptr_ptr = next; \
-     return n; \
-@@ -399,9 +399,11 @@ CAMLprim inline value read_float_stub(char **sptr_ptr, 
char *eptr)
- {
-   char *sptr = *sptr_ptr;
-   char *next = sptr + sizeof(double);
-+  double tmp;
-   if (unlikely(next > eptr)) 
caml_raise_constant(*v_bin_prot_exc_Buffer_short);
-   *sptr_ptr = next;
--  return caml_copy_double(*(double *) sptr);
-+  memcpy(&tmp, sptr, sizeof(double));
-+  return caml_copy_double(tmp);
- }
- 
- MK_ML_READER(float)
-@@ -472,7 +474,7 @@ CAMLprim value read_variant_tag_stub(char **sptr_ptr, char 
*eptr)
-   char *next = sptr + 4;
-   int n;
-   if (unlikely(next > eptr)) 
caml_raise_constant(*v_bin_prot_exc_Buffer_short);
--  n = *(int *) sptr;
-+  memcpy(&n, sptr, 4);
-   if (likely(Is_long(n))) {
-     *sptr_ptr = next;
-     return (value) n;
-@@ -491,7 +493,7 @@ CAMLprim value ml_read_variant_tag_stub(value v_buf, value 
v_pos_ref)
-   if (unlikely(pos < 0)) caml_array_bound_error();
-   if (unlikely(next_pos > (unsigned long) *buf->dim))
-     caml_raise_constant(*v_bin_prot_exc_Buffer_short);
--  n = *(int *) sptr;
-+  memcpy(&n, sptr, 4);
-   if (likely(Is_long(n))) {
-     Field(v_pos_ref, 0) = Val_long(next_pos);
-     return (value) n;
-@@ -607,16 +609,15 @@ CAMLprim inline value read_int_64bit_stub(char 
**sptr_ptr, char *eptr)
-   long upper;
- #endif
-   char *sptr = *sptr_ptr;
--  long *lsptr = (long *) sptr;
-   char *next = sptr + 8;
-   if (unlikely(next > eptr)) 
caml_raise_constant(*v_bin_prot_exc_Buffer_short);
- #ifdef ARCH_SIXTYFOUR
--  n = *lsptr;
-+  memcpy(&n, sptr, 8);
-   if (unlikely(n < -0x4000000000000000L || n > 0x3FFFFFFFFFFFFFFFL))
-     raise_Error(READ_ERROR_INT_OVERFLOW);
- #else
--  n = *lsptr;
--  upper = *++lsptr;
-+  memcpy(&n, sptr, 4);
-+  memcpy(&upper, sptr + 4, 4);
-   if (upper == 0l) {
-     if ((unsigned long) n > 0x3FFFFFFFl) raise_Error(READ_ERROR_INT_OVERFLOW);
-   } else if (upper == -1) {
-@@ -640,9 +641,10 @@ CAMLprim inline value read_int64_bits_stub(char 
**sptr_ptr, char *eptr)
-   n = (*(long *) sptr);
- #else
-   {
--    unsigned int *uisptr = (unsigned int *) sptr;
--    unsigned int lower = *uisptr++;
--    unsigned int upper = *uisptr;
-+    unsigned int lower;
-+    unsigned int upper;
-+    memcpy(&lower, sptr, 4);
-+    memcpy(&upper, sptr + 4, 4);
-     n = I64_or(I64_lsl(I64_of_int32(upper), 32), I64_of_int32(lower));
-   }
- #endif
-@@ -656,9 +658,11 @@ CAMLprim inline value read_network16_int_stub(char 
**sptr_ptr, char *eptr)
- {
-   char *sptr = *sptr_ptr;
-   char *next = sptr + 2;
-+  uint16_t tmp;
-   if (unlikely(next > eptr)) 
caml_raise_constant(*v_bin_prot_exc_Buffer_short);
-   *sptr_ptr = next;
--  return (value) Val_int((uint16_t) ntohs(*((uint16_t *) sptr)));
-+  memcpy(&tmp, sptr, 2);
-+  return (value) Val_int(ntohs(tmp));
- }
- MK_ML_READER(network16_int)
- 
-@@ -667,16 +671,18 @@ CAMLprim inline value read_network32_int_stub(char 
**sptr_ptr, char *eptr)
-   char *sptr = *sptr_ptr;
-   char *next = sptr + 4;
-   int n;
-+  uint32_t tmp;
-   if (unlikely(next > eptr)) 
caml_raise_constant(*v_bin_prot_exc_Buffer_short);
--  n = (int) ntohl(*(uint32_t *) sptr);
-+  memcpy(&tmp, sptr, 4);
-+  n = (int) ntohl(tmp);
- #ifndef ARCH_SIXTYFOUR
-   if (unlikely(n < -0x40000000l || n > 0x3FFFFFFFl))
-     raise_Error(READ_ERROR_INT_OVERFLOW);
-   *sptr_ptr = next;
--  return (value) Val_int((int) ntohl(*((uint32_t *) sptr)));
-+  return (value) Val_int((int) ntohl(tmp));
- #else
-   *sptr_ptr = next;
--  return (value) Val_int((uint32_t) ntohl(*((uint32_t *) sptr)));
-+  return (value) Val_int((uint32_t) ntohl(tmp));
- #endif
- }
- MK_ML_READER(network32_int)
-@@ -685,9 +691,11 @@ CAMLprim inline value read_network32_int32_stub(char 
**sptr_ptr, char *eptr)
- {
-   char *sptr = *sptr_ptr;
-   char *next = sptr + 4;
-+  uint32_t tmp;
-   if (unlikely(next > eptr)) 
caml_raise_constant(*v_bin_prot_exc_Buffer_short);
-   *sptr_ptr = next;
--  return (value) caml_copy_int32((int) ntohl(*((uint32_t *) sptr)));
-+  memcpy(&tmp, sptr, 4);
-+  return (value) caml_copy_int32((int) ntohl(tmp));
- }
- MK_ML_READER(network32_int32)
- 
-@@ -696,6 +704,7 @@ CAMLprim inline value read_network64_int_stub(char 
**sptr_ptr, char *eptr)
-   char *sptr = *sptr_ptr;
-   char *next = sptr + 8;
-   long n;
-+  uint32_t tmp;
-   if (unlikely(next > eptr)) 
caml_raise_constant(*v_bin_prot_exc_Buffer_short);
- #ifdef ARCH_SIXTYFOUR
- #if __BYTE_ORDER == __LITTLE_ENDIAN
-@@ -711,12 +720,14 @@ CAMLprim inline value read_network64_int_stub(char 
**sptr_ptr, char *eptr)
-   /* Read the upper 32 bits first.  They must all be zero, otherwise we
-      consider this an overflow.  On 32bit platforms the integer must
-      fit completely into one word. */
--  n = *((long *) sptr);
-+  memcpy(&tmp, sptr, 4);
-+  n = (long) tmp;
-   if (n != 0) raise_Error(READ_ERROR_INT_OVERFLOW);
-+  memcpy(&tmp, sptr + 4, 4);
- #if __BYTE_ORDER == __LITTLE_ENDIAN
--  n = (long) bswap_32(*(((uint32_t *) sptr) + 1));
-+  n = (long) bswap_32(tmp);
- #elif __BYTE_ORDER == __BIG_ENDIAN
--  n = *(((long *) sptr) + 1);
-+  n = (long) tmp;
- #else
- #error "unsupported endianness"
- #endif
-@@ -746,9 +757,10 @@ CAMLprim inline value read_network64_int64_stub(char 
**sptr_ptr, char *eptr)
-   return (value) caml_copy_int64(n);
- #else /* 32bit */
-   {
--    uint32_t *uisptr = (uint32_t *) sptr;
--    uint32_t upper = *uisptr++;
--    uint32_t lower = *uisptr;
-+    uint32_t upper;
-+    uint32_t lower;
-+    memcpy(&upper, sptr, 4);
-+    memcpy(&lower, sptr + 4, 4);
- #if __BYTE_ORDER == __LITTLE_ENDIAN
-     n =
-       I64_or(
-diff --git a/lib/write_stubs.c b/lib/write_stubs.c
-index 68970ec..283dae1 100644
---- a/lib/write_stubs.c
-+++ b/lib/write_stubs.c
-@@ -73,7 +73,7 @@ static inline value write_neg_int8(char *sptr, char *eptr, 
char n)
- static inline void do_write_int16(char *sptr, short n)
- {
-   *sptr++ = CODE_INT16;
--  *(short *) sptr = n;
-+  memcpy(sptr, &n, 2);
- }
- 
- static inline value write_int16(char *sptr, char *eptr, short n)
-@@ -87,7 +87,7 @@ static inline value write_int16(char *sptr, char *eptr, 
short n)
- static inline void do_write_int32(char *sptr, int n)
- {
-   *sptr++ = CODE_INT32;
--  *(int *) sptr = n;
-+  memcpy(sptr, &n, 4);
- }
- 
- static inline value write_int32(char *sptr, char *eptr, int n)
-@@ -102,7 +102,7 @@ static inline value write_int32(char *sptr, char *eptr, 
int n)
- static inline void do_write_int64(char *sptr, long n)
- {
-   *sptr++ = CODE_INT64;
--  *(long *) sptr = n;
-+  memcpy(sptr, &n, 8);
- }
- 
- static inline value write_int64(char *sptr, char *eptr, long n)
-@@ -186,12 +186,13 @@ CAMLprim value write_int32_stub(char *sptr, char *eptr, 
value v_n)
- static inline value write_int64_type(char *sptr, char *eptr, int64 n)
- {
-   char *next = sptr + 9;
--  int *isptr;
-+  int32 tmp;
-   if (unlikely(next > eptr)) 
caml_raise_constant(*v_bin_prot_exc_Buffer_short);
-   *sptr++ = CODE_INT64;
--  isptr = (int *) sptr;
--  *isptr++ = I64_to_int32(n);
--  *isptr = I64_to_int32(I64_lsr(n, 32));
-+  tmp = I64_to_int32(n);
-+  memcpy(sptr, &tmp, 4);
-+  tmp = I64_to_int32(I64_lsr(n, 32));
-+  memcpy(sptr + 4, &tmp, 4);
-   return (value) next;
- }
- 
-@@ -311,8 +312,9 @@ CAMLprim value write_string_stub(char *sptr, char *eptr, 
value v_str)
- CAMLprim inline value write_float_stub(char *sptr, char *eptr, value v_n)
- {
-   char *next = sptr + sizeof(double);
-+  double tmp = Double_val(v_n);
-   if (unlikely(next > eptr)) 
caml_raise_constant(*v_bin_prot_exc_Buffer_short);
--  *(double *) sptr = Double_val(v_n);
-+  memcpy(sptr, &tmp, sizeof(double));
-   return (value) next;
- }
- 
-@@ -373,8 +375,10 @@ MK_ML_WRITER(float_array)
- CAMLprim inline value write_variant_tag_stub(char *sptr, char *eptr, value v)
- {
-   char *next = sptr + 4;
-+  int tmp;
-   if (unlikely(next > eptr)) 
caml_raise_constant(*v_bin_prot_exc_Buffer_short);
--  *(int *) sptr = (int) (Is_block(v) ? Field(v, 0) : v);
-+  tmp = (int) (Is_block(v) ? Field(v, 0) : v);
-+  memcpy(sptr, &tmp, 4);
-   return (value) next;
- }
- 
-@@ -518,11 +522,11 @@ CAMLprim value write_int_64bit_stub(char *sptr, char 
*eptr, value v_n)
- {
-   long n = Long_val(v_n);
-   char *next = sptr + 8;
--  long *lsptr = (long *) sptr;
-   if (unlikely(next > eptr)) 
caml_raise_constant(*v_bin_prot_exc_Buffer_short);
--  *lsptr = n;
-+  memcpy(sptr, &n, sizeof(long));
- #ifndef ARCH_SIXTYFOUR
--  *++lsptr = (n < 0) ? 0xFFFFFFFFl : 0l;
-+  n = (n < 0) ? 0xFFFFFFFFl : 0l;
-+  memcpy(sptr + 4, &n, sizeof(long));
- #endif
-   return (value) next;
- }
-@@ -537,10 +541,11 @@ CAMLprim inline value write_int64_bits_stub(char *sptr, 
char *eptr, value v_n)
- #else
-   {
-     int64 n = Int64_val(v_n);
--    unsigned int *uisptr = (unsigned int *) sptr;
--    *uisptr = I64_to_int32(n);
--    uisptr++;
--    *uisptr = I64_to_int32(I64_lsr(n, 32));
-+    unsigned int tmp;
-+    tmp = I64_to_int32(n);
-+    memcpy(sptr, &tmp, 4);
-+    tmp = I64_to_int32(I64_lsr(n, 32));
-+    memcpy(sptr + 4, &tmp, 4);
-   }
- #endif
-   return (value) next;
-@@ -551,8 +556,10 @@ CAMLprim inline value write_network16_int_stub(
-   char *sptr, char *eptr, value v_n)
- {
-   char *next = sptr + 2;
-+  uint16_t tmp;
-   if (unlikely(next > eptr)) 
caml_raise_constant(*v_bin_prot_exc_Buffer_short);
--  *((uint16_t *) sptr) = (uint16_t) htons(Int_val(v_n));
-+  tmp = (uint16_t) htons(Int_val(v_n));
-+  memcpy(sptr, &tmp, 2);
-   return (value) next;
- }
- MK_ML_WRITER(network16_int)
-@@ -561,8 +568,10 @@ CAMLprim inline value write_network32_int_stub(
-   char *sptr, char *eptr, value v_n)
- {
-   char *next = sptr + 4;
-+  uint32_t tmp;
-   if (unlikely(next > eptr)) 
caml_raise_constant(*v_bin_prot_exc_Buffer_short);
--  *((uint32_t *) sptr) = (uint32_t) htonl(Int_val(v_n));
-+  tmp = (uint32_t) htonl(Int_val(v_n));
-+  memcpy(sptr, &tmp, 4);
-   return (value) next;
- }
- MK_ML_WRITER(network32_int)
-@@ -571,8 +580,10 @@ CAMLprim inline value write_network32_int32_stub(
-   char *sptr, char *eptr, value v_n)
- {
-   char *next = sptr + 4;
-+  uint32_t tmp;
-   if (unlikely(next > eptr)) 
caml_raise_constant(*v_bin_prot_exc_Buffer_short);
--  *((uint32_t *) sptr) = htonl(Int32_val(v_n));
-+  tmp = htonl(Int32_val(v_n));
-+  memcpy(sptr, &tmp, 4);
-   return (value) next;
- }
- MK_ML_WRITER(network32_int32)
-@@ -582,6 +593,7 @@ CAMLprim inline value write_network64_int_stub(
- {
-   char *next = sptr + 8;
-   long n = Long_val(v_n);
-+  unsigned int tmp;
-   if (unlikely(next > eptr)) 
caml_raise_constant(*v_bin_prot_exc_Buffer_short);
- #ifdef ARCH_SIXTYFOUR
- #if __BYTE_ORDER == __LITTLE_ENDIAN
-@@ -592,13 +604,15 @@ CAMLprim inline value write_network64_int_stub(
- #error "unsupported endianness"
- #endif
- #else /* 32bit */
--  *((unsigned int *) sptr) = 0;
-+  tmp = 0;
-+  memcpy(sptr, &tmp, 4);
-   sptr += 4;
- #if __BYTE_ORDER == __LITTLE_ENDIAN
--  *((unsigned int *) sptr) = bswap_32((unsigned int) n);
-+  tmp = bswap_32((unsigned int) n);
- #else
--  *((unsigned int *) sptr) = (unsigned int) n;
-+  tmp = (unsigned int) n;
- #endif
-+  memcpy(sptr, &tmp, 4);
- #endif
-   return (value) next;
- }
-@@ -621,18 +635,20 @@ CAMLprim inline value write_network64_int64_stub(
- #if __BYTE_ORDER == __LITTLE_ENDIAN
-   {
-     int64 n = Int64_val(v_n);
--    uint32_t *uisptr = (uint32_t *) sptr;
--    *uisptr = bswap_32(I64_to_int32(I64_lsr(n, 32)));
--    uisptr++;
--    *uisptr = bswap_32(I64_to_int32(n));
-+    uint32_t tmp;
-+    tmp = bswap_32(I64_to_int32(I64_lsr(n, 32)));
-+    memcpy(sptr, &tmp, 4);
-+    tmp = bswap_32(I64_to_int32(n));
-+    memcpy(sptr + 4, &tmp, 4);
-   }
- #elif __BYTE_ORDER == __BIG_ENDIAN
-   {
-     int64 n = Int64_val(v_n);
--    uint32_t *uisptr = (uint32_t *) sptr;
--    *uisptr = I64_to_int32(I64_lsr(n, 32));
--    uisptr++;
--    *uisptr = I64_to_int32(n);
-+    uint32_t tmp;
-+    tmp = I64_to_int32(I64_lsr(n, 32));
-+    memcpy(sptr, &tmp, 4);
-+    tmp = I64_to_int32(n);
-+    memcpy(sptr + 4, &tmp, 4);
-   }
- #else
- #error "unsupported endianness"
--- 
diff --git a/debian/patches/0004-Fix-endianness.patch 
b/debian/patches/0004-Fix-endianness.patch
deleted file mode 100644
index 4e5078b..0000000
--- a/debian/patches/0004-Fix-endianness.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From: Stephane Glondu <st...@glondu.net>
-Date: Wed, 13 Jul 2011 22:58:36 +0200
-Subject: Fix endianness
-
-Use functions from <endian.h> to cope with big-endiannes. Fixes FTBFS
-on e.g. mips.
-
-Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=631829
----
- lib/read_stubs.c  |    6 ++++++
- lib/write_stubs.c |   10 ++++++++--
- 2 files changed, 14 insertions(+), 2 deletions(-)
-
-diff --git a/lib/read_stubs.c b/lib/read_stubs.c
-index c6b6fee..3e9dc6e 100644
---- a/lib/read_stubs.c
-+++ b/lib/read_stubs.c
-@@ -22,6 +22,11 @@
-  *                                                                            
*
-  
******************************************************************************/
- 
-+#define _BSD_SOURCE
-+#include <endian.h>
-+
-+#define le8toh(x) (x)
-+
- /* Stubs for reading basic values in the binary protocol */
- 
- #include "common_stubs.h"
-@@ -91,6 +96,7 @@ static inline void raise_Read_error(int loc, unsigned long 
pos)
-     if (unlikely(next > eptr)) \
-       caml_raise_constant(*v_bin_prot_exc_Buffer_short); \
-     memcpy(&n, sptr, LEN); \
-+    n = le##SIZE##toh(n); \
-     CHECK \
-     *sptr_ptr = next; \
-     return n; \
-diff --git a/lib/write_stubs.c b/lib/write_stubs.c
-index 283dae1..bf7df10 100644
---- a/lib/write_stubs.c
-+++ b/lib/write_stubs.c
-@@ -22,6 +22,9 @@
-  *                                                                            
*
-  
******************************************************************************/
- 
-+#define _BSD_SOURCE
-+#include <endian.h>
-+
- /* Stubs for writing basic values in the binary protocol */
- 
- #include "common_stubs.h"
-@@ -73,6 +76,7 @@ static inline value write_neg_int8(char *sptr, char *eptr, 
char n)
- static inline void do_write_int16(char *sptr, short n)
- {
-   *sptr++ = CODE_INT16;
-+  n = htole16(n);
-   memcpy(sptr, &n, 2);
- }
- 
-@@ -87,6 +91,7 @@ static inline value write_int16(char *sptr, char *eptr, 
short n)
- static inline void do_write_int32(char *sptr, int n)
- {
-   *sptr++ = CODE_INT32;
-+  n = htole32(n);
-   memcpy(sptr, &n, 4);
- }
- 
-@@ -102,6 +107,7 @@ static inline value write_int32(char *sptr, char *eptr, 
int n)
- static inline void do_write_int64(char *sptr, long n)
- {
-   *sptr++ = CODE_INT64;
-+  n = htole64(n);
-   memcpy(sptr, &n, 8);
- }
- 
-@@ -189,9 +195,9 @@ static inline value write_int64_type(char *sptr, char 
*eptr, int64 n)
-   int32 tmp;
-   if (unlikely(next > eptr)) 
caml_raise_constant(*v_bin_prot_exc_Buffer_short);
-   *sptr++ = CODE_INT64;
--  tmp = I64_to_int32(n);
-+  tmp = htole32(I64_to_int32(n));
-   memcpy(sptr, &tmp, 4);
--  tmp = I64_to_int32(I64_lsr(n, 32));
-+  tmp = htole32(I64_to_int32(I64_lsr(n, 32)));
-   memcpy(sptr + 4, &tmp, 4);
-   return (value) next;
- }
--- 
diff --git a/debian/patches/0005-Compile-C-stubs-with-fsigned-char.patch 
b/debian/patches/0005-Compile-C-stubs-with-fsigned-char.patch
deleted file mode 100644
index 4f38dd5..0000000
--- a/debian/patches/0005-Compile-C-stubs-with-fsigned-char.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From: Stephane Glondu <st...@glondu.net>
-Date: Fri, 15 Jul 2011 18:45:54 +0200
-Subject: Compile C stubs with -fsigned-char
-
-They rely on char being signed by default. They probably should be
-fixed instead...
----
- myocamlbuild.ml |    2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
-
-diff --git a/myocamlbuild.ml b/myocamlbuild.ml
-index 0f1653d..51d157d 100644
---- a/myocamlbuild.ml
-+++ b/myocamlbuild.ml
-@@ -494,6 +494,8 @@ Ocamlbuild_plugin.dispatch
- 
-           flag ["compile";"ocaml"; "cpp"] cpp;
- 
-+          flag ["compile"; "c"] (S[A"-ccopt"; A"-fsigned-char"]);
-+
-           dispatch_default e
-       | e ->
-           dispatch_default e
--- 
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index 4bd718e..0000000
--- a/debian/patches/series
+++ /dev/null
@@ -1,5 +0,0 @@
-0001-Fix-bigstring-layout-bug.patch
-0002-Use-cpp-as-default-preprocessor-on-unknown-OS.patch
-0003-Fix-alignment.patch
-0004-Fix-endianness.patch
-0005-Compile-C-stubs-with-fsigned-char.patch

-- 
bin-prot packaging

_______________________________________________
Pkg-ocaml-maint-commits mailing list
Pkg-ocaml-maint-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits

Reply via email to