Permalink
Browse files

removing many warnings

  • Loading branch information...
1 parent d33bca5 commit 1efc010f34aa96bbffb32408aa984f51104099c7 @sliquister sliquister committed Feb 23, 2012
View
@@ -3,3 +3,4 @@
"syntax/pa_comprehension" or "syntax/pa_strings": include
<batFingerTree.ml>: rectypes, warn_A, warn_e
true: debug
+<{batMap,batVect,batFile,batPervasives,batParserCo,batSet}.ml>: warn_z
View
@@ -324,7 +324,7 @@ let of_enum e =
let n = BatEnum.count e in
(* This assumes, reasonably, that init traverses the array in order. *)
Array.init n
- (fun i ->
+ (fun _i ->
match BatEnum.get e with
| Some x -> x
| None -> assert false (*BISECT-VISIT*))
@@ -731,8 +731,6 @@ struct
let for_all ~f a = for_all f a
let iter2i ~f a b = iter2i f a b
let find ~f a = find f a
- let map ~f a = map f a
- let mapi ~f a = mapi f a
let filter ~f a = filter f a
let filter_map ~f a = filter_map f a
end
@@ -789,8 +787,6 @@ struct
let iter2i ~f a b = iter2i f a b
let find ~f a = find f a
let findi ~f e = findi f e
- let map ~f a = map f a
- let mapi ~f a = mapi f a
let filter ~f a = filter f a
let filter_map ~f a = filter_map f a
module LExceptionless = struct
View
@@ -115,4 +115,4 @@ type bounded = t
let min_num, max_num = false, true
let print out t = BatInnerIO.nwrite out (to_string t)
-let t_printer paren out t = print out t
+let t_printer _paren out t = print out t
View
@@ -65,7 +65,7 @@ let lru_cache ~gen ~cap =
if k = k0 then v (* special case head of list *)
else
let n =
- try BatDllist.find (fun (k1,v1) -> k1 = k) dll |> tap BatDllist.remove
+ try BatDllist.find (fun (k1,_v1) -> k1 = k) dll |> tap BatDllist.remove
with Not_found -> incr len; BatDllist.create (k, gen k)
in
(* Put n at the head of the list *)
View
@@ -103,6 +103,6 @@ module BaseNoLock = struct
external create: unit -> t = "%ignore"
external lock : t -> unit = "%ignore"
external unlock: t -> unit = "%ignore"
- let try_lock t = true
+ let try_lock _t = true
end
module NoLock = MakeLock(BaseNoLock)
View
@@ -58,11 +58,11 @@ let snoc q x =
let front q =
match q with
- | {front = h :: front; flen = flen} ->
+ | {front = h :: front; flen = flen; _} ->
Some (h, { q with front = front ; flen = flen - 1 })
- | {rear = []} ->
+ | {rear = []; _} ->
None
- | {rear = rear; rlen = rlen} ->
+ | {rear = rear; rlen = rlen; _} ->
(* beware: when rlen = 1, we must put the only element of
* the deque at the front (ie new_flen = 1, new_rlen = 0) *)
let new_flen = (rlen + 1) / 2 in
@@ -85,11 +85,11 @@ let front q =
let rear q =
match q with
- | {rear = t :: rear; rlen = rlen} ->
+ | {rear = t :: rear; rlen = rlen; _} ->
Some ({ q with rear = rear ; rlen = rlen - 1 }, t)
- | {front = []} ->
+ | {front = []; _} ->
None
- | {front = front; flen = flen} ->
+ | {front = front; flen = flen; _} ->
let new_rlen = (flen + 1) / 2 in
let new_flen = flen / 2 in
let front, rev_rear = BatList.split_at new_flen front in
@@ -269,5 +269,5 @@ let print ?(first="[") ?(last="]") ?(sep="; ") elepr out dq =
= BatIO.to_string (List.print ~first:"<" ~last:">" ~sep:"," Int.print) l)
*)
-let t_printer elepr paren out x = print (elepr false) out x
-let dq_printer elepr paren out x = print (elepr false) out x
+let t_printer elepr _paren out x = print (elepr false) out x
+let dq_printer elepr _paren out x = print (elepr false) out x
View
@@ -46,7 +46,7 @@ let invalid_arg n f p = raise (Invalid_arg (n,f,p))
let length d = d.len
-let exponential_resizer ~currslots ~oldlength ~newlength =
+let exponential_resizer ~currslots ~oldlength:_ ~newlength =
let rec doubler x = if x >= newlength then x else doubler (x * 2) in
let rec halfer x = if x / 2 < newlength then x else halfer (x / 2) in
if newlength = 1 then
@@ -60,7 +60,7 @@ let exponential_resizer ~currslots ~oldlength ~newlength =
let step_resizer step =
if step <= 0 then invalid_arg step "step_resizer" "step";
- (fun ~currslots ~oldlength ~newlength ->
+ (fun ~currslots ~oldlength:_ ~newlength ->
if currslots < newlength || newlength < (currslots - step)
then
(newlength + step - (newlength mod step))
@@ -746,4 +746,4 @@ let unsafe_set a n x =
let print ?(first="[|") ?(last="|]") ?(sep="; ") print_a out t =
BatEnum.print ~first ~last ~sep print_a out (enum t)
-let t_printer a_printer paren out t = print (a_printer false) out t
+let t_printer a_printer _paren out t = print (a_printer false) out t
View
@@ -46,7 +46,7 @@ let make ~next ~count ~clone =
}
(** {6 Internal utilities}*)
-let _dummy () = assert false
+let _dummy () = assert false (*BISECT-VISIT*)
(* raised by 'count' functions, may go outside the API *)
exception Infinite_enum
@@ -65,7 +65,7 @@ let rec empty () =
{
count = return_no_more_count;
next = return_no_more_elements;
- clone = (fun () -> empty());
+ clone = empty;
fast = true;
}
@@ -129,7 +129,7 @@ module MicroLazyList = struct
let e = make
~next:(fun () -> match Lazy.force !reference with
| Cons(x,t) -> reference := t; x
- | _ -> raise No_more_elements )
+ | Nil -> raise No_more_elements )
~count:_dummy
~clone:(fun () -> aux !reference)
in e.count <- (fun () -> force e; e.count());
@@ -1061,7 +1061,7 @@ let print ?(first="") ?(last="") ?(sep=" ") print_a out e =
aux ()
in aux()
-let t_printer a_printer paren out e =
+let t_printer a_printer _paren out e =
print ~first:"[" ~sep:"; " ~last:"]" (a_printer false) out e
let compare cmp t u =
View
@@ -190,7 +190,7 @@ let sqrt2 = 1.41421356237309504880
let invsqrt2 = 0.70710678118654752440
let print out t = BatInnerIO.nwrite out (to_string t)
-let t_printer paren out t = print out t
+let t_printer _paren out t = print out t
let round_to_string ?(digits=0) x =
@@ -300,5 +300,5 @@ module Safe_float = struct
external to_float : float -> float = "%identity"
let print = print
- let t_printer paren out t = print out t
+ let t_printer _paren out t = print out t
end
View
@@ -193,21 +193,21 @@ let to_enum_filter kwd_table =
match peek enum with
Some '(' -> junk enum; maybe_nested_comment enum
| Some '*' -> junk enum; maybe_end_comment enum
- | Some c -> junk enum; comment enum
+ | Some _ -> junk enum; comment enum
| _ -> raise EarlyEndOfStream
and maybe_nested_comment (enum : enum) =
match peek enum with
Some '*' -> junk enum; let s = enum in comment s; comment s
- | Some c -> junk enum; comment enum
+ | Some _ -> junk enum; comment enum
| _ -> raise EarlyEndOfStream
and maybe_end_comment (enum : enum) =
match peek enum with
Some ')' -> junk enum; ()
| Some '*' -> junk enum; maybe_end_comment enum
- | Some c -> junk enum; comment enum
+ | Some _ -> junk enum; comment enum
| _ -> raise EarlyEndOfStream
in
- fun input -> BatEnum.from_while (fun count -> next_token {position = 0; content = input})
+ fun input -> BatEnum.from_while (fun _count -> next_token {position = 0; content = input})
let to_stream_filter (kwd_table:t) (x:char Stream.t) : token Stream.t =
View
@@ -175,7 +175,7 @@
iter (fun k a -> if f k a then add result k a) t;
result
- let filter f t = filteri (fun k a -> f a) t
+ let filter f t = filteri (fun _k a -> f a) t
let filter_map f t =
let result = create 16 in
@@ -434,7 +434,7 @@
iter (fun k a -> if f k a then add result k a) t;
result
- let filter f t = filteri (fun k a -> f a) t
+ let filter f t = filteri (fun _k a -> f a) t
let filter_map f t =
let result = create 16 in
View
@@ -164,7 +164,7 @@ let print ?(first="[") ?(last="]") ?(sep="; ") elepr out bh =
spin bh ;
BatInnerIO.nwrite out last
-let t_printer elepr paren out x = print (elepr false) out x
+let t_printer elepr _paren out x = print (elepr false) out x
let rec enum bh =
let cur = ref bh in
@@ -342,6 +342,6 @@ module Make (Ord : BatInterfaces.OrderedType) = struct
spin bh ;
BatInnerIO.nwrite out last
- let t_printer elepr paren out x = print (elepr false) out x
+ let t_printer elepr _paren out x = print (elepr false) out x
end
View
@@ -361,7 +361,7 @@ let rec write_bits b ~nbits x =
end
let flush_bits b =
- if b.nbits > 0 then write_bits b (8 - b.nbits) 0
+ if b.nbits > 0 then write_bits b ~nbits:(8 - b.nbits) 0
(**
{6 Generic BatIO}
View
@@ -31,7 +31,7 @@ module Stack = struct
let flag = ref false and pt = ref 0 in
for i = 0 to s.cursor -1 do
match Weak.get s.data i with
- | Some x as d -> if !flag then Weak.set s.data !pt d; incr pt
+ | Some _ as d -> if !flag then Weak.set s.data !pt d; incr pt
| None -> flag := true
done;
s.cursor <- !pt; s.cursor
View
@@ -101,7 +101,7 @@ module BaseInt = struct
let print out t = BatInnerIO.nwrite out (string_of_int t)
let xprint out t = BatPrintf.fprintf out "%X" t
- let t_printer paren out t = print out t
+ let t_printer _paren out t = print out t
let ( -- ) x y = BatEnum.seq x (add one) ((>=) y)
let ( --- ) x y =
View
@@ -118,4 +118,4 @@ let min_num, max_num = min_int, max_int
let print out t = BatInnerIO.nwrite out (to_string t)
let xprint out t = BatPrintf.fprintf out "%lx" t
-let t_printer paren out t = print out t
+let t_printer _paren out t = print out t
View
@@ -63,4 +63,4 @@ external format : string -> int64 -> string = "caml_int64_format"
let print out t = BatInnerIO.nwrite out (to_string t)
let xprint out t = BatPrintf.fprintf out "%Lx" t
-let t_printer paren out t = print out t
+let t_printer _paren out t = print out t
View
@@ -417,15 +417,15 @@ let filter_map f l =
let exists f l =
let rec aux rest = match next rest with
- | Cons (x, t) when f x -> true
+ | Cons (x, _) when f x -> true
| Cons (_, t) -> aux t
| Nil -> false
in aux l
let for_all f l =
let rec aux rest = match next rest with
| Cons (x, t) when f x -> aux t
- | Cons (_, t) -> false
+ | Cons _ -> false
| Nil -> true
in aux l
View
@@ -363,14 +363,14 @@ let rec findi p l =
let rec index_of e l =
let rec loop n = function
| [] -> None
- | h::t when h = e -> Some n
+ | h::_ when h = e -> Some n
| _::t -> loop ( n + 1 ) t
in loop 0 l
let rec index_ofq e l =
let rec loop n = function
| [] -> None
- | h::t when h == e -> Some n
+ | h::_ when h == e -> Some n
| _::t -> loop ( n + 1 ) t
in loop 0 l
@@ -614,14 +614,14 @@ let of_backwards e =
let assoc_inv e l =
let rec aux = function
| [] -> raise Not_found
- | (a,b)::t when b = e -> a
+ | (a,b)::_ when b = e -> a
| _::t -> aux t
in aux l
let assq_inv e l =
let rec aux = function
| [] -> raise Not_found
- | (a,b)::t when b == e -> a
+ | (a,b)::_ when b == e -> a
| _::t -> aux t
in aux l
@@ -690,7 +690,7 @@ let print ?(first="[") ?(last="]") ?(sep="; ") print_a out = function
iter (fun x -> BatInnerIO.nwrite out sep; print_a out x) t;
BatInnerIO.nwrite out last
-let t_printer a_printer paren out x = print (a_printer false) out x
+let t_printer a_printer _paren out x = print (a_printer false) out x
let reduce f = function [] -> invalid_arg "Empty List"
| h::t -> fold_left f h t
Oops, something went wrong.

0 comments on commit 1efc010

Please sign in to comment.