Skip to content
Snippets Groups Projects
Commit 6ead6d86 authored by Patrick Baudin's avatar Patrick Baudin
Browse files

lint some files

parent d295142b
No related branches found
No related tags found
No related merge requests found
Showing
with 58 additions and 58 deletions
...@@ -13,4 +13,4 @@ Muriel Roger <muriel.roger@cea.fr> ...@@ -13,4 +13,4 @@ Muriel Roger <muriel.roger@cea.fr>
<loic.correnson@cea.fr> <lcorrenson@gmail.com> <loic.correnson@cea.fr> <lcorrenson@gmail.com>
<loic.correnson@cea.fr> <loïc.correnson@cea.fr> <loic.correnson@cea.fr> <loïc.correnson@cea.fr>
Géraud Canet <geraud.canet@cea.fr> Géraud Canet <geraud.canet@cea.fr>
<mounir.assaf@cea.fr> <mounir.assaf@cea.Fr> <mounir.assaf@cea.fr> <mounir.assaf@cea.Fr>
\ No newline at end of file
...@@ -53,19 +53,19 @@ let rec traverse t = ...@@ -53,19 +53,19 @@ let rec traverse t =
let n = size t in let n = size t in
let tag = tag t in let tag = tag t in
if tag < no_scan_tag then begin if tag < no_scan_tag then begin
count := !count + 1 + n; count := !count + 1 + n;
for i = 0 to n - 1 do for i = 0 to n - 1 do
let f = field t i in let f = field t i in
if is_block f then traverse f if is_block f then traverse f
done done
end else if tag = string_tag then end else if tag = string_tag then
count := !count + 1 + n count := !count + 1 + n
else if tag = double_tag then else if tag = double_tag then
count := !count + size_of_double count := !count + size_of_double
else if tag = double_array_tag then else if tag = double_array_tag then
count := !count + 1 + size_of_double * n count := !count + 1 + size_of_double * n
else else
incr count incr count
end end
end end
...@@ -80,8 +80,8 @@ let res () = ...@@ -80,8 +80,8 @@ let res () =
let size_w ?except o = let size_w ?except o =
reset_table (); reset_table ();
(match except with (match except with
| None -> () | None -> ()
| Some except -> traverse (repr except) | Some except -> traverse (repr except)
); );
count := 0; count := 0;
traverse (repr o); traverse (repr o);
......
...@@ -57,19 +57,19 @@ let rec traverse t = ...@@ -57,19 +57,19 @@ let rec traverse t =
let n = size t in let n = size t in
let tag = tag t in let tag = tag t in
if tag < no_scan_tag then begin if tag < no_scan_tag then begin
count := !count + 1 + n; count := !count + 1 + n;
for i = 0 to n - 1 do for i = 0 to n - 1 do
let f = field t i in let f = field t i in
if is_block f then traverse f if is_block f then traverse f
done done
end else if tag = string_tag then end else if tag = string_tag then
count := !count + 1 + n count := !count + 1 + n
else if tag = double_tag then else if tag = double_tag then
count := !count + size_of_double count := !count + size_of_double
else if tag = double_array_tag then else if tag = double_array_tag then
count := !count + 1 + size_of_double * n count := !count + 1 + size_of_double * n
else else
incr count incr count
end end
end end
......
...@@ -5,4 +5,4 @@ V3 ...@@ -5,4 +5,4 @@ V3
V2 V2
New dictionary output using #define New dictionary output using #define
V1 V1
Initial release Initial release
\ No newline at end of file
#!/bin/sh #!/bin/sh
emacs 1max.c emacs 1max.c
\ No newline at end of file
/transf /transf
\ No newline at end of file
...@@ -3,4 +3,4 @@ CALL(main) ...@@ -3,4 +3,4 @@ CALL(main)
&& _X_ (!RETURN(opb) && _X_ (!RETURN(opb)
&& _X_ (!CALL(opa) && _X_ (!CALL(opa)
&& _X_ (RETURN(opb) && _X_ (RETURN(opb)
&& _X_ (RETURN(main)))))) && _X_ (RETURN(main))))))
\ No newline at end of file
...@@ -87,7 +87,7 @@ module Generator (G : Odoc_html.Html_generator) = struct ...@@ -87,7 +87,7 @@ module Generator (G : Odoc_html.Html_generator) = struct
self#html_of_custom b info.Odoc_info.i_custom self#html_of_custom b info.Odoc_info.i_custom
(** Print html code for the first sentence of a description. (** Print html code for the first sentence of a description.
The titles and lists in this first sentence has been removed.*) The titles and lists in this first sentence has been removed.*)
method html_of_info_first_sentence b = function method html_of_info_first_sentence b = function
| None -> () | None -> ()
| Some info -> | Some info ->
......
let run () = let run () =
Self.result "Hello, world!"; Self.result "Hello, world!";
let product = let product =
Self.feedback ~level:2 "Computing the product of 11 and 5..."; Self.feedback ~level:2 "Computing the product of 11 and 5...";
11 * 5 11 * 5
in in
Self.result "11 * 5 = %d" product Self.result "11 * 5 = %d" product
...@@ -38,7 +38,7 @@ val get_stmts : t_elem list -> t_stmt_elems -> t_stmt list ;; ...@@ -38,7 +38,7 @@ val get_stmts : t_elem list -> t_stmt_elems -> t_stmt list ;;
(* retrouver les éléments correspondant à une instruction *) (* retrouver les éléments correspondant à une instruction *)
val get_elems : t_stmt -> t_stmt_elems -> t_elem list ;; val get_elems : t_stmt -> t_stmt_elems -> t_elem list ;;
type t_state type t_state
type t_data type t_data
......
\setbeamerfont{section in head}{size=\scriptsize} \setbeamerfont{section in head}{size=\scriptsize}
\ No newline at end of file
...@@ -26,4 +26,4 @@ ...@@ -26,4 +26,4 @@
% Local Variables: % Local Variables:
% ispell-local-dictionary: "english" % ispell-local-dictionary: "english"
% TeX-master: "slides.tex" % TeX-master: "slides.tex"
% End: % End:
\ No newline at end of file
...@@ -89,4 +89,4 @@ ...@@ -89,4 +89,4 @@
% Local Variables: % Local Variables:
% TeX-master: "slides.tex" % TeX-master: "slides.tex"
% ispell-local-dictionary: "english" % ispell-local-dictionary: "english"
% End: % End:
\ No newline at end of file
...@@ -35,4 +35,4 @@ on n' ...@@ -35,4 +35,4 @@ on n'
prompt, sinon l'utilisateur il croit que ça fait partie de la commande. prompt, sinon l'utilisateur il croit que ça fait partie de la commande.
Le style "verbatim" fait partie des éléments qui aident à reconnaître Le style "verbatim" fait partie des éléments qui aident à reconnaître
les commandes qui peuvent être tappées, et puis on peut/pourra aussi les commandes qui peuvent être tappées, et puis on peut/pourra aussi
tout faire dans l'interface graphique. tout faire dans l'interface graphique.
\ No newline at end of file
...@@ -3,4 +3,4 @@ void main() ...@@ -3,4 +3,4 @@ void main()
//@ loop unroll 20; // should be 21 //@ loop unroll 20; // should be 21
for (int i = 0 ; i <= 20 ; i ++) { for (int i = 0 ; i <= 20 ; i ++) {
} }
} }
\ No newline at end of file
...@@ -6,4 +6,4 @@ void main(void) ...@@ -6,4 +6,4 @@ void main(void)
/*@ loop pragma WIDEN_HINTS i, 12, 13; */ /*@ loop pragma WIDEN_HINTS i, 12, 13; */
for (i=0; i<n; i++) for (i=0; i<n; i++)
j = 4 * i + 7; j = 4 * i + 7;
} }
\ No newline at end of file
Reference_implementation is extracted from http://www.schneier.com/code/skein.zip Reference_implementation is extracted from http://www.schneier.com/code/skein.zip
\ No newline at end of file
...@@ -54,4 +54,4 @@ Frama_C_watch_cardinal() allows to set a maximum number of elements ...@@ -54,4 +54,4 @@ Frama_C_watch_cardinal() allows to set a maximum number of elements
associated to lvalue in the abstract memory state. This is useful associated to lvalue in the abstract memory state. This is useful
in order to watch variables that should remain precise during in order to watch variables that should remain precise during
the entire execution (e.g. should remain a singleton) but which can the entire execution (e.g. should remain a singleton) but which can
take different values at different points. take different values at different points.
\ No newline at end of file
...@@ -105,7 +105,7 @@ let has_no_warning_nor_error = ref true ...@@ -105,7 +105,7 @@ let has_no_warning_nor_error = ref true
let warn fmt = let warn fmt =
pp_job_first_line (); pp_job_first_line ();
if !exit_on_warning then if !exit_on_warning then
has_no_warning_nor_error := false ; has_no_warning_nor_error := false ;
Format.printf "- [warning] "; Format.printf "- [warning] ";
Format.printf fmt Format.printf fmt
...@@ -164,7 +164,7 @@ let get_string_null (ic:in_channel) = ...@@ -164,7 +164,7 @@ let get_string_null (ic:in_channel) =
* *
* Defaults to reading the file entirely since any integer will ever be greater * Defaults to reading the file entirely since any integer will ever be greater
* or equal than [max_int]. * or equal than [max_int].
*) *)
let read_lines ?nlines:(nlines=max_int) get_line filename = let read_lines ?nlines:(nlines=max_int) get_line filename =
let lines = ref [] in let lines = ref [] in
let ic = if filename = "--stdin" then stdin else open_in filename in let ic = if filename = "--stdin" then stdin else open_in filename in
...@@ -355,7 +355,7 @@ let get_header_files ?directories:(dirs=(get_header_dirs ())) () : ...@@ -355,7 +355,7 @@ let get_header_files ?directories:(dirs=(get_header_dirs ())) () :
warn "%s: duplicated license name (same contents as file: %s)@." filepath previous_entry warn "%s: duplicated license name (same contents as file: %s)@." filepath previous_entry
else else
error ~exit_value:7 error ~exit_value:7
"%s: duplicated license name (contents differs to file: %s)@." filepath previous_entry "%s: duplicated license name (contents differs to file: %s)@." filepath previous_entry
with Not_found -> ()); with Not_found -> ());
Hashtbl.add license_path_tbl license_name filepath; Hashtbl.add license_path_tbl license_name filepath;
) )
...@@ -408,7 +408,7 @@ let extract_header filename template_hdr = ...@@ -408,7 +408,7 @@ let extract_header filename template_hdr =
* @param headers a license header -> template header file hashtable * @param headers a license header -> template header file hashtable
* @requires all files in specs exist * @requires all files in specs exist
* @requires all header specifications have a corresponding existing template * @requires all header specifications have a corresponding existing template
*) *)
let check_spec_discrepancies let check_spec_discrepancies
(specs: (string, string) Hashtbl.t) (specs: (string, string) Hashtbl.t)
(headers: (string, string) Hashtbl.t) : unit = (headers: (string, string) Hashtbl.t) : unit =
...@@ -433,18 +433,18 @@ let check_spec_discrepancies ...@@ -433,18 +433,18 @@ let check_spec_discrepancies
let hdr_file_spec = Hashtbl.find headers hdr_type in let hdr_file_spec = Hashtbl.find headers hdr_type in
(* Guaranteed to exists after check_declared_headers *) (* Guaranteed to exists after check_declared_headers *)
if not (eq_header file hdr_file_spec) then begin if not (eq_header file hdr_file_spec) then begin
discrepancies := (file, hdr_type) :: !discrepancies; discrepancies := (file, hdr_type) :: !discrepancies;
incr n; incr n;
end; end;
end end
) specs ; ) specs ;
if !n > 0 then begin if !n > 0 then begin
error ~exit_value:4 "@[<v 2>%a%d / %d files with bad headers@]@." error ~exit_value:4 "@[<v 2>%a%d / %d files with bad headers@]@."
(fun _ppf l -> (fun _ppf l ->
List.iter List.iter
(fun (file, hdr_type) -> (fun (file, hdr_type) ->
error_fmt "%s : header differs from spec %s@." error_fmt "%s : header differs from spec %s@."
file hdr_type file hdr_type
) l) !discrepancies ) l) !discrepancies
!n !n
(Hashtbl.length specs) ; (Hashtbl.length specs) ;
...@@ -473,8 +473,8 @@ let check_forbidden_headers (forbidden_headers:StringSet.t) header_specification ...@@ -473,8 +473,8 @@ let check_forbidden_headers (forbidden_headers:StringSet.t) header_specification
error_fmt "%s : forbidden header %s@." error_fmt "%s : forbidden header %s@."
file hdr_type file hdr_type
) l) !forbidden ) l) !forbidden
!n !n
(StringSet.cardinal distributed_files); (StringSet.cardinal distributed_files);
job_done () job_done ()
end end
...@@ -543,7 +543,7 @@ let check files_ignored header_specifications distributed_files exceptions = ...@@ -543,7 +543,7 @@ let check files_ignored header_specifications distributed_files exceptions =
* *
* @param header_specifications file -> license header name hashtable * @param header_specifications file -> license header name hashtable
* @requires: files and licenses appearing in [header_specifications] exists * @requires: files and licenses appearing in [header_specifications] exists
*) *)
let update_headers header_specifications = let update_headers header_specifications =
let headers = get_header_files () in let headers = get_header_files () in
check_declared_headers header_specifications headers; check_declared_headers header_specifications headers;
...@@ -640,7 +640,7 @@ let rec argspec = [ ...@@ -640,7 +640,7 @@ let rec argspec = [
| "3-lines" -> spec_format := Line3 | "3-lines" -> spec_format := Line3
| "3-zeros" -> spec_format := Zero3 | "3-zeros" -> spec_format := Zero3
| s -> Format.printf "invalid spec format: %s@." s ; print_usage ()), | s -> Format.printf "invalid spec format: %s@." s ; print_usage ()),
"<format>\t \"2-fields-by-line\"|\"3-fields-by-line\"|\"3-lines\"|\"3-zeros\""; "<format>\t \"2-fields-by-line\"|\"3-fields-by-line\"|\"3-lines\"|\"3-zeros\"";
"-z", Arg.Set zero_stdin, "-z", Arg.Set zero_stdin,
" force to use the spec format \"3-zeros\" when reading from stdin"; " force to use the spec format \"3-zeros\" when reading from stdin";
] ]
...@@ -693,6 +693,6 @@ let _ = ...@@ -693,6 +693,6 @@ let _ =
if !exit_on_warning && not !has_no_warning_nor_error then if !exit_on_warning && not !has_no_warning_nor_error then
exit 8 ; exit 8 ;
(* Local Variables: *) (* Local Variables: *)
(* compile-command: "ocamlc -o hdrck unix.cma str.cma hdrck.ml" *) (* compile-command: "ocamlc -o hdrck unix.cma str.cma hdrck.ml" *)
(* End: *) (* End: *)
...@@ -25,11 +25,11 @@ ...@@ -25,11 +25,11 @@
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
module Self = Plugin.Register module Self = Plugin.Register
(struct (struct
let name = "Server TypeScript API" let name = "Server TypeScript API"
let shortname = "server-tsc" let shortname = "server-tsc"
let help = "Generate TypeScript API for Server" let help = "Generate TypeScript API for Server"
end) end)
module TSC = Self.Action module TSC = Self.Action
(struct (struct
...@@ -353,7 +353,7 @@ let makeDeclaration fmt names d = ...@@ -353,7 +353,7 @@ let makeDeclaration fmt names d =
(Pretty_utils.pp_list (Pretty_utils.pp_list
~empty:"[]" ~pre:"@[<hov 2>[ " ~sep:",@ " ~suf:"@ ]@]" ~empty:"[]" ~pre:"@[<hov 2>[ " ~sep:",@ " ~suf:"@ ]@]"
(fun fmt s -> Format.fprintf fmt "{ name: '%s' }" s)) (fun fmt s -> Format.fprintf fmt "{ name: '%s' }" s))
rq.rq_signals; rq.rq_signals;
Format.fprintf fmt "};@\n" ; Format.fprintf fmt "};@\n" ;
makeDescr fmt d.d_descr ; makeDescr fmt d.d_descr ;
Format.fprintf fmt Format.fprintf fmt
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment