Permalink
Browse files

Enabled more warnings and fixed a lot of it.

  • Loading branch information...
sagotch committed Jun 4, 2018
1 parent 94c6b62 commit b14b5c88b294b8eaa480baf14a923aa5755ac193
Showing with 2,201 additions and 3,342 deletions.
  1. +1 −0 Makefile
  2. +5 −0 contrib/dune
  3. +24 −26 dag2html/dag2html.ml
  4. +3 −3 dag2html/main.ml
  5. +1 −1 dune
  6. +97 −94 ged2gwb/ged2gwb.camlp5
  7. +96 −332 ged2gwb/ged2gwb2.camlp5
  8. +1 −0 gui/dune
  9. +54 −56 gwtp/gwtp.ml
  10. +8 −15 gwtp/iolight.ml
  11. +2 −2 lib/argl.ml
  12. +4 −4 lib/btree.ml
  13. +1 −1 lib/buff.ml
  14. +11 −11 lib/calendar.ml
  15. +6 −6 lib/check.ml
  16. +73 −156 lib/checkItem.ml
  17. +2 −4 lib/checkItem.mli
  18. +1 −1 lib/consang.ml
  19. +1 −29 lib/database.ml
  20. +15 −26 lib/date.ml
  21. +3 −2 lib/db2disk.ml
  22. +72 −176 lib/db2link.ml
  23. +13 −2 lib/db2out.ml
  24. +1 −5 lib/gutil.ml
  25. +81 −121 lib/gwcomp.ml
  26. +122 −127 lib/gwdb.ml
  27. +21 −23 lib/gwuLib.ml
  28. +10 −10 lib/history.ml
  29. +21 −23 lib/history_diff.ml
  30. +0 −2 lib/hutil.ml
  31. +8 −30 lib/mutil.ml
  32. +0 −3 lib/mutil.mli
  33. +3 −3 lib/name.ml
  34. +4 −4 lib/notes.ml
  35. +0 −8 lib/notesLinks.ml
  36. +2 −4 lib/outbase.ml
  37. +1 −3 lib/progrBar.ml
  38. +2 −2 lib/robot.ml
  39. +1 −1 lib/secure.ml
  40. +6 −8 lib/select.ml
  41. +7 −24 lib/srcfile.ml
  42. +24 −28 lib/templ.camlp5
  43. +2 −2 lib/templDate.ml
  44. +19 −29 lib/update.camlp5
  45. +33 −49 lib/util.ml
  46. +3 −3 lib/util.mli
  47. +2 −2 lib/wiki.ml
  48. +4 −4 lib/wiznotes.ml
  49. +8 −10 setup/setup.camlp5
  50. +4 −9 src/advSearchOk.ml
  51. +5 −5 src/alln.ml
  52. +62 −81 src/api.ml
  53. +26 −33 src/api_graph.ml
  54. +12 −12 src/api_link.ml
  55. +2 −2 src/api_saisie_autocomplete.ml
  56. +261 −302 src/api_saisie_read.ml
  57. +36 −58 src/api_saisie_write.ml
  58. +32 −67 src/api_search.ml
  59. +42 −119 src/api_stats.ml
  60. +9 −11 src/api_update_family.ml
  61. +10 −13 src/api_update_person.ml
  62. +19 −25 src/api_update_util.ml
  63. +79 −139 src/api_util.ml
  64. +38 −45 src/api_warnings.ml
  65. +4 −4 src/api_wiki.ml
  66. +9 −11 src/birthDeath.ml
  67. +6 −6 src/birthday.ml
  68. +6 −6 src/changeChildren.ml
  69. +1 −1 src/check_base.ml
  70. +2 −4 src/cousins.ml
  71. +30 −32 src/dag.ml
  72. +2 −4 src/dag.mli
  73. +21 −21 src/db1link.ml
  74. +14 −17 src/descend.ml
  75. +20 −20 src/forum.ml
  76. +1 −1 src/gwc2.ml
  77. +31 −34 src/gwd.ml
  78. +7 −7 src/image.ml
  79. +1 −1 src/image.mli
  80. +1 −1 src/link.ml
  81. +4 −4 src/merge.ml
  82. +1 −1 src/merge.mli
  83. +3 −3 src/mergeDup.ml
  84. +1 −1 src/mergeFam.ml
  85. +7 −10 src/mergeFamOk.ml
  86. +30 −33 src/mergeInd.ml
  87. +14 −19 src/mergeIndOk.ml
  88. +5 −5 src/mk_consang.ml
  89. +155 −257 src/perso.ml
  90. +8 −8 src/perso.mli
  91. +2 −6 src/perso_link.ml
  92. +2 −2 src/place.ml
  93. +30 −29 src/relation.ml
  94. +8 −24 src/relationLink.ml
  95. +20 −50 src/request.ml
  96. +9 −32 src/searchName.ml
  97. +41 −45 src/some.ml
  98. +1 −1 src/title.ml
  99. +24 −24 src/updateData.ml
  100. +28 −38 src/updateFam.ml
  101. +1 −3 src/updateFam.mli
  102. +78 −114 src/updateFamOk.ml
  103. +23 −23 src/updateInd.ml
  104. +18 −25 src/updateIndOk.ml
  105. +4 −4 src/updateIndOk.mli
  106. +12 −15 wserver/wserver.ml
View
@@ -116,6 +116,7 @@ $(CAMLP5_Q_MLAST_FILES:=.ml): CAMLP5_OPT += q_MLast.cmo
&& echo "(* DO NOT EDIT *)" > $@ \
&& echo "(* This file was generated from $< *)" >> $@ \
&& camlp5o pr_o.cmo $(CAMLP5_OPT) -impl $< >> $@ \
&& sed -i -r 's/[(]\* (\[@.+\]) \*[)]/\1/g' $@ \
&& echo " Done!")
%.bc %.exe:
View
@@ -0,0 +1,5 @@
(env
(dev
(flags (-w -a+31))
)
)
View
@@ -18,9 +18,7 @@ and span_id
and ghost_id
external span_id_of_int : int -> span_id = "%identity"
external int_of_span_id : span_id -> int = "%identity"
external ghost_id_of_int : int -> ghost_id = "%identity"
external int_of_ghost_id : ghost_id -> int = "%identity"
let new_span_id = let i = ref 0 in fun () -> incr i; span_id_of_int !i
@@ -311,7 +309,7 @@ let ancestors d =
loop 0
let get_children d parents =
let rec merge_children children el =
let merge_children children el =
List.fold_right
(fun (x, _) children ->
match x with
@@ -329,20 +327,20 @@ let get_children d parents =
let rec get_block t i j =
if j = Array.length t.table.(i) then None
else if j = Array.length t.table.(i) - 1 then
let x = t.table.(i).(j) in Some ([x.elem, 1], 1, x.span)
let x = t.table.(i).(j) in Some ([x.elem, 1], 1)
else
let x = t.table.(i).(j) in
let y = t.table.(i).(j+1) in
if y.span = x.span then
match get_block t i (j + 1) with
Some ((x1, c1) :: list, mpc, span) ->
Some ((x1, c1) :: list, mpc) ->
let (list, mpc) =
if x1 = x.elem then (x1, c1 + 1) :: list, max mpc (c1 + 1)
else (x.elem, 1) :: (x1, c1) :: list, max mpc c1
in
Some (list, mpc, span)
Some (list, mpc)
| _ -> assert false
else Some ([x.elem, 1], 1, x.span)
else Some ([x.elem, 1], 1)
let group_by_common_children d list =
let module O = struct type t = idag let compare = compare end in
@@ -409,7 +407,7 @@ let treat_new_row d t =
let i = Array.length t.table - 1 in
let rec loop t i j =
match get_block t i j with
Some (parents, max_parent_colspan, span) ->
Some (parents, max_parent_colspan) ->
let children = get_children d parents in
let children =
if children = [] then [{elem = Nothing; span = new_span_id ()}]
@@ -488,7 +486,7 @@ let treat_new_row d t =
in
loop t i 0
let down_it t i k y =
let down_it t i k =
t.table.(Array.length t.table - 1).(k) <- t.table.(i).(k);
for r = i to Array.length t.table - 2 do
t.table.(r).(k) <- {elem = Ghost (new_ghost_id ()); span = new_span_id ()}
@@ -518,7 +516,7 @@ let equilibrate t =
if k = len then loop1 (i + 1)
else
match t.table.(i).(k).elem with
Elem y when x = y -> down_it t i k y; loop 0
Elem y when x = y -> down_it t i k; loop 0
| _ -> loop2 (k + 1)
in
loop2 0
@@ -739,7 +737,7 @@ let find_block_with_parents t i jj1 jj2 jj3 jj4 =
in
loop i jj1 jj2 jj3 jj4
let push_to_right d t i j1 j2 =
let push_to_right t i j1 j2 =
let line = t.(i) in
let rec loop j =
if j = j2 then j - 1
@@ -780,7 +778,7 @@ let push_to_right d t i j1 j2 =
in
loop (j1 + 1)
let push_to_left d t i j1 j2 =
let push_to_left t i j1 j2 =
let line = t.(i) in
let rec loop j =
if j = j1 then j + 1
@@ -821,7 +819,7 @@ let push_to_left d t i j1 j2 =
in
loop (j2 - 1)
let fill_gap d t i j1 j2 =
let fill_gap t i j1 j2 =
let t1 =
let t1 = Array.copy t.table in
for i = 0 to Array.length t.table - 1 do
@@ -832,8 +830,8 @@ let fill_gap d t i j1 j2 =
done;
t1
in
let j2 = push_to_left d t1 i j1 j2 in
let j1 = push_to_right d t1 i j1 j2 in
let j2 = push_to_left t1 i j1 j2 in
let j1 = push_to_right t1 i j1 j2 in
if j1 = j2 - 1 then
let line = t1.(i-1) in
let x = line.(j1).span in
@@ -850,7 +848,7 @@ let fill_gap d t i j1 j2 =
loop y j2; Some ({table = t1}, true)
else None
let treat_gaps d t =
let treat_gaps t =
let i = Array.length t.table - 1 in
let rec loop t j =
let line = t.table.(i) in
@@ -863,7 +861,7 @@ let treat_gaps d t =
let rec loop1 t j1 =
if j1 < 0 then loop t (j + 1)
else if y = line.(j1).elem then
match fill_gap d t i j1 j with
match fill_gap t i j1 j with
Some (t, ok) -> if ok then loop t 2 else loop t (j + 1)
| None -> loop t (j + 1)
else loop1 t (j1 - 1)
@@ -917,14 +915,14 @@ let tablify phony no_optim no_group d =
let _ = group_ghost t in
let _ = group_children t in
let _ = group_span_by_common_children d t in
let t = if no_optim then t else treat_gaps d t in
let t = if no_optim then t else treat_gaps t in
let _ = group_span_last_row t in t
in
loop t
in
loop t
let fall d t =
let fall t =
for i = 1 to Array.length t.table - 1 do
let line = t.table.(i) in
let rec loop j =
@@ -990,7 +988,7 @@ let fall d t =
loop 0
done
let fall2_cool_right t i1 i2 i3 j1 j2 =
let fall2_cool_right t i1 i2 j1 j2 =
let span = t.table.(i2-1).(j1).span in
for i = i2 - 1 downto 0 do
for j = j1 to j2 - 1 do
@@ -1014,7 +1012,7 @@ let fall2_cool_right t i1 i2 i3 j1 j2 =
in
loop j1
let fall2_cool_left t i1 i2 i3 j1 j2 =
let fall2_cool_left t i1 i2 j1 j2 =
let span = t.table.(i2-1).(j2).span in
for i = i2 - 1 downto 0 do
for j = j1 + 1 to j2 do
@@ -1062,15 +1060,15 @@ let do_fall2_right t i1 i2 j1 j2 =
else
let new_line =
Array.init (Array.length t.table.(0))
(fun i -> {elem = Nothing; span = new_span_id ()})
(fun _ -> {elem = Nothing; span = new_span_id ()})
in
let t = {table = Array.append t.table [| new_line |]} in
loop (cnt - 1) t
in
loop (new_height - Array.length t.table) t
else t
in
fall2_cool_right t i1 i2 i3 j1 j2; t
fall2_cool_right t i1 i2 j1 j2; t
let do_fall2_left t i1 i2 j1 j2 =
let i3 =
@@ -1096,15 +1094,15 @@ let do_fall2_left t i1 i2 j1 j2 =
else
let new_line =
Array.init (Array.length t.table.(0))
(fun i -> {elem = Nothing; span = new_span_id ()})
(fun _ -> {elem = Nothing; span = new_span_id ()})
in
let t = {table = Array.append t.table [| new_line |]} in
loop (cnt - 1) t
in
loop (new_height - Array.length t.table) t
else t
in
fall2_cool_left t i1 i2 i3 j1 j2; t
fall2_cool_left t i1 i2 j1 j2; t
let do_shorten_too_long t i1 j1 j2 =
for i = i1 to Array.length t.table - 2 do
@@ -1398,7 +1396,7 @@ let table_of_dag phony no_optim invert no_group d =
let d = if invert then invert_dag d else d in
let t = tablify phony no_optim no_group d in
let t = if invert then invert_table t else t in
let _ = fall () t in
let _ = fall t in
let t = fall2_right t in
let t = fall2_left t in
let t = shorten_too_long t in
View
@@ -126,7 +126,7 @@ let map_dag f d =
let tag_dag d =
let c = ref 'A' in
map_dag
(fun v ->
(fun _ ->
let v = !c in
c :=
if !c = 'Z' then 'a'
@@ -139,13 +139,13 @@ let tag_dag d =
let phony _ = false
let indi_txt n = n.valu
let vbar_txt n = ""
let vbar_txt _ = ""
let print_char_table d t =
let print_elem =
function
Elem e -> Printf.eprintf " %s" d.dag.(int_of_idag e).valu
| Ghost x -> Printf.eprintf " |"
| Ghost _ -> Printf.eprintf " |"
| Nothing -> Printf.eprintf " "
in
let print_span i j r =
View
2 dune
@@ -1,5 +1,5 @@
(env
(dev
(flags (:standard -w +a-4-6-9-27-32-33-35-37-38-39-41-44-48))
(flags (:standard -w +a-4-9-35-44-48))
)
)
Oops, something went wrong.

0 comments on commit b14b5c8

Please sign in to comment.