Skip to content

Commit

Permalink
Merge pull request #105 from djs55/safe-string
Browse files Browse the repository at this point in the history
Update to OCaml 4.06 (and -safe-string)
  • Loading branch information
djs55 authored Dec 7, 2017
2 parents 982b381 + f949c33 commit d70d23c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.10.4 (2017-12-07):
- fix build on OCaml 4.06 (and -safe-string)
- update to new sha.1.10 signature
- document the prometheus support

## 0.10.3 (2017-08-02):
- avoid linking ppx tools into the library

Expand Down
6 changes: 3 additions & 3 deletions cli/impl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 +418,13 @@ let sha _common_options_t filename =
>>= fun info ->
let ctx = Sha1.init () in
let update_cstruct c =
let b' : (int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t = Obj.magic c.Cstruct.buffer in
let b' = c.Cstruct.buffer in
if c.Cstruct.off = 0 && c.Cstruct.len = (Bigarray.Array1.dim b')
then Sha1.update_buffer ctx b'
else begin
let c' = Cstruct.create (Cstruct.len c) in
Cstruct.blit c 0 c' 0 (Cstruct.len c);
let b' : (int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t = Obj.magic c'.Cstruct.buffer in
let b' = c'.Cstruct.buffer in
Sha1.update_buffer ctx b'
end in
let buf = Io_page.(to_cstruct @@ get 1024) in
Expand Down Expand Up @@ -768,7 +768,7 @@ let rehydrate _common input_filename output_filename =
>>= fun output_fd ->
Lwt_unix.LargeFile.lseek output_fd (Int64.pred metadata.total_size) Lwt_unix.SEEK_SET
>>= fun _ ->
Lwt_unix.write output_fd "\000" 0 1
Lwt_unix.write output_fd (Bytes.of_string "\000") 0 1
>>= fun _ ->
(* Append the metadata intervals from the `input_fd` to `metadata_fd` *)
Qcow.Int64.IntervalSet.fold_s
Expand Down
2 changes: 1 addition & 1 deletion qcow-tool.opam
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ depends: [
"mirage-block-unix" {>= "2.1.0"}
"mirage-time"
"mirage-time-lwt"
"sha"
"sha" {>= "1.10"}
"sexplib"
"logs"
"fmt" {>="0.8.2"}
Expand Down

0 comments on commit d70d23c

Please sign in to comment.