Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ocplib-endian #67

Merged
merged 1 commit into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion crowbar.opam
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ bug-reports: "https://github.com/stedolan/crowbar/issues"
depends: [
"dune" {>= "2.9"}
"ocaml" {>= "4.08"}
"ocplib-endian"
"cmdliner" {>= "1.1.0"}
"afl-persistent" {>= "1.1"}
"calendar" {>= "2.00" & with-test}
Expand Down
1 change: 0 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
)
(depends
(ocaml (>= "4.08"))
ocplib-endian
(cmdliner (>= 1.1.0))
(afl-persistent (>= "1.1"))
("calendar" (and (>= "2.00") :with-test))
Expand Down
11 changes: 6 additions & 5 deletions src/crowbar.ml
Original file line number Diff line number Diff line change
Expand Up @@ -148,22 +148,22 @@ let int8 = with_printer pp_int (map [uint8] (fun n -> n - 128))

let read_uint16 src =
let off = getbytes src 2 in
EndianBytes.LittleEndian.get_uint16 src.buf off
Bytes.get_uint16_le src.buf off

let read_int16 src =
let off = getbytes src 2 in
EndianBytes.LittleEndian.get_int16 src.buf off
Bytes.get_int16_le src.buf off

let uint16 = with_printer pp_int (primitive read_uint16 0)
let int16 = with_printer pp_int (primitive read_int16 0)

let read_int32 src =
let off = getbytes src 4 in
EndianBytes.LittleEndian.get_int32 src.buf off
Bytes.get_int32_le src.buf off

let read_int64 src =
let off = getbytes src 8 in
EndianBytes.LittleEndian.get_int64 src.buf off
Bytes.get_int64_le src.buf off

let int32 = with_printer pp_int32 (primitive read_int32 0l)
let int64 = with_printer pp_int64 (primitive read_int64 0L)
Expand All @@ -177,7 +177,8 @@ let int =

let float = with_printer pp_float (primitive (fun src ->
let off = getbytes src 8 in
EndianBytes.LittleEndian.get_double src.buf off) 0.)
let i64 = Bytes.get_int64_le src.buf off in
Int64.float_of_bits i64) 0.)

let char = with_printer pp_char (primitive read_char 'a')

Expand Down
2 changes: 1 addition & 1 deletion src/dune
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(library
(public_name crowbar)
(libraries cmdliner ocplib-endian afl-persistent str))
(libraries cmdliner afl-persistent str))