Anonymous avatar Anonymous committed e428ff5

Fixed awful bug in [compare] that caused the return value to be mistyped.

Comments (0)

Files changed (6)

cf/cf_ip4_addr.ml

 let all_routers_group = all_routers_group_ ()
 
 external equal: ([> opaque ] t as 'a) -> 'a -> bool = "cf_ip4_addr_equal"
-external compare: ([> opaque ] t as 'a) -> 'a -> int = "cf_ip4_addr_compare"
+external compare: ([> opaque ] t as 'a) -> 'a -> int =
+    "cf_ip4_addr_compare_aux"
 
 external pton: string -> opaque t option = "cf_inet_pton4"
 external ntop: [> opaque ] t -> string = "cf_inet_ntop4"

cf/cf_ip4_addr.mli

 val all_routers_group: multicast t
 
 (** Use [equal a1 a2] to compare two IPv4 addresses for equality. *)
-val equal: ([> opaque ] t as 'a) -> 'a -> bool
+val equal: [> opaque ] t -> [> opaque ] t -> bool
 
 (** Use [compare a1 a2] to compare the ordinality of two IPv4 addresses. *)
-val compare: ([> opaque ] t as 'a) -> 'a -> int
+val compare: [> opaque ] t -> [> opaque ] t -> int
 
 (** Use [pton s] to convert the string [s] containing an IPv4 address in
     dot-quad format to its equivalent opaque IPv4 address.  Returns [None] if

cf/cf_ip4_addr_p.c

     Cf_ip4_addr_M_global
 };
 
-CAMLprim int cf_ip4_addr_compare(value v1, value v2)
+static int cf_ip4_addr_compare(value v1, value v2)
 {
     CAMLparam2(v1, v2);
     const u_int8_t* addr1Ptr;
 }
 
 /*---
+    external compare:
+        [> opaque ] t -> [> opaque ] t -> int = "cf_ip4_addr_compare_aux"
+  ---*/
+CAMLprim value cf_ip4_addr_compare_aux(value v1, value v2)
+{
+    int d = cf_ip4_addr_compare(v1, v2);
+    return Val_int(d);
+}
+
+/*---
     external pton: string -> opaque t = "cf_inet_pton4"
   ---*/
 CAMLprim value cf_inet_pton4(value str)

cf/cf_ip6_addr.ml

 let link_local_all_routers = link_local_all_routers_ ()
 
 external equal: ([> opaque ] t as 'a) -> 'a -> bool = "cf_ip6_addr_equal"
-external compare: ([> opaque ] t as 'a) -> 'a -> int = "cf_ip6_addr_compare"
+external compare: ([> opaque ] t as 'a) -> 'a -> int =
+    "cf_ip6_addr_compare_aux"
 
 external pton: string -> opaque t option = "cf_inet_pton6"
 external ntop: [> opaque ] t -> string = "cf_inet_ntop6"

cf/cf_ip6_addr.mli

 val link_local_all_routers: multicast t
 
 (** Use [equal a1 a2] to compare two IPv6 addresses for equality. *)
-val equal: ([> opaque ] t as 'a) -> 'a -> bool
+val equal: [> opaque ] t -> [> opaque ] t -> bool
 
 (** Use [compare a1 a2] to compare the ordinality of two IPv6 addresses. *)
-val compare: ([> opaque ] t as 'a) -> 'a -> int
+val compare: [> opaque ] t -> [> opaque ] t -> int
 
 (** Use [pton s] to convert the string [s] containing an IPv6 address in
     numeric format to its equivalent opaque IPv6 address.  Returns [None] if

cf/cf_ip6_addr_p.c

     cf_ip6_addr_alloc_constructor_0
 };
 
-CAMLprim int cf_ip6_addr_compare(value v1, value v2)
+static int cf_ip6_addr_compare(value v1, value v2)
 {
     CAMLparam2(v1, v2);
     const u_int8_t* addr1Ptr;
 }
 
 /*---
+    external compare:
+        [> opaque ] t -> [> opaque ] t -> int = "cf_ip6_addr_compare_aux"
+  ---*/
+CAMLprim value cf_ip6_addr_compare_aux(value v1, value v2)
+{
+    int d = cf_ip6_addr_compare(v1, v2);
+    return Val_int(d);
+}
+
+/*---
     external pton: string -> opaque t option = "cf_inet_pton6"
   ---*/
 CAMLprim value cf_inet_pton6(value str)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.