Skip to content

Commit

Permalink
Code format and warning cleanup in many modules
Browse files Browse the repository at this point in the history
Base64, CharParser, DynArray, Global, Hashcons, Hashtbl, IMap, ISet, Pervasives, Set, Sys
  • Loading branch information
thelema committed Sep 18, 2012
1 parent bd2ddfb commit 1073b28
Show file tree
Hide file tree
Showing 14 changed files with 923 additions and 935 deletions.
2 changes: 1 addition & 1 deletion src/batBase64.ml
Expand Up @@ -20,7 +20,7 @@


exception Invalid_char exception Invalid_char
exception Invalid_table exception Invalid_table
exception Invalid_padding (* UNUSED exception Invalid_padding *)


external unsafe_char_of_int : int -> char = "%identity" external unsafe_char_of_int : int -> char = "%identity"


Expand Down
3 changes: 0 additions & 3 deletions src/batCharParser.ml
Expand Up @@ -97,8 +97,6 @@ let digit = label "digit"
let hex = label "hex" let hex = label "hex"
( satisfy (fun x -> ( '0' <= x && x <= '9' ) || ('a' <= x && x <= 'f') || ('A' <= x && x <= 'F'))) ( satisfy (fun x -> ( '0' <= x && x <= '9' ) || ('a' <= x && x <= 'f') || ('A' <= x && x <= 'F')))


let first s = String.get s 0

let not_char c = label ("anything but '" ^ BatString.of_char c ^ "'") let not_char c = label ("anything but '" ^ BatString.of_char c ^ "'")
(satisfy (fun x -> x <> c) (*>>= (satisfy (fun x -> x <> c) (*>>=
fun x -> Printf.eprintf "(%c)\n" x; return x*) fun x -> Printf.eprintf "(%c)\n" x; return x*)
Expand All @@ -112,4 +110,3 @@ let none_of l = label (
(none_of l) (none_of l)


let newline = satisfy BatChar.is_newline let newline = satisfy BatChar.is_newline

2 changes: 1 addition & 1 deletion src/batDynArray.ml
Expand Up @@ -252,7 +252,7 @@ let delete_last d =
iset d.arr (d.len - 1) dummy_for_gc; iset d.arr (d.len - 1) dummy_for_gc;
changelen d (d.len - 1) changelen d (d.len - 1)


let rec blit src srcidx dst dstidx len = let blit src srcidx dst dstidx len =
if len < 0 then invalid_arg len "blit" "len"; if len < 0 then invalid_arg len "blit" "len";
if srcidx < 0 || srcidx + len > src.len then invalid_arg srcidx "blit" "source index"; if srcidx < 0 || srcidx + len > src.len then invalid_arg srcidx "blit" "source index";
if dstidx < 0 || dstidx > dst.len then invalid_arg dstidx "blit" "dest index"; if dstidx < 0 || dstidx > dst.len then invalid_arg dstidx "blit" "dest index";
Expand Down
3 changes: 0 additions & 3 deletions src/batGlobal.ml
Expand Up @@ -44,8 +44,5 @@ let undef (r, _) =
let isdef (r, _) = let isdef (r, _) =
!r <> None !r <> None


let opt (r, _) =
!r

let get (r,_) = !r let get (r,_) = !r
(*BISECT-IGNORE-END*) (*BISECT-IGNORE-END*)
2 changes: 2 additions & 0 deletions src/batHashcons.ml
Expand Up @@ -52,6 +52,8 @@ sig
val clear : t -> unit val clear : t -> unit
val hashcons : t -> key -> key hobj val hashcons : t -> key -> key hobj
val iter : (key hobj -> unit) -> t -> unit val iter : (key hobj -> unit) -> t -> unit
val fold : (key hobj -> 'a -> 'a) -> t -> 'a -> 'a
val count : t -> int
end end


module MakeTable (HT : Hashtbl.HashedType) : Table with type key = HT.t = module MakeTable (HT : Hashtbl.HashedType) : Table with type key = HT.t =
Expand Down
13 changes: 10 additions & 3 deletions src/batHashcons.mli
Expand Up @@ -55,8 +55,17 @@ module type Table = sig
@raise Failure if number of objects with the same hash reaches system limit of array size *) @raise Failure if number of objects with the same hash reaches system limit of array size *)


val iter : (key hobj -> unit) -> t -> unit val iter : (key hobj -> unit) -> t -> unit
(** [iter f tab] applied [f] to every live hashed object in the (** [iter f tab] applies [f] to every live hashed object in the
table [tab]. *) table [tab]. *)

val fold : (key hobj -> 'a -> 'a) -> t -> 'a -> 'a
(** [fold f tab x0] folds [f] across every live hashed object in
the table [tab], starting with value [x0] *)

val count : t -> int
(** [count tab] returns a count of how many live objects are in
[tab]. This can decrease whenever the GC runs, even during
execution, so consider the returned value as an upper-bound. *)
end end


module MakeTable (HT : BatHashtbl.HashedType) module MakeTable (HT : BatHashtbl.HashedType)
Expand All @@ -80,5 +89,3 @@ module H : sig
(** [hc1 ho k] corresponds to the hashcode of the [k]th (** [hc1 ho k] corresponds to the hashcode of the [k]th
constructor applied to the hashed object [ho]. *) constructor applied to the hashed object [ho]. *)
end end


0 comments on commit 1073b28

Please sign in to comment.