Skip to content

Commit

Permalink
nettoyage
Browse files Browse the repository at this point in the history
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7164 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information
Damien Doligez committed Oct 25, 2005
1 parent d47cd4c commit 0e5ca9d
Show file tree
Hide file tree
Showing 41 changed files with 81 additions and 94 deletions.
2 changes: 0 additions & 2 deletions byterun/interp.c
Expand Up @@ -1140,5 +1140,3 @@ void caml_release_bytecode(code_t prog, asize_t prog_size) {
Assert(prog);
Assert(prog_size>0);
}

/* eof $Id$ */
2 changes: 1 addition & 1 deletion stdlib/arg.mli
Expand Up @@ -56,7 +56,7 @@ type spec =
| Symbol of string list * (string -> unit)
(** Take one of the symbols as argument and
call the function with the symbol *)
| Rest of (string -> unit) (** Stop interpreting keywords and call the
| Rest of (string -> unit) (** Stop interpreting keywords and call the
function with each remaining argument *)
(** The concrete type describing the behavior associated
with a keyword. *)
Expand Down
2 changes: 1 addition & 1 deletion stdlib/array.mli
Expand Up @@ -22,7 +22,7 @@ external get : 'a array -> int -> 'a = "%array_safe_get"
(** [Array.get a n] returns the element number [n] of array [a].
The first element has number 0.
The last element has number [Array.length a - 1].
You can also write [a.(n)] instead of [Array.get a n].
You can also write [a.(n)] instead of [Array.get a n].
Raise [Invalid_argument "index out of bounds"]
if [n] is outside the range 0 to [(Array.length a - 1)]. *)
Expand Down
5 changes: 3 additions & 2 deletions stdlib/arrayLabels.mli
Expand Up @@ -70,7 +70,8 @@ val make_matrix : dimx:int -> dimy:int -> 'a -> 'a array array
size is only [Sys.max_array_length / 2]. *)

val create_matrix : dimx:int -> dimy:int -> 'a -> 'a array array
(** @deprecated [Array.create_matrix] is an alias for {!ArrayLabels.make_matrix}. *)
(** @deprecated [Array.create_matrix] is an alias for
{!ArrayLabels.make_matrix}. *)

val append : 'a array -> 'a array -> 'a array
(** [Array.append v1 v2] returns a fresh array containing the
Expand Down Expand Up @@ -165,7 +166,7 @@ val sort : cmp:('a -> 'a -> int) -> 'a array -> unit
[Array.sort] is guaranteed to run in constant heap space
and logarithmic stack space.
The current implementation uses Heap Sort. It runs in constant
stack space.
*)
Expand Down
14 changes: 8 additions & 6 deletions stdlib/buffer.ml
Expand Up @@ -30,7 +30,7 @@ let create n =
let contents b = String.sub b.buffer 0 b.position

let sub b ofs len =
if ofs < 0 || len < 0 || ofs > b.position - len
if ofs < 0 || len < 0 || ofs > b.position - len
then invalid_arg "Buffer.sub"
else begin
let r = String.create len in
Expand All @@ -39,8 +39,8 @@ let sub b ofs len =
end
;;

let nth b ofs =
if ofs < 0 || ofs >= b.position then
let nth b ofs =
if ofs < 0 || ofs >= b.position then
invalid_arg "Buffer.nth"
else String.get b.buffer ofs
;;
Expand Down Expand Up @@ -87,7 +87,7 @@ let add_string b s =
if new_position > b.length then resize b len;
String.blit s 0 b.buffer b.position len;
b.position <- new_position

let add_buffer b bs =
add_substring b bs.buffer 0 bs.position

Expand Down Expand Up @@ -122,8 +122,10 @@ let advance_to_non_alpha s start =
if i >= lim then lim else
match s.[i] with
| 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' |
'é'|'à'|'á'|'è'|'ù'|'â'|'ê'|'î'|'ô'|'û'|'ë'|'ï'|'ü'|'ç'|
'É'|'À'|'Á'|'È'|'Ù'|'Â'|'Ê'|'Î'|'Ô'|'Û'|'Ë'|'Ï'|'Ü'|'Ç' ->
'é'|'à'|'á'|'è'|'ù'|'â'|'ê'|
'î'|'ô'|'û'|'ë'|'ï'|'ü'|'ç'|
'É'|'À'|'Á'|'È'|'Ù'|'Â'|'Ê'|
'Î'|'Ô'|'Û'|'Ë'|'Ï'|'Ü'|'Ç' ->
advance (i + 1) lim
| _ -> i in
advance start (String.length s);;
Expand Down
3 changes: 1 addition & 2 deletions stdlib/buffer.mli
Expand Up @@ -18,7 +18,7 @@
This module implements string buffers that automatically expand
as necessary. It provides accumulative concatenation of strings
in quasi-linear time (instead of quadratic time when strings are
concatenated pairwise).
concatenated pairwise).
*)

type t
Expand Down Expand Up @@ -104,4 +104,3 @@ val add_channel : t -> in_channel -> int -> unit
val output_buffer : out_channel -> t -> unit
(** [output_buffer oc b] writes the current contents of buffer [b]
on the output channel [oc]. *)

2 changes: 1 addition & 1 deletion stdlib/callback.mli
Expand Up @@ -17,7 +17,7 @@
This module allows Caml values to be registered with the C runtime
under a symbolic name, so that C code can later call back registered
Caml functions, or raise registered Caml exceptions.
Caml functions, or raise registered Caml exceptions.
*)

val register : string -> 'a -> unit
Expand Down
2 changes: 1 addition & 1 deletion stdlib/camlinternalMod.ml
Expand Up @@ -57,4 +57,4 @@ let rec update_mod shape o n =
assert (Obj.tag n = 0 && Obj.size n >= Array.length comps);
for i = 0 to Array.length comps - 1 do
update_mod comps.(i) (Obj.field o i) (Obj.field n i)
done
done
4 changes: 2 additions & 2 deletions stdlib/camlinternalOO.ml
Expand Up @@ -41,15 +41,15 @@ type params = {
mutable clean_when_copying : bool;
mutable retry_count : int;
mutable bucket_small_size : int
}
}

let params = {
compact_table = true;
copy_parent = true;
clean_when_copying = true;
retry_count = 3;
bucket_small_size = 16
}
}

(**** Parameters ****)

Expand Down
4 changes: 2 additions & 2 deletions stdlib/camlinternalOO.mli
Expand Up @@ -146,7 +146,7 @@ val params : params
(** {6 Statistics} *)

type stats =
{ classes : int;
methods : int;
{ classes : int;
methods : int;
inst_vars : int }
val stats : unit -> stats
2 changes: 1 addition & 1 deletion stdlib/char.mli
Expand Up @@ -17,7 +17,7 @@

external code : char -> int = "%identity"
(** Return the ASCII code of the argument. *)

val chr : int -> char
(** Return the character with the given ASCII code.
Raise [Invalid_argument "Char.chr"] if the argument is
Expand Down
10 changes: 5 additions & 5 deletions stdlib/complex.ml
Expand Up @@ -62,20 +62,20 @@ let arg x = atan2 x.im x.re

let polar n a = { re = cos a *. n; im = sin a *. n }

let sqrt x =
let sqrt x =
if x.re = 0.0 && x.im = 0.0 then { re = 0.0; im = 0.0 }
else begin
let r = abs_float x.re and i = abs_float x.im in
let w =
if r >= i then begin
let q = i /. r in
sqrt(r) *. sqrt(0.5 *. (1.0 +. sqrt(1.0 +. q *. q)))
let q = i /. r in
sqrt(r) *. sqrt(0.5 *. (1.0 +. sqrt(1.0 +. q *. q)))
end else begin
let q = r /. i in
sqrt(i) *. sqrt(0.5 *. (q +. sqrt(1.0 +. q *. q)))
end in
end in
if x.re >= 0.0
then { re = w; im = 0.5 *. x.im /. w }
then { re = w; im = 0.5 *. x.im /. w }
else { re = 0.5 *. i /. w; im = if x.im >= 0.0 then w else -. w }
end

Expand Down
2 changes: 1 addition & 1 deletion stdlib/complex.mli
Expand Up @@ -73,7 +73,7 @@ val arg: t -> float
negative real axis. *)

val polar: float -> float -> t
(** [polar norm arg] returns the complex having norm [norm]
(** [polar norm arg] returns the complex having norm [norm]
and argument [arg]. *)

val exp: t -> t
Expand Down
2 changes: 1 addition & 1 deletion stdlib/digest.mli
Expand Up @@ -18,7 +18,7 @@
This module provides functions to compute 128-bit ``digests'' of
arbitrary-length strings or files. The digests are of cryptographic
quality: it is very hard, given a digest, to forge a string having
that digest. The algorithm used is MD5.
that digest. The algorithm used is MD5.
*)

type t = string
Expand Down
8 changes: 4 additions & 4 deletions stdlib/filename.ml
Expand Up @@ -42,7 +42,7 @@ module Unix = struct
(String.length suff) = suff
let temporary_directory =
try Sys.getenv "TMPDIR" with Not_found -> "/tmp"
let quote = generic_quote "'\\''"
let quote = generic_quote "'\\''"
end

module Win32 = struct
Expand Down Expand Up @@ -106,17 +106,17 @@ let (current_dir_name, parent_dir_name, dir_sep, is_dir_sep, rindex_dir_sep,
is_relative, is_implicit, check_suffix, temporary_directory, quote) =
match Sys.os_type with
"Unix" ->
(Unix.current_dir_name, Unix.parent_dir_name, Unix.dir_sep,
(Unix.current_dir_name, Unix.parent_dir_name, Unix.dir_sep,
Unix.is_dir_sep, Unix.rindex_dir_sep,
Unix.is_relative, Unix.is_implicit, Unix.check_suffix,
Unix.temporary_directory, Unix.quote)
| "Win32" ->
(Win32.current_dir_name, Win32.parent_dir_name, Win32.dir_sep,
(Win32.current_dir_name, Win32.parent_dir_name, Win32.dir_sep,
Win32.is_dir_sep, Win32.rindex_dir_sep,
Win32.is_relative, Win32.is_implicit, Win32.check_suffix,
Win32.temporary_directory, Win32.quote)
| "Cygwin" ->
(Cygwin.current_dir_name, Cygwin.parent_dir_name, Cygwin.dir_sep,
(Cygwin.current_dir_name, Cygwin.parent_dir_name, Cygwin.dir_sep,
Cygwin.is_dir_sep, Cygwin.rindex_dir_sep,
Cygwin.is_relative, Cygwin.is_implicit, Cygwin.check_suffix,
Cygwin.temporary_directory, Cygwin.quote)
Expand Down
1 change: 0 additions & 1 deletion stdlib/filename.mli
Expand Up @@ -97,4 +97,3 @@ val quote : string -> string
(** Return a quoted version of a file name, suitable for use as
one argument in a shell command line, escaping all shell
meta-characters. *)

3 changes: 2 additions & 1 deletion stdlib/format.mli
Expand Up @@ -403,7 +403,8 @@ val get_formatter_tag_functions :
unit -> formatter_tag_functions;;
(** Return the current tag functions of the pretty-printer. *)

(** {6 Changing the meaning of pretty printing (indentation, line breaking, and printing material)} *)
(** {6 Changing the meaning of pretty printing (indentation, line breaking,
and printing material)} *)

val set_all_formatter_output_functions :
out:(string -> int -> int -> unit) ->
Expand Down
8 changes: 4 additions & 4 deletions stdlib/gc.mli
Expand Up @@ -16,7 +16,7 @@
(** Memory management control and statistics; finalised values. *)

type stat =
{ minor_words : float;
{ minor_words : float;
(** Number of words allocated in the minor heap since
the program was started. This number is accurate in
byte-code programs, but only an approximation in programs
Expand Down Expand Up @@ -208,7 +208,7 @@ val finalise : ('a -> unit) -> 'a -> unit
Instead you should write:
- [ let f = fun x -> ... ;; let v = ... in Gc.finalise f v ]
The [f] function can use all features of O'Caml, including
assignments that make the value reachable again. It can also
Expand All @@ -219,7 +219,7 @@ val finalise : ('a -> unit) -> 'a -> unit
the exception will interrupt whatever the program was doing when
the function was called.
[finalise] will raise [Invalid_argument] if [v] is not
heap-allocated. Some examples of values that are not
heap-allocated are integers, constant constructors, booleans,
Expand All @@ -233,7 +233,7 @@ val finalise : ('a -> unit) -> 'a -> unit
stored into arrays, so they can be finalised and collected while
another copy is still in use by the program.
The results of calling {!String.make}, {!String.create},
{!Array.make}, and {!Pervasives.ref} are guaranteed to be
heap-allocated and non-constant except when the length argument is [0].
Expand Down
6 changes: 2 additions & 4 deletions stdlib/genlex.mli
Expand Up @@ -19,7 +19,7 @@
This module implements a simple ``standard'' lexical analyzer, presented
as a function from character streams to token streams. It implements
roughly the lexical conventions of Caml, but is parameterized by the
set of keywords of your language.
set of keywords of your language.
Example: a lexer suitable for a desk calculator is obtained by
Expand Down Expand Up @@ -54,7 +54,7 @@ type token =
| Float of float
| String of string
| Char of char

val make_lexer : string list -> char Stream.t -> token Stream.t
(** Construct the lexer function. The first argument is the list of
keywords. An identifier [s] is returned as [Kwd s] if [s]
Expand All @@ -64,5 +64,3 @@ val make_lexer : string list -> char Stream.t -> token Stream.t
[Parse_error]) otherwise. Blanks and newlines are skipped.
Comments delimited by [(*] and [*)] are skipped as well,
and can be nested. *)


2 changes: 0 additions & 2 deletions stdlib/hashtbl.ml
Expand Up @@ -277,5 +277,3 @@ module Make(H: HashedType): (S with type key = H.t) =
let fold = fold
let length = length
end

(* eof $Id$ *)
1 change: 0 additions & 1 deletion stdlib/int32.mli
Expand Up @@ -166,4 +166,3 @@ external format : string -> int32 -> string = "caml_int32_format"
one [%d], [%i], [%u], [%x], [%X] or [%o] conversion specification.
This function is deprecated; use {!Printf.sprintf} with a [%lx] format
instead. *)

1 change: 0 additions & 1 deletion stdlib/int64.mli
Expand Up @@ -188,4 +188,3 @@ external format : string -> int64 -> string = "caml_int64_format"
[%d], [%i], [%u], [%x], [%X] or [%o] conversion specification.
This function is deprecated; use {!Printf.sprintf} with a [%Lx] format
instead. *)

4 changes: 2 additions & 2 deletions stdlib/lexing.ml
Expand Up @@ -53,7 +53,7 @@ type lex_tables =
lex_base_code : string;
lex_backtrk_code : string;
lex_default_code : string;
lex_trans_code : string;
lex_trans_code : string;
lex_check_code : string;
lex_code: string;}

Expand Down Expand Up @@ -96,7 +96,7 @@ let lex_refill read_fun aux_buffer lexbuf =
*)
if lexbuf.lex_buffer_len + n > String.length lexbuf.lex_buffer then begin
(* There is not enough space at the end of the buffer *)
if lexbuf.lex_buffer_len - lexbuf.lex_start_pos + n
if lexbuf.lex_buffer_len - lexbuf.lex_start_pos + n
<= String.length lexbuf.lex_buffer
then begin
(* But there is enough space if we reclaim the junk at the beginning
Expand Down
2 changes: 1 addition & 1 deletion stdlib/lexing.mli
Expand Up @@ -152,7 +152,7 @@ type lex_tables =
lex_base_code : string;
lex_backtrk_code : string;
lex_default_code : string;
lex_trans_code : string;
lex_trans_code : string;
lex_check_code : string;
lex_code: string;}

Expand Down
3 changes: 2 additions & 1 deletion stdlib/list.ml
Expand Up @@ -158,7 +158,8 @@ let rec mem_assq x = function

let rec remove_assoc x = function
| [] -> []
| (a, b as pair) :: l -> if compare a x = 0 then l else pair :: remove_assoc x l
| (a, b as pair) :: l ->
if compare a x = 0 then l else pair :: remove_assoc x l

let rec remove_assq x = function
| [] -> []
Expand Down
4 changes: 2 additions & 2 deletions stdlib/list.mli
Expand Up @@ -247,7 +247,7 @@ val sort : ('a -> 'a -> int) -> 'a list -> 'a list
[List.sort] is guaranteed to run in constant heap space
(in addition to the size of the result list) and logarithmic
stack space.
The current implementation uses Merge Sort. It runs in constant
heap space and logarithmic stack space.
*)
Expand All @@ -256,7 +256,7 @@ val stable_sort : ('a -> 'a -> int) -> 'a list -> 'a list
(** Same as {!List.sort}, but the sorting algorithm is guaranteed to
be stable (i.e. elements that compare equal are kept in their
original order) .
The current implementation uses Merge Sort. It runs in constant
heap space and logarithmic stack space.
*)
Expand Down
4 changes: 2 additions & 2 deletions stdlib/listLabels.mli
Expand Up @@ -256,14 +256,14 @@ val sort : cmp:('a -> 'a -> int) -> 'a list -> 'a list
[List.sort] is guaranteed to run in constant heap space
(in addition to the size of the result list) and logarithmic
stack space.
The current implementation uses Merge Sort and is the same as
{!ListLabels.stable_sort}.
*)

val stable_sort : cmp:('a -> 'a -> int) -> 'a list -> 'a list
(** Same as {!ListLabels.sort}, but the sorting algorithm is stable.
The current implementation is Merge Sort. It runs in constant
heap space and logarithmic stack space.
*)
Expand Down

0 comments on commit 0e5ca9d

Please sign in to comment.