Permalink
Browse files

Remove 'open Printf'

  • Loading branch information...
sagotch committed Sep 7, 2018
1 parent 501e066 commit eacd6e8af5bca7f011ea9a856e505b34fc4d0aa7
Showing with 1,102 additions and 1,161 deletions.
  1. +2 −3 contrib/gwFix/gwFindCpl.ml
  2. +25 −26 contrib/gwFix/gwFixBase.ml
  3. +2 −3 contrib/gwFix/gwFixBurial.ml
  4. +4 −5 contrib/gwFix/gwFixColon.ml
  5. +3 −4 contrib/gwFix/gwFixEvtSrc.ml
  6. +9 −10 contrib/gwFix/gwFixFromFile.ml
  7. +6 −7 contrib/gwFix/gwFixFromFileAlias.ml
  8. +6 −7 contrib/gwFix/gwFixFromFileDomicile.ml
  9. +5 −6 contrib/gwFix/gwFixY.ml
  10. +3 −4 contrib/gwbase/etc/chkimg.ml
  11. +1 −2 contrib/gwbase/etc/consmoy.ml
  12. +21 −22 contrib/gwbase/etc/gwck.ml
  13. +1 −2 contrib/gwbase/etc/hist.ml
  14. +13 −14 contrib/gwbase/etc/lune.ml
  15. +5 −6 contrib/gwbase/etc/modif.ml
  16. +5 −6 contrib/gwbase/etc/nbdesc.ml
  17. +2 −3 contrib/gwbase/etc/popule.ml
  18. +13 −14 contrib/gwbase/etc/probot.ml
  19. +2 −3 contrib/gwbase/etc/public.ml
  20. +9 −10 contrib/gwbase/etc/public2.ml
  21. +1 −2 contrib/gwbase/etc/titres.ml
  22. +0 −1 contrib/gwpublic/gwiftitles.ml
  23. +3 −4 contrib/gwpublic/gwpublic1.ml
  24. +11 −12 contrib/gwpublic/gwpublic2.ml
  25. +0 −1 contrib/oneshot/gwExportAscCSV.ml2
  26. +4 −5 contrib/oneshot/gwFixAddEvent.ml
  27. +2 −3 contrib/oneshot/gwRemoveImgGallery.ml
  28. +20 −21 dag2html/main.ml
  29. +50 −51 ged2gwb/ged2gwb.camlp5
  30. +22 −23 ged2gwb/ged2gwb2.camlp5
  31. +10 −11 gui/gui.ml
  32. +124 −125 gwb2ged/gwb2ged.ml
  33. +74 −75 gwtp/gwtp.ml
  34. +1 −2 gwtp/recover.ml
  35. +6 −7 internal/argl.ml
  36. +69 −70 internal/check.ml
  37. +8 −9 internal/date.ml
  38. +7 −8 internal/db2disk.ml
  39. +19 −20 internal/db2link.ml
  40. +3 −4 internal/gwdb.ml
  41. +270 −271 internal/gwuLib.ml
  42. +1 −2 internal/hutil.ml
  43. +13 −14 internal/robot.ml
  44. +23 −24 internal/templ.camlp5
  45. +3 −4 internal/templDate.ml
  46. +21 −22 internal/util.ml
  47. +12 −13 internal/wiki.ml
  48. +12 −13 lib/api_wiki.ml
  49. +9 −10 lib/dag.ml
  50. +24 −25 lib/db1link.ml
  51. +16 −17 lib/forum.ml
  52. +51 −52 lib/gwDaemon.ml
  53. +45 −46 setup/setup.camlp5
  54. +3 −4 src/check_base.ml
  55. +2 −3 src/fpla.ml
  56. +4 −5 src/gwc1.ml
  57. +4 −5 src/gwc2.ml
  58. +7 −8 src/lex_sort.sh
  59. +11 −12 src/mk_consang.ml
@@ -2,7 +2,6 @@
open Def
open Gwdb
open Printf
let designation base ip p =
@@ -47,7 +46,7 @@ let check bname =
(Array.to_list (get_parent_array fam))
in
if neg_cpl then do {
eprintf "%s\n" bname;
Printf.eprintf "%s\n" bname;
flush stderr;
}
else ()
@@ -71,7 +70,7 @@ let main () =
if !bname = "" then begin Arg.usage speclist usage; exit 2 end;
Lock.control (Mutil.lock_file !bname) false (fun () -> check !bname)
~onerror:(fun () ->
eprintf "Cannot lock database. Try again.\n";
Printf.eprintf "Cannot lock database. Try again.\n";
flush stderr)
let _ = main ()
View
@@ -2,7 +2,6 @@
open Def
open Gwdb
open Printf
let designation base ip p =
@@ -16,10 +15,10 @@ let designation base ip p =
let suspend_with msg = ProgrBar.suspend (); msg () ; flush stdout
let restart_with i n = printf "*** fixed\n"; flush stdout; ProgrBar.restart i n
let restart_with i n = Printf.printf "*** fixed\n"; flush stdout; ProgrBar.restart i n
let check_keys ~verbosity1 ~verbosity2 base nb_ind fix =
if verbosity1 then (printf "Check keys\n"; flush stdout);
if verbosity1 then (Printf.printf "Check keys\n"; flush stdout);
if verbosity1 then ProgrBar.start ();
for i = 0 to nb_ind - 1 do
if verbosity1 then ProgrBar.run i nb_ind;
@@ -40,7 +39,7 @@ let check_keys ~verbosity1 ~verbosity2 base nb_ind fix =
let msg =
if verbosity2
then Some (fun () ->
printf
Printf.printf
"*** key %s.%d %s is \"%s\"\n"
fn occ sn (designation base ip (poi base ip2)) )
else None
@@ -49,7 +48,7 @@ let check_keys ~verbosity1 ~verbosity2 base nb_ind fix =
| None ->
let msg =
if verbosity2
then Some (fun () -> printf "*** key %s.%d %s = no anwser\n" fn occ sn)
then Some (fun () -> Printf.printf "*** key %s.%d %s = no anwser\n" fn occ sn)
else None
in
patch ?msg base ip fn sn occ
@@ -59,7 +58,7 @@ let check_keys ~verbosity1 ~verbosity2 base nb_ind fix =
let check_families_parents ~verbosity1 base nb_fam =
if verbosity1 then begin
printf "Check families' parents\n";
Printf.printf "Check families' parents\n";
flush stdout;
ProgrBar.start () ;
for i = 0 to nb_fam - 1 do
@@ -73,7 +72,7 @@ let check_families_parents ~verbosity1 base nb_fam =
if not @@ Array.mem ifam (get_family (poi base ip)) then
begin
suspend_with (fun () ->
printf
Printf.printf
"*** no family for : %s\n"
(designation base ip (poi base ip)) ) ;
restart_with i nb_fam
@@ -85,7 +84,7 @@ let check_families_parents ~verbosity1 base nb_fam =
let check_families_children ~verbosity1 ~verbosity2 base nb_fam fix =
if verbosity1 then begin
printf "Check families' children\n";
Printf.printf "Check families' children\n";
flush stdout;
ProgrBar.start ()
end;
@@ -100,12 +99,12 @@ let check_families_children ~verbosity1 ~verbosity2 base nb_fam fix =
let a = poi base ip in
match get_parents a with
| Some ifam1 when ifam1 != ifam && verbosity1 ->
printf "*** bad parents : %s\n" (designation base ip (poi base ip));
Printf.printf "*** bad parents : %s\n" (designation base ip (poi base ip));
flush stdout
| None ->
if verbosity2 then begin
ProgrBar.suspend ();
printf "*** no parents : %s in family\n %s & %s\n"
Printf.printf "*** no parents : %s in family\n %s & %s\n"
(designation base ip (poi base ip))
(let ip = get_father fam in designation base ip (poi base ip))
(let ip = get_mother fam in designation base ip (poi base ip));
@@ -122,7 +121,7 @@ let check_families_children ~verbosity1 ~verbosity2 base nb_fam fix =
let check_persons_parents ~verbosity1 ~verbosity2 base nb_ind fix =
if verbosity1 then begin
printf "Check persons' parents\n";
Printf.printf "Check persons' parents\n";
flush stdout;
ProgrBar.start ()
end;
@@ -134,7 +133,7 @@ let check_persons_parents ~verbosity1 ~verbosity2 base nb_ind fix =
let fam = foi base ifam in
if is_deleted_family fam then begin
if verbosity2 then begin
printf
Printf.printf
"*** parent family deleted: %s\n"
(designation base ip (poi base ip)) ;
flush stdout
@@ -147,7 +146,7 @@ let check_persons_parents ~verbosity1 ~verbosity2 base nb_ind fix =
if not @@ Array.mem ip children then
begin
if verbosity2 then begin
printf "*** not in parent's family: %s\n"
Printf.printf "*** not in parent's family: %s\n"
(designation base ip (poi base ip));
flush stdout
end ;
@@ -159,7 +158,7 @@ let check_persons_parents ~verbosity1 ~verbosity2 base nb_ind fix =
let check_persons_families ~verbosity1 ~verbosity2 base nb_ind fix =
if verbosity1 then begin
printf "Check persons' families\n";
Printf.printf "Check persons' families\n";
flush stdout;
ProgrBar.start ()
end;
@@ -175,7 +174,7 @@ let check_persons_families ~verbosity1 ~verbosity2 base nb_ind fix =
begin
if verbosity2 then
suspend_with (fun () ->
printf "*** not father or mother of hir family: %s\n"
Printf.printf "*** not father or mother of hir family: %s\n"
(designation base ip (poi base ip)) );
let ifams =
Array.append (Array.sub ifams 0 j)
@@ -191,7 +190,7 @@ let check_persons_families ~verbosity1 ~verbosity2 base nb_ind fix =
let check_witnesses ~verbosity1 ~verbosity2 base nb_fam fix =
if verbosity1 then begin
printf "Check witnesses\n";
Printf.printf "Check witnesses\n";
flush stdout;
ProgrBar.start ()
end;
@@ -209,10 +208,10 @@ let check_witnesses ~verbosity1 ~verbosity2 base nb_fam fix =
if verbosity2 then
suspend_with (fun () ->
let imoth = get_mother fam in
printf "*** in marriage: %s & %s\n"
Printf.printf "*** in marriage: %s & %s\n"
(designation base ifath (poi base ifath))
(designation base ifath (poi base imoth));
printf "*** witness has no pointer to marriage: %s\n"
Printf.printf "*** witness has no pointer to marriage: %s\n"
(designation base ip p) ) ;
patch_person base ip
{(gen_person_of_person p) with related = ifath :: get_related p};
@@ -225,7 +224,7 @@ let check_witnesses ~verbosity1 ~verbosity2 base nb_fam fix =
let check_pevents_witnesses ~verbosity1 ~verbosity2 base nb_ind fix =
if verbosity1 then begin
printf "Check persons' events witnesses\n";
Printf.printf "Check persons' events witnesses\n";
flush stdout;
ProgrBar.start ()
end;
@@ -242,9 +241,9 @@ let check_pevents_witnesses ~verbosity1 ~verbosity2 base nb_ind fix =
if not (List.memq ip (get_related p2)) then
begin
if verbosity2 then suspend_with (fun () ->
printf "*** in persons' event: %s\n"
Printf.printf "*** in persons' event: %s\n"
(designation base ip2 (poi base ip2));
printf "*** witness has no pointer to persons' event: %s\n"
Printf.printf "*** witness has no pointer to persons' event: %s\n"
(designation base ip p) ) ;
patch_person base ip2
{(gen_person_of_person p2)
@@ -259,7 +258,7 @@ let check_pevents_witnesses ~verbosity1 ~verbosity2 base nb_ind fix =
let check_fevents_witnesses ~verbosity1 ~verbosity2 base nb_fam fix =
if verbosity1 then begin
printf "Check family events witnesses\n";
Printf.printf "Check family events witnesses\n";
flush stdout;
ProgrBar.start ()
end;
@@ -279,10 +278,10 @@ let check_fevents_witnesses ~verbosity1 ~verbosity2 base nb_fam fix =
if verbosity2 then
suspend_with (fun () ->
let imoth = get_mother fam in
printf "*** in family event: %s & %s\n"
Printf.printf "*** in family event: %s & %s\n"
(designation base ifath (poi base ifath))
(designation base ifath (poi base imoth));
printf "*** witness has no pointer to family event: %s\n"
Printf.printf "*** witness has no pointer to family event: %s\n"
(designation base ip p) ) ;
patch_person base ip
{(gen_person_of_person p)
@@ -328,12 +327,12 @@ let check
if !fix <> 0 then begin
Gwdb.commit_patches base ;
if verbosity1 then begin
printf "%n changes commited\n" !fix ;
Printf.printf "%n changes commited\n" !fix ;
flush stdout
end
end
else if verbosity1 then begin
printf "No change\n" ;
Printf.printf "No change\n" ;
flush stdout
end
@@ -2,7 +2,6 @@
open Def
open Gwdb
open Printf
let trace = ref false
@@ -22,7 +21,7 @@ let update_database_with_burial base =
begin
if !trace then
begin
eprintf "Modifiy person : %s\n" (Gutil.designation base p);
Printf.eprintf "Modifiy person : %s\n" (Gutil.designation base p);
flush stderr
end;
let evt =
@@ -42,7 +41,7 @@ let update_database_with_burial base =
if !changed then
begin
commit_patches base;
eprintf "Number of modified persons: %d\n" !nb_modified;
Printf.eprintf "Number of modified persons: %d\n" !nb_modified;
flush stderr
end
@@ -1,7 +1,6 @@
(* $Id: gw_fix_base.ml,v 0.01 2014-02-21 16:26:45 flh Exp $ *)
open Gwdb
open Printf
let designation base ip p =
@@ -14,7 +13,7 @@ let designation base ip p =
(first_name ^ "." ^ string_of_int (get_occ p) ^ " " ^ surname)
let check_name base nb_ind fix =
printf "Check colon\n";
Printf.printf "Check colon\n";
flush stdout;
for i = 0 to nb_ind - 1 do
let ip = Adef.iper_of_int i in
@@ -23,7 +22,7 @@ let check_name base nb_ind fix =
let sn = sou base (get_surname p) in
if String.contains fn ':' || String.contains sn ':' then
begin
printf "*** bad name : %s %s (%d) => %s\n" fn sn i
Printf.printf "*** bad name : %s %s (%d) => %s\n" fn sn i
(designation base ip (poi base ip));
flush stdout
end
@@ -36,7 +35,7 @@ let check bname =
let nb_ind = nb_of_persons base in
check_name base nb_ind fix;
if !fix then Gwdb.commit_patches base
else begin printf "No change\n"; flush stdout end
else begin Printf.printf "No change\n"; flush stdout end
(**/**)
@@ -52,7 +51,7 @@ let main () =
if !bname = "" then begin Arg.usage speclist usage; exit 2 end;
Lock.control (Mutil.lock_file !bname) false (fun () -> check !bname)
~onerror:(fun () ->
eprintf "Cannot lock database. Try again.\n";
Printf.eprintf "Cannot lock database. Try again.\n";
flush stderr)
let _ = main ()
@@ -2,7 +2,6 @@
open Def
open Gwdb
open Printf
let trace = ref false
@@ -89,7 +88,7 @@ let update_database_with_burial base =
begin
if !trace then
begin
eprintf "Modifiy person : %s\n" (Gutil.designation base p);
Printf.eprintf "Modifiy person : %s\n" (Gutil.designation base p);
flush stderr
end;
let pevents = get_pevents p @ pevents in
@@ -102,7 +101,7 @@ let update_database_with_burial base =
if !base_changed then
begin
commit_patches base;
eprintf "Number of modified persons: %d\n" !nb_modified;
Printf.eprintf "Number of modified persons: %d\n" !nb_modified;
flush stderr
end
@@ -120,7 +119,7 @@ let main () =
if !bname = "" then begin Arg.usage speclist usage; exit 2 end;
Lock.control (Mutil.lock_file !bname) false
~onerror:(fun () ->
eprintf "Cannot lock database. Try again.\n";
Printf.eprintf "Cannot lock database. Try again.\n";
flush stderr)
(fun () ->
let base = Gwdb.open_base !bname in update_database_with_burial base)
Oops, something went wrong.

0 comments on commit eacd6e8

Please sign in to comment.