From: Vincent Hanquez Date: Mon, 27 Apr 2009 11:38:47 +0000 (+0100) Subject: json: fix Null _ that newer ocaml compiler doesn't spot as errors. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4469e8272093ccb0eb6361fd5d12af3af6f2c8d7;p=xenclient%2Ftoolstack.git json: fix Null _ that newer ocaml compiler doesn't spot as errors. Null doesn't take any arguments, so is that a new compiler bug ? --- diff --git a/libs/json/json_conv.ml b/libs/json/json_conv.ml index a92b45d..463c188 100644 --- a/libs/json/json_conv.ml +++ b/libs/json/json_conv.ml @@ -38,7 +38,7 @@ let string_of_json ?(permissive=false) j = | Json.String s -> s | _ -> raise_unexpected_json_type (Json.string_of_type j) "string" in let lenient = function - | Json.Null _ -> "" + | Json.Null -> "" | Json.String s -> s | Json.Array a -> if Array.length a = 0 then @@ -56,7 +56,7 @@ let int_of_json ?(permissive=false) j = | Json.Int i -> Int64.to_int i | _ -> raise_unexpected_json_type (Json.string_of_type j) "int" in let lenient = function - | Json.Null _ -> 0 + | Json.Null -> 0 | Json.Bool b -> if b then 1 else 0 | Json.Int i -> Int64.to_int i | Json.Array a -> @@ -75,7 +75,7 @@ let int64_of_json ?(permissive=false) j = | Json.Int i -> i | _ -> raise_unexpected_json_type (Json.string_of_type j) "int64" in let lenient = function - | Json.Null _ -> 0L + | Json.Null -> 0L | Json.Bool b -> if b then 1L else 0L | Json.Int i -> i | Json.Array a -> @@ -93,7 +93,7 @@ let bool_of_json ?(permissive=false) j = | Json.Bool b -> b | _ -> raise_unexpected_json_type (Json.string_of_type j) "bool" in let lenient = function - | Json.Null _ -> false + | Json.Null -> false | Json.Bool b -> b | Json.Int i -> i <> 0L | Json.Array a ->