mirror of https://github.com/swig/swig
[ocaml] Avoid non-unit-statement warnings in examples
Thanks to rwmjones for the tip as to how to solve this. See #2649
This commit is contained in:
parent
564979a4b5
commit
9fb24e78e0
|
@ -23,13 +23,13 @@ let v = new_DoubleVector '()
|
|||
let rec fill_dv v x =
|
||||
if x < 0.0001 then v else
|
||||
begin
|
||||
v -> push_back ((x to float)) ;
|
||||
ignore(v -> push_back ((x to float))) ;
|
||||
fill_dv v (x *. x)
|
||||
end
|
||||
let _ = fill_dv v 0.999
|
||||
let _ = print_DoubleVector v
|
||||
let u = new_IntVector '()
|
||||
let _ = for i = 1 to 4 do
|
||||
u -> push_back ((i to int))
|
||||
ignore(u -> push_back ((i to int)))
|
||||
done
|
||||
let _ = (print_float ((_average u) as float) ; print_newline ())
|
||||
|
|
|
@ -7,7 +7,7 @@ let v = new_StringVector '()
|
|||
|
||||
let _ =
|
||||
for i = 0 to (Array.length Sys.argv) - 1 do
|
||||
let str = (Sys.argv.(i)) to string in v -> push_back (str)
|
||||
let str = (Sys.argv.(i)) to string in ignore(v -> push_back (str))
|
||||
done
|
||||
|
||||
let _ = _vec_write '(v)
|
||||
|
|
Loading…
Reference in New Issue