]> xenbits.xensource.com Git - xenclient/toolstack.git/commitdiff
json: fix Null _ that newer ocaml compiler doesn't spot as errors.
authorVincent Hanquez <vincent.hanquez@eu.citrix.com>
Mon, 27 Apr 2009 11:38:47 +0000 (12:38 +0100)
committerVincent Hanquez <vincent.hanquez@eu.citrix.com>
Mon, 27 Apr 2009 11:38:47 +0000 (12:38 +0100)
Null doesn't take any arguments, so is that a new compiler bug ?

libs/json/json_conv.ml

index a92b45d6095fb64e6823c3ebcdf52a189859b7e3..463c18885f8edb60d075c4e9fde8c5512d20c4fa 100644 (file)
@@ -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  ->