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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

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

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

Expand Down
3 changes: 0 additions & 3 deletions src/batCharParser.ml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ let digit = label "digit"
let hex = label "hex"
( 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 ^ "'")
(satisfy (fun x -> x <> c) (*>>=
fun x -> Printf.eprintf "(%c)\n" x; return x*)
Expand All @@ -112,4 +110,3 @@ let none_of l = label (
(none_of l)

let newline = satisfy BatChar.is_newline

2 changes: 1 addition & 1 deletion src/batDynArray.ml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ let delete_last d =
iset d.arr (d.len - 1) dummy_for_gc;
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 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";
Expand Down
3 changes: 0 additions & 3 deletions src/batGlobal.ml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,5 @@ let undef (r, _) =
let isdef (r, _) =
!r <> None

let opt (r, _) =
!r

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

module MakeTable (HT : Hashtbl.HashedType) : Table with type key = HT.t =
Expand Down
13 changes: 10 additions & 3 deletions src/batHashcons.mli
Original file line number Diff line number Diff line change
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 *)

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]. *)

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

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
constructor applied to the hashed object [ho]. *)
end


Loading

0 comments on commit 1073b28

Please sign in to comment.