Skip to content
Snippets Groups Projects
Commit 52121bc6 authored by Thibault Martin's avatar Thibault Martin Committed by Andre Maroneze
Browse files

[kernel] Remove deprecated Integer functions

parent 0892d5a2
No related branches found
No related tags found
No related merge requests found
......@@ -105,12 +105,6 @@ let to_int_exn = Z.to_int
let to_int64_exn = Z.to_int64
let to_int32_exn = Z.to_int32
(* These functions are deprecated (renamed to *_exn) and will be removed
in a future version. *)
let to_int = to_int_exn
let to_int64 = to_int64_exn
let to_int32 = to_int32_exn
let wrap to_int i = try Some (to_int i) with Z.Overflow -> None
let to_int_opt = wrap Z.to_int
let to_int64_opt = wrap Z.to_int64
......@@ -202,9 +196,9 @@ let pretty_hex fmt v =
if gt v two_power_60 then
let quo, rem = Z.ediv_rem v two_power_60 in
aux quo;
Format.fprintf fmt "%015LX" (to_int64 rem)
Format.fprintf fmt "%015LX" (to_int64_exn rem)
else
Format.fprintf fmt "%LX" (to_int64 v)
Format.fprintf fmt "%LX" (to_int64_exn v)
in
if equal v zero then Format.pp_print_string fmt "0"
else if gt v zero then (Format.pp_print_string fmt "0x"; aux v)
......@@ -229,7 +223,7 @@ let length u v = succ (sub v u)
let extract_bits ~start ~stop v =
assert (ge start zero && ge stop start);
(*Format.printf "%a[%a..%a]@\n" pretty v pretty start pretty stop;*)
let r = Z.extract v (to_int start) (to_int (length start stop)) in
let r = Z.extract v (to_int_exn start) (to_int_exn (length start stop)) in
(*Format.printf "%a[%a..%a]=%a@\n" pretty v pretty start pretty stop pretty r;*)
r
......
......@@ -124,27 +124,6 @@ val of_int : int -> t
val of_int64 : Int64.t -> t
val of_int32 : Int32.t -> t
(**
@raise Z.Overflow if too big
@deprecated 24.0-Chromium Renamed to [to_int_exn].
Also consider using [to_int_opt].
*)
val to_int : t -> int [@@deprecated]
(**
@raise Z.Overflow if too big
@deprecated 24.0-Chromium Renamed to [to_int64_exn].
Also consider using [to_int64_opt].
*)
val to_int64 : t -> int64 [@@deprecated]
(**
@raise Z.Overflow if too big
@deprecated 24.0-Chromium Renamed to [to_int32_exn].
Also consider using [to_int32_opt].
*)
val to_int32 : t -> int32 [@@deprecated]
(**
@raise Z.Overflow if too big
@since 24.0-Chromium
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment