From 7255fb2c3d2f6d8c4cbd314d458a7b45266d913c Mon Sep 17 00:00:00 2001 From: Arthur Bit-Monnot Date: Wed, 6 Nov 2019 14:14:51 +0100 Subject: [PATCH] Run auto format on sources --- src/ftest.ml | 6 +++--- src/gfile.ml | 12 ++++++------ src/graph.ml | 2 +- src/graph.mli | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/ftest.ml b/src/ftest.ml index c525a6b..4de8c1f 100644 --- a/src/ftest.ml +++ b/src/ftest.ml @@ -1,5 +1,5 @@ open Gfile - + let () = (* Check the number of command-line arguments *) @@ -11,10 +11,10 @@ let () = (* Arguments are : infile(1) source-id(2) sink-id(3) outfile(4) *) - + let infile = Sys.argv.(1) and outfile = Sys.argv.(4) - + (* These command-line arguments are not used for the moment. *) and _source = int_of_string Sys.argv.(2) and _sink = int_of_string Sys.argv.(3) diff --git a/src/gfile.ml b/src/gfile.ml index 2393fd9..2d8aee7 100644 --- a/src/gfile.ml +++ b/src/gfile.ml @@ -1,6 +1,6 @@ open Graph open Printf - + type path = string (* Format of text files: @@ -16,7 +16,7 @@ type path = string e 3 1 11 e 0 2 8 - *) +*) let write_file path graph = @@ -32,9 +32,9 @@ let write_file path graph = (* Write all arcs *) e_iter graph (fun id1 id2 lbl -> fprintf ff "e %d %d %s\n" id1 id2 lbl) ; - + fprintf ff "\n%% End of graph\n" ; - + close_out ff ; () @@ -90,7 +90,7 @@ let from_file path = in let final_graph = loop 0 empty_graph in - + close_in infile ; final_graph - + diff --git a/src/graph.ml b/src/graph.ml index 2bef130..33f7a15 100644 --- a/src/graph.ml +++ b/src/graph.ml @@ -32,7 +32,7 @@ let new_arc gr id1 id2 lbl = (* Update out-arcs. * remove_assoc does not fail if id2 is not bound. *) let outb = (id2, lbl) :: List.remove_assoc id2 outa in - + (* Replace out-arcs in the graph. *) let gr2 = List.remove_assoc id1 gr in (id1, outb) :: gr2 diff --git a/src/graph.mli b/src/graph.mli index d8b187b..626ce55 100644 --- a/src/graph.mli +++ b/src/graph.mli @@ -37,7 +37,7 @@ type 'a out_arcs = (id * 'a) list val out_arcs: 'a graph -> id -> 'a out_arcs (* find_arc gr id1 id2 finds an arc between id1 and id2 and returns its label. Returns None if the arc does not exist. -* @raise Graph_error if id1 is unknown. *) + * @raise Graph_error if id1 is unknown. *) val find_arc: 'a graph -> id -> id -> 'a option @@ -48,7 +48,7 @@ val n_iter: 'a graph -> (id -> unit) -> unit (* Like n_iter, but the nodes are sorted. *) val n_iter_sorted: 'a graph -> (id -> unit) -> unit - + (* Fold on all (unsorted) nodes. You must remember what List.fold_left does. *) val n_fold: 'a graph -> ('b -> id -> 'b) -> 'b -> 'b