Skip to content

Commit

Permalink
Merge pull request #79 from ygrek/remove-trailing-whitespace
Browse files Browse the repository at this point in the history
Remove trailing whitespace
  • Loading branch information
ygrek authored Oct 15, 2024
2 parents 4c54a4a + 23cdfb3 commit 43d436a
Show file tree
Hide file tree
Showing 37 changed files with 284 additions and 284 deletions.
2 changes: 1 addition & 1 deletion src/base64.ml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ let encode ?(tbl=chars) ch =
if !count > 0 then begin
let d = (!data lsl (6 - !count)) land 63 in
IO.write ch (Array.unsafe_get tbl d);
end;
end;
in
let write c =
let c = int_of_char c in
Expand Down
2 changes: 1 addition & 1 deletion src/base64.mli
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
8-bit characters are encoded into 6-bit ones using ASCII lookup tables.
Default tables maps 0..63 values on characters A-Z, a-z, 0-9, '+' and '/'
(in that order).
(in that order).
*)

(** This exception is raised when reading an invalid character
Expand Down
26 changes: 13 additions & 13 deletions src/bitSet.ml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ let bset s ndx v =
assert (ndx >= 0 && ndx < fast_length s);
fast_set s ndx v

let bblit src srcoff dst dstoff len =
let bblit src srcoff dst dstoff len =
assert (srcoff >= 0 && dstoff >= 0 && len >= 0);
fast_blit src srcoff dst dstoff len

let bfill dst start len c =
let bfill dst start len c =
assert (start >= 0 && len >= 0);
fast_fill dst start len c

Expand Down Expand Up @@ -133,22 +133,22 @@ exception Break_int of int
(* Find highest set element or raise Not_found *)
let find_msb t =
(* Find highest set bit in a byte. Does not work with zero. *)
let byte_msb b =
let byte_msb b =
assert (b <> 0);
let rec loop n =
let rec loop n =
if b land (1 lsl n) = 0 then
loop (n-1)
else n in
loop 7 in
let n = t.len - 1
and buf = t.data in
try
try
for i = n downto 0 do
let byte = bget buf i in
if byte <> 0 then raise (Break_int ((i lsl log_int_size)+(byte_msb byte)))
done;
raise Not_found
with
with
Break_int n -> n
| _ -> raise Not_found

Expand All @@ -165,11 +165,11 @@ let compare t1 t2 =
begin
(* MSBs differ, we need to scan arrays until we find a
difference *)
let ndx = a lsr log_int_size in
let ndx = a lsr log_int_size in
assert (ndx < t1.len && ndx < t2.len);
try
for i = ndx downto 0 do
let b1 = bget t1.data i
let b1 = bget t1.data i
and b2 = bget t2.data i in
if b1 <> b2 then raise (Break_int (compare b1 b2))
done;
Expand Down Expand Up @@ -228,7 +228,7 @@ let find_first_set b n =
else
Some ((find_lsb byte) + (byte_ndx lsl log_int_size) + bit_offs) in
find_bit (n lsr log_int_size) (n land int_size)

let enum t =
let rec make n =
let cur = ref n in
Expand All @@ -246,7 +246,7 @@ let enum t =
in
make 0

let raw_create size =
let raw_create size =
let b = bcreate size in
bfill b 0 size 0;
{ data = b; len = size }
Expand All @@ -265,7 +265,7 @@ let inter a b =

(* Note: rest of the array is handled automatically correct, since we
took a copy of the bigger set. *)
let union a b =
let union a b =
let d = if a.len > b.len then copy a else copy b in
let sl = min a.len b.len in
let abuf = a.data
Expand All @@ -275,7 +275,7 @@ let union a b =
done;
d

let diff a b =
let diff a b =
let maxlen = max a.len b.len in
let buf = bcreate maxlen in
bblit a.data 0 buf 0 a.len;
Expand All @@ -287,7 +287,7 @@ let diff a b =
done;
{ data = buf; len = maxlen }

let sym_diff a b =
let sym_diff a b =
let maxlen = max a.len b.len in
let buf = bcreate maxlen in
(* Copy larger (assumes missing bits are zero) *)
Expand Down
12 changes: 6 additions & 6 deletions src/dllist.mli
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ val rev_drop : 'a node_t -> 'a node_t
separate the nodes between [n1] and [n2] from the rest of the list. In this
case, those nodes become a discrete list by themselves. This is an O(1)
operation.
*)
*)
val splice : 'a node_t -> 'a node_t -> unit

(** Given a node, get the data associated with that node. This is an
Expand All @@ -102,17 +102,17 @@ val get : 'a node_t -> 'a
*)
val set : 'a node_t -> 'a -> unit

(** Given a node, get the next element in the list after the node.
(** Given a node, get the next element in the list after the node.
The list is circular, so the last node of the list returns the first
The list is circular, so the last node of the list returns the first
node of the list as its next node.
This is an O(1) operation.
*)
val next : 'a node_t -> 'a node_t

(** Given a node, get the previous element in the list before the node.
The list is circular, so the first node of the list returns the
last element of the list as its previous node.
Expand All @@ -131,7 +131,7 @@ val skip : 'a node_t -> int -> 'a node_t
*)
val iter : ('a -> unit) -> 'a node_t -> unit

(** Accumulate a value over the entire list.
(** Accumulate a value over the entire list.
This works like List.fold_left. This is an O(N) operation.
*)
val fold_left : ('a -> 'b -> 'a) -> 'a -> 'b node_t -> 'a
Expand Down
10 changes: 5 additions & 5 deletions src/enum.ml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(*
(*
* Enum - Enumeration over abstract collection of elements.
* Copyright (C) 2003 Nicolas Cannasse
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
Expand Down Expand Up @@ -51,7 +51,7 @@ let rec init n f =
f (n - 1 - !count));
clone = (fun () -> init !count f);
fast = true;
}
}

let rec empty () =
{
Expand Down Expand Up @@ -91,7 +91,7 @@ let force t =
dst.tl <- x;
loop x
in
let enum = ref _empty in
let enum = ref _empty in
(try
enum := { hd = t.next(); tl = _empty };
incr count;
Expand Down Expand Up @@ -341,7 +341,7 @@ let rec filter_map f t =
in
from2 next (fun () -> filter_map f (t.clone()))

let rec append ta tb =
let rec append ta tb =
let t = {
count = (fun () -> ta.count() + tb.count());
next = _dummy;
Expand Down
22 changes: 11 additions & 11 deletions src/enum.mli
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(*
(*
* Enum - enumeration over abstract collection of elements.
* Copyright (C) 2003 Nicolas Cannasse
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
Expand Down Expand Up @@ -47,7 +47,7 @@ val iter2 : ('a -> 'b -> unit) -> 'a t -> 'b t -> unit
val fold : ('a -> 'b -> 'b) -> 'b -> 'a t -> 'b
(** [fold f v e] returns [v] if [e] is empty,
otherwise [f aN (... (f a2 (f a1 v)) ...)] where a1..N are
the elements of [e].
the elements of [e].
*)

val fold2 : ('a -> 'b -> 'c -> 'c) -> 'c -> 'a t -> 'b t -> 'c
Expand All @@ -74,7 +74,7 @@ val find : ('a -> bool) -> 'a t -> 'a
found element, or, raises [Not_found] if no such element exists
in the enumeration, consuming the whole enumeration in the search.
Since [find] consumes a prefix of the enumeration, it can be used several
Since [find] consumes a prefix of the enumeration, it can be used several
times on the same enumeration to find the next element. *)

val is_empty : 'a t -> bool
Expand Down Expand Up @@ -104,8 +104,8 @@ val clone : 'a t -> 'a t

val force : 'a t -> unit
(** [force e] forces the application of all lazy functions and the
enumeration of all elements, exhausting the enumeration.
enumeration of all elements, exhausting the enumeration.
An efficient intermediate data structure
of enumerated elements is constructed and [e] will now enumerate over
that data structure. *)
Expand All @@ -115,7 +115,7 @@ val force : 'a t -> unit
These functions are lazy which means that they will create a new modified
enumeration without actually enumerating any element until they are asked
to do so by the programmer (using one of the functions above).
When the resulting enumerations of these functions are consumed, the
underlying enumerations they were created from are also consumed. *)

Expand Down Expand Up @@ -143,7 +143,7 @@ val concat : 'a t t -> 'a t
(** [concat e] returns an enumeration over all elements of all enumerations
of [e]. *)

(** {1 Constructors}
(** {1 Constructors}
In this section the word {i shall} denotes a semantic
requirement. The correct operation
Expand All @@ -152,7 +152,7 @@ val concat : 'a t t -> 'a t
*)

exception No_more_elements
(** This exception {i shall} be raised by the [next] function of [make]
(** This exception {i shall} be raised by the [next] function of [make]
or [from] when no more elements can be enumerated, it {i shall not}
be raised by any function which is an argument to any
other function specified in the interface.
Expand All @@ -171,9 +171,9 @@ val make : next:(unit -> 'a) -> count:(unit -> int) -> clone:(unit -> 'a t) -> '
{li the [clone] function {i shall} create a clone of the enumeration
such as operations on the original enumeration will not affect the
clone. }}
For some samples on how to correctly use [make], you can have a look
at implementation of [ExtList.enum].
at implementation of [ExtList.enum].
*)

val from : (unit -> 'a) -> 'a t
Expand Down
2 changes: 1 addition & 1 deletion src/extArray.ml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(*
* ExtList - additional and modified functions for lists.
* Copyright (C) 2005 Richard W.M. Jones (rich @ annexia.org)
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
Expand Down
8 changes: 4 additions & 4 deletions src/extHashtbl.ml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(*
(*
* ExtHashtbl, extra functions over hashtables.
* Copyright (C) 2003 Nicolas Cannasse
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
Expand All @@ -17,7 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*)


module Hashtbl =
struct
Expand Down Expand Up @@ -94,7 +94,7 @@ module Hashtbl =
| Cons (k,v,next) -> Cons (k,f v,loop next)
in
h_make { (h_conv h) with
data = Array.map loop (h_conv h).data;
data = Array.map loop (h_conv h).data;
}

(* copied from stdlib :( *)
Expand Down
8 changes: 4 additions & 4 deletions src/extHashtbl.mli
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(*
(*
* ExtHashtbl - extra functions over hashtables.
* Copyright (C) 2003 Nicolas Cannasse
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
Expand All @@ -17,7 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*)

(** Extra functions over hashtables. *)

module Hashtbl :
Expand Down Expand Up @@ -67,7 +67,7 @@ module Hashtbl :
all the values *)

val length : ('a,'b) t -> int
(** Return the number of elements inserted into the Hashtbl
(** Return the number of elements inserted into the Hashtbl
(including duplicates) *)

val reset : ('a,'b) t -> unit
Expand Down
8 changes: 4 additions & 4 deletions src/extLib.ml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(*
(*
* ExtLib - use extensions as separate modules
* Copyright (C) 2003 Nicolas Cannasse
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
Expand All @@ -18,9 +18,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*)

(*
(*
Note:
Since ExtLib is provided for namespace convenience for
users who wants to keep the usage of the original
OCaml Standard Library, no MLI CMI nor documentation will
Expand Down
Loading

0 comments on commit 43d436a

Please sign in to comment.