Indentation fixes

This commit is contained in:
Grégoire Henry 2018-05-25 16:46:55 +02:00
parent f3b0b0b00a
commit 2a85c34c67
4 changed files with 33 additions and 32 deletions

View File

@ -63,12 +63,12 @@ module Atom = struct
Int32.to_int (MBytes.get_int32 buffer ofs) Int32.to_int (MBytes.get_int32 buffer ofs)
let int = function let int = function
| `Int31 -> int31 | `Int31 -> int31
| `Int16 -> int16 | `Int16 -> int16
| `Int8 -> int8 | `Int8 -> int8
| `Uint30 -> uint30 | `Uint30 -> uint30
| `Uint16 -> uint16 | `Uint16 -> uint16
| `Uint8 -> uint8 | `Uint8 -> uint8
let ranged_int ~minimum ~maximum state = let ranged_int ~minimum ~maximum state =
let read_int = let read_int =

View File

@ -110,12 +110,12 @@ module Atom = struct
Int32.to_int (MBytes.get_int32 buffer ofs) Int32.to_int (MBytes.get_int32 buffer ofs)
let int = function let int = function
| `Int31 -> int31 | `Int31 -> int31
| `Int16 -> int16 | `Int16 -> int16
| `Int8 -> int8 | `Int8 -> int8
| `Uint30 -> uint30 | `Uint30 -> uint30
| `Uint16 -> uint16 | `Uint16 -> uint16
| `Uint8 -> uint8 | `Uint8 -> uint8
let ranged_int ~minimum ~maximum resume state k = let ranged_int ~minimum ~maximum resume state k =
let read_int = let read_int =

View File

@ -279,26 +279,26 @@ let rec write_rec : type a. a Encoding.t -> state -> a -> unit =
and write_with_limit : type a. int -> a Encoding.t -> state -> a -> unit = and write_with_limit : type a. int -> a Encoding.t -> state -> a -> unit =
fun limit e state value -> fun limit e state value ->
(* backup the current limit *) (* backup the current limit *)
let old_limit = state.allowed_bytes in let old_limit = state.allowed_bytes in
(* install the new limit (only if smaller than the current limit) *) (* install the new limit (only if smaller than the current limit) *)
let limit = let limit =
match state.allowed_bytes with match state.allowed_bytes with
| None -> limit | None -> limit
| Some old_limit -> min old_limit limit in | Some old_limit -> min old_limit limit in
state.allowed_bytes <- Some limit ; state.allowed_bytes <- Some limit ;
write_rec e state value ; write_rec e state value ;
(* restore the previous limit (minus the read bytes) *) (* restore the previous limit (minus the read bytes) *)
match old_limit with match old_limit with
| None -> | None ->
state.allowed_bytes <- None state.allowed_bytes <- None
| Some old_limit -> | Some old_limit ->
let remaining = let remaining =
match state.allowed_bytes with match state.allowed_bytes with
| None -> assert false | None -> assert false
| Some len -> len in | Some len -> len in
let read = limit - remaining in let read = limit - remaining in
state.allowed_bytes <- Some (old_limit - read) state.allowed_bytes <- Some (old_limit - read)
(** ******************** *) (** ******************** *)

View File

@ -18,6 +18,7 @@ if [ -z "$files" ]; then
files=` find \( -name _build -or \ files=` find \( -name _build -or \
-name .git -or \ -name .git -or \
-wholename ./src/environment/v1.ml -or \ -wholename ./src/environment/v1.ml -or \
-name ocplib-json-typed -or \
-name registerer.ml \) -prune -or \ -name registerer.ml \) -prune -or \
\( -name \*.ml -or -name \*.mli \) -print` \( -name \*.ml -or -name \*.mli \) -print`
fi fi