Skip to content

Commit 862a44b

Browse files
authored
ocaml: prepare for ocaml 5.4 (#6791)
There was an incompatible change, and more errors are reported now.
2 parents a9978f1 + cd50d44 commit 862a44b

File tree

3 files changed

+13
-17
lines changed

3 files changed

+13
-17
lines changed

.git-blame-ignore-revs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ b12cf444edea15da6274975e1b2ca6a7fce2a090
3333
364c27f5d18ab9dd31825e67a93efabecad06823
3434
d8b4de9076531dd13bdffa20cc10c72290a52356
3535
bdf06bca7534fbc0c4fc3cee3408a51a22615226
36+
eefc649e17086fbc200e4da114ea673825e79864
3637

3738
# ocp-indent
3839
d018d26d6acd4707a23288b327b49e44f732725e

ocaml/libs/xapi-stdext/lib/xapi-fdcaps/operations.mli

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,18 @@ val setup : unit -> unit
4747

4848
(** {1 Static property tests} *)
4949

50-
val as_readable : (([< readable] as 'a), 'b) make -> ([> readable], 'b) make
50+
val as_readable : ([< readable], 'b) make -> ([> readable], 'b) make
5151
(** [as_readable_opt t] returns [Some t] when [t] is readable, and [None] otherwise. *)
5252

5353
val as_writable : ([< writable], 'b) make -> ([> writable], 'b) make
5454
(** [as_writable_opt t] returns [Some t] when [t] is readable, and [None] otherwise. *)
5555

5656
(** {1 Runtime property tests} *)
5757

58-
val as_readable_opt :
59-
(([< rw] as 'a), 'b) make -> ([> readable], 'b) make option
58+
val as_readable_opt : ([< rw], 'b) make -> ([> readable], 'b) make option
6059
(** [as_readable_opt t] returns [Some t] when [t] is readable, and [None] otherwise. *)
6160

62-
val as_writable_opt :
63-
(([< rw] as 'a), 'b) make -> ([> writable], 'b) make option
61+
val as_writable_opt : ([< rw], 'b) make -> ([> writable], 'b) make option
6462
(** [as_writable_opt t] returns [Some t] when [t] is readable, and [None] otherwise. *)
6563

6664
val as_spipe_opt : ('a, [< kind]) make -> ('a, [> espipe]) make option

ocaml/sdk-gen/c/helper.ml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,16 @@ let comment doc ?(indent = 0) s =
2828
let buf = Buffer.create 16 in
2929
let formatter = Format.formatter_of_buffer buf in
3030
let open Format in
31-
let out, flush, newline, spaces =
32-
let funcs = Format.pp_get_formatter_out_functions formatter () in
33-
(funcs.out_string, funcs.out_flush, funcs.out_newline, funcs.out_spaces)
34-
in
35-
31+
let funcs = Format.pp_get_formatter_out_functions formatter () in
32+
let original_out_newline = funcs.out_newline in
3633
let funcs =
3734
{
38-
out_string= out
39-
; out_flush= flush
40-
; out_newline=
41-
(fun () -> out (Printf.sprintf "\n%s * " indent_str) 0 (indent + 4))
42-
; out_spaces= spaces
43-
; out_indent= spaces
35+
funcs with
36+
out_newline=
37+
(fun () ->
38+
funcs.out_string (Printf.sprintf "\n%s * " indent_str) 0 (indent + 4)
39+
)
40+
; out_indent= funcs.out_spaces
4441
}
4542
in
4643
Format.pp_set_formatter_out_functions formatter funcs ;
@@ -61,7 +58,7 @@ let comment doc ?(indent = 0) s =
6158
Format.fprintf formatter "%!" ;
6259

6360
Format.pp_set_formatter_out_functions formatter
64-
{funcs with out_newline= newline} ;
61+
{funcs with out_newline= original_out_newline} ;
6562

6663
let result = Buffer.contents buf in
6764
let n = String.length result in

0 commit comments

Comments
 (0)