Permalink
Browse files

Code format and warning cleanup in many modules

Base64, CharParser, DynArray, Global, Hashcons, Hashtbl, IMap, ISet, Pervasives, Set, Sys
  • Loading branch information...
1 parent bd2ddfb commit 1073b283fdb209034893f6e501740b448d0634fd @thelema thelema committed Sep 4, 2012
Showing with 923 additions and 935 deletions.
  1. +1 −1 src/batBase64.ml
  2. +0 −3 src/batCharParser.ml
  3. +1 −1 src/batDynArray.ml
  4. +0 −3 src/batGlobal.ml
  5. +2 −0 src/batHashcons.ml
  6. +10 −3 src/batHashcons.mli
  7. +335 −338 src/batHashtbl.ml
  8. +9 −7 src/batHashtbl.mli
  9. +256 −258 src/batIMap.ml
  10. +2 −0 src/batIMap.mli
  11. +1 −1 src/batISet.ml
  12. +301 −305 src/batPervasives.ml
  13. +4 −8 src/batSet.ml
  14. +1 −7 src/batSys.ml
View
@@ -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"
View
@@ -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*)
@@ -112,4 +110,3 @@ let none_of l = label (
(none_of l)
let newline = satisfy BatChar.is_newline
-
View
@@ -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";
View
@@ -44,8 +44,5 @@ let undef (r, _) =
let isdef (r, _) =
!r <> None
-let opt (r, _) =
- !r
-
let get (r,_) = !r
(*BISECT-IGNORE-END*)
View
@@ -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 =
View
@@ -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)
@@ -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
-
-
Oops, something went wrong.

0 comments on commit 1073b28

Please sign in to comment.