Skip to content

Commit

Permalink
Merge pull request #282 from yallop/restore-of_int64
Browse files Browse the repository at this point in the history
Restore Signed.S.(of|to)_int64.
  • Loading branch information
yallop committed Mar 13, 2015
2 parents e975f72 + 05898d7 commit ba5d083
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ctypes/ctypes_ptr.ml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ struct
let of_nativeint x = x
let to_nativeint x = x

let of_int64 = Int64.to_nativeint
let to_int64 = Int64.of_nativeint

let null = zero
end

Expand Down
4 changes: 4 additions & 0 deletions src/ctypes/signed.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ module type S = sig
val shift_right_logical : t -> int -> t
val of_nativeint : nativeint -> t
val to_nativeint : t -> nativeint
val of_int64 : int64 -> t
val to_int64 : t -> int64
end

module type Basics = sig
Expand Down Expand Up @@ -55,6 +57,8 @@ struct
module Infix = MakeInfix(Int32)
let of_nativeint = Nativeint.to_int32
let to_nativeint = Nativeint.of_int32
let of_int64 = Int64.to_int32
let to_int64 = Int64.of_int32
end

module Int64 =
Expand Down
6 changes: 6 additions & 0 deletions src/ctypes/signed.mli
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ module type S = sig

val to_nativeint : t -> nativeint
(** Convert the given signed integer to a nativeint value. *)

val of_int64 : int64 -> t
(** Convert the given int64 value to a signed integer. *)

val to_int64 : t -> int64
(** Convert the given signed integer to an int64 value. *)
end
(** Signed integer operations *)

Expand Down

0 comments on commit ba5d083

Please sign in to comment.