diff --git a/sw/ground_segment/cockpit/horizon.ml b/sw/ground_segment/cockpit/horizon.ml index 93abda1441..820c268523 100644 --- a/sw/ground_segment/cockpit/horizon.ml +++ b/sw/ground_segment/cockpit/horizon.ml @@ -39,7 +39,7 @@ let arc = fun n r start stop -> let floats_of_points = fun ps -> let n = Array.length ps in - let a = Array.create (2*n) 0. in + let a = Array.make (2*n) 0. in for i = 0 to n - 1 do let (x, y) = ps.(i) in a.(2*i)<-x; @@ -56,7 +56,7 @@ let ruler = fun ?(index_on_right=false) ~text_props ~max ~scale ~w ~index_width let props = (text_props@[`ANCHOR `EAST]) in (* One step drawer *) - let tab = Array.create (max/step) false in + let tab = Array.make (max/step) false in let draw = fun i -> let i = i * step in let y = -. scale *. float i in diff --git a/sw/ground_segment/cockpit/live.ml b/sw/ground_segment/cockpit/live.ml index 342e8bec0a..f006983536 100644 --- a/sw/ground_segment/cockpit/live.ml +++ b/sw/ground_segment/cockpit/live.ml @@ -1339,7 +1339,7 @@ let get_svsinfo = fun alarm _sender vs -> and flagss = Str.split list_separator (Pprz.string_assoc "flags" vs) and ages = Str.split list_separator (Pprz.string_assoc "msg_age" vs) in - let a = Array.create (List.length svids) (0,0,0,0) in + let a = Array.make (List.length svids) (0,0,0,0) in let rec loop = fun i s c f ages -> match (s, c, f, ages) with [], [], [], [] -> () diff --git a/sw/ground_segment/cockpit/strip.ml b/sw/ground_segment/cockpit/strip.ml index 59a4544653..6311d2e8aa 100644 --- a/sw/ground_segment/cockpit/strip.ml +++ b/sw/ground_segment/cockpit/strip.ml @@ -105,7 +105,7 @@ end class vgauge = fun ?(color="#00ff00") ?(history_len=50) gauge_da v_min v_max -> object (self) inherit gauge gauge_da - val history = Array.create history_len 0 + val history = Array.make history_len 0 val mutable history_index = -1 method set = fun ?arrow ?(background="orange") value strings -> let {Gtk.width=width; height=height} = gauge_da#misc#allocation in diff --git a/sw/ground_segment/tmtc/aircraft.ml b/sw/ground_segment/tmtc/aircraft.ml index 00744a023e..0734e68392 100644 --- a/sw/ground_segment/tmtc/aircraft.ml +++ b/sw/ground_segment/tmtc/aircraft.ml @@ -217,7 +217,7 @@ let new_aircraft = fun id name fp airframe -> cam = { phi = 0.; theta = 0. ; target=(0.,0.)}; fbw = { rc_status = "???"; rc_mode = "???"; rc_rate=0; pprz_mode_msgs_since_last_fbw_status_msg=0 }; svinfo = svsinfo_init; - dl_setting_values = Array.create max_nb_dl_setting_values None; + dl_setting_values = Array.make max_nb_dl_setting_values None; nb_dl_setting_values = 0; horiz_mode = UnknownHorizMode; horizontal_mode = 0; diff --git a/sw/ground_segment/tmtc/link.ml b/sw/ground_segment/tmtc/link.ml index 4f5c14137e..6ba08733e4 100644 --- a/sw/ground_segment/tmtc/link.ml +++ b/sw/ground_segment/tmtc/link.ml @@ -244,7 +244,7 @@ module XB = struct (** XBee module *) false)) (* Array of sent packets for retry: (packet, nb of retries) *) - let packets = Array.create 256 ("", -1) + let packets = Array.make 256 ("", -1) (* Frame id generation > 0 and < 256 *) let gen_frame_id = diff --git a/sw/ground_segment/tmtc/wind.ml b/sw/ground_segment/tmtc/wind.ml index 924a55f0ca..f657d82e10 100644 --- a/sw/ground_segment/tmtc/wind.ml +++ b/sw/ground_segment/tmtc/wind.ml @@ -192,7 +192,7 @@ type wind_ac = { let h = Hashtbl.create 17 let create_wind_ac max_nb_sample = - {speeds = Array.create max_nb_sample None ; wind_init = null_vector; index = 0; length = 0} + {speeds = Array.make max_nb_sample None ; wind_init = null_vector; index = 0; length = 0} let new_ac = fun id max_nb_sample -> Hashtbl.add h id (create_wind_ac max_nb_sample) diff --git a/sw/lib/ocaml/geometry_2d.ml b/sw/lib/ocaml/geometry_2d.ml index 3ae3e65fa1..36df57e636 100644 --- a/sw/lib/ocaml/geometry_2d.ml +++ b/sw/lib/ocaml/geometry_2d.ml @@ -727,7 +727,7 @@ let in_tesselation_fans l = add_val p1; add_val p2; add_val p3) l ; let lst = List.fast_sort (fun (_, n1) (_, n2) -> n2-n1) (Array.to_list tt) in - let tt2 = Array.create (Array.length tt) (0, []) in + let tt2 = Array.make (Array.length tt) (0, []) in let i = ref 0 in List.iter (fun (x, _) -> tt2.(x) <- (!i, []); incr i) lst ; List.iter (fun (p1, p2, p3) -> diff --git a/sw/lib/ocaml/mapCanvas.ml b/sw/lib/ocaml/mapCanvas.ml index 1fd9eb3c30..2dfadbd775 100644 --- a/sw/lib/ocaml/mapCanvas.ml +++ b/sw/lib/ocaml/mapCanvas.ml @@ -733,8 +733,8 @@ class widget = fun ?(height=800) ?(srtm=false) ?width ?projection ?georef () -> LL.utm_zone = u0.LL.utm_zone; LL.utm_y = align u0.LL.utm_y 1000 } in for i = -size_utm_grid to size_utm_grid do - let h = Array.create (2*(2*size_utm_grid+1)) 0. - and v = Array.create (2*(2*size_utm_grid+1)) 0. in + let h = Array.make (2*(2*size_utm_grid+1)) 0. + and v = Array.make (2*(2*size_utm_grid+1)) 0. in for j = -size_utm_grid to size_utm_grid do let k = 2*(j+size_utm_grid) in let p = fun i j -> diff --git a/sw/lib/ocaml/mapFP.ml b/sw/lib/ocaml/mapFP.ml index cc296313a9..633bec71ef 100644 --- a/sw/lib/ocaml/mapFP.ml +++ b/sw/lib/ocaml/mapFP.ml @@ -236,11 +236,11 @@ class flight_plan = fun ?format_attribs ?editable ~show_moved geomap color fp_dt (** The graphical waypoints *) let wpts_group = new MapWaypoints.group ~show_moved ~color ?editable geomap in - let array_of_waypoints = ref (Array.create 13 None) in + let array_of_waypoints = ref (Array.make 13 None) in let add_wp_to_array = fun index w -> let n = Array.length !array_of_waypoints in if index >= n then begin - let new_array = Array.create (n*2) None in + let new_array = Array.make (n*2) None in Array.blit !array_of_waypoints 0 new_array 0 n; array_of_waypoints := new_array end; diff --git a/sw/lib/ocaml/mapGoogle.ml b/sw/lib/ocaml/mapGoogle.ml index c48c6b09c7..779241af58 100644 --- a/sw/lib/ocaml/mapGoogle.ml +++ b/sw/lib/ocaml/mapGoogle.ml @@ -34,7 +34,7 @@ type tiles_tree = Empty | Tile | Node of tiles_tree array -let gm_tiles = Node (Array.create 4 Empty) +let gm_tiles = Node (Array.make 4 Empty) (** Google Maps paths in the quadtree are coded with q,r,s and t*) let index_of = function @@ -61,7 +61,7 @@ let add_tile = fun tile_key -> if i < String.length tile_key then match tree.(j) with Empty -> - let sons = Array.create 4 Empty in + let sons = Array.make 4 Empty in tree.(j) <- Node sons; loop (i+1) sons (index_of tile_key.[i]) | Tile -> () (* Already there *) @@ -142,7 +142,7 @@ let fill_window = fun (geomap:MapCanvas.widget) zoomlevel -> display_the_tile geomap tile image level; raise (New_displayed (zoomlevel+1-String.length tile.Gm.key)) else begin - trees.(i) <- Node (Array.create 4 Empty); + trees.(i) <- Node (Array.make 4 Empty); loop twest tsouth tsize trees i zoom key end | Node sons -> diff --git a/sw/lib/ocaml/mapTrack.ml b/sw/lib/ocaml/mapTrack.ml index e4f8529669..47e2b680fe 100644 --- a/sw/lib/ocaml/mapTrack.ml +++ b/sw/lib/ocaml/mapTrack.ml @@ -107,10 +107,10 @@ class track = fun ?(name="Noname") ?(icon="fixedwing") ?(size = 500) ?(color="re object (self) val mutable top = 0 val mutable color = color - val mutable segments = Array.create size empty - val mutable v_segments = Array.create size empty + val mutable segments = Array.make size empty + val mutable v_segments = Array.make size empty val mutable v_top = 0 - val mutable v_path = Array.create 10 v_empty + val mutable v_path = Array.make 10 v_empty val mutable last = None val mutable last_heading = 0.0 val mutable last_altitude = 0.0 @@ -319,7 +319,7 @@ object (self) aircraft#affine_absolute a method resize = fun new_size -> - let a = Array.create new_size empty in + let a = Array.make new_size empty in let size = Array.length segments in let m = min new_size size in let j = ref ((top - m + size) mod size) in diff --git a/sw/lib/ocaml/ocaml_tools.ml b/sw/lib/ocaml/ocaml_tools.ml index 43579b9921..83354d2486 100644 --- a/sw/lib/ocaml/ocaml_tools.ml +++ b/sw/lib/ocaml/ocaml_tools.ml @@ -85,7 +85,7 @@ let make_1st_order_noise_generator = fun ?(init = 0.) k sigma -> !x let shifter = fun n default -> - let a = Array.create n default + let a = Array.make n default and i = ref 0 in fun new_value -> let old_value = a.(!i) in diff --git a/sw/lib/ocaml/wind_sock.ml b/sw/lib/ocaml/wind_sock.ml index a6fe03f561..1c2732f1af 100644 --- a/sw/lib/ocaml/wind_sock.ml +++ b/sw/lib/ocaml/wind_sock.ml @@ -24,7 +24,7 @@ let flatten = fun s a -> let n = Array.length a in - let b = Array.create (2*n) 0. in + let b = Array.make (2*n) 0. in for i = 0 to n - 1 do let (x, y) = a.(i) in b.(2*i) <- float x *. s; diff --git a/sw/logalizer/plotter.ml b/sw/logalizer/plotter.ml index cd300be432..a49ada0b12 100644 --- a/sw/logalizer/plotter.ml +++ b/sw/logalizer/plotter.ml @@ -69,7 +69,7 @@ type values = { } let create_values = fun size color -> - { array = Array.create size None; index = 0; color = color; + { array = Array.make size None; index = 0; color = color; average = GData.adjustment ~value:0. (); discrete = false; stdev = GData.adjustment ~value:0. ()} @@ -135,7 +135,7 @@ class plot = fun ~size ~update_time ~width ~height ~packing () -> method set_size = fun new_size -> if new_size <> size && new_size > 0 then begin Hashtbl.iter (fun _ a -> - let new_array = Array.create new_size None in + let new_array = Array.make new_size None in for i = 0 to Pervasives.min size new_size - 1 do new_array.(new_size - 1 - i) <- a.array.((a.index-i+size) mod size) done; diff --git a/sw/simulator/sim.ml b/sw/simulator/sim.ml index 2391ac8a46..623e8f7608 100644 --- a/sw/simulator/sim.ml +++ b/sw/simulator/sim.ml @@ -140,7 +140,7 @@ module Make(AircraftItl : AIRCRAFT_ITL) = struct let _reset = fun () -> state := initial_state in - let commands = Array.create FM.nb_commands 0 in + let commands = Array.make FM.nb_commands 0 in Aircraft.commands commands; diff --git a/sw/tools/generators/gen_abi.ml b/sw/tools/generators/gen_abi.ml index a456a6d62e..1c39a222b3 100644 --- a/sw/tools/generators/gen_abi.ml +++ b/sw/tools/generators/gen_abi.ml @@ -52,7 +52,7 @@ module Syntax = struct { id = id; name = name; fields = fields } let check_single_ids = fun msgs -> - let tab = Array.create 256 false (* TODO remove limitation to 256 msg not needed here *) + let tab = Array.make 256 false (* TODO remove limitation to 256 msg not needed here *) and last_id = ref 0 in List.iter (fun msg -> if tab.(msg.id) then diff --git a/sw/tools/generators/gen_messages.ml b/sw/tools/generators/gen_messages.ml index 7b75fc6597..aeb223f633 100644 --- a/sw/tools/generators/gen_messages.ml +++ b/sw/tools/generators/gen_messages.ml @@ -116,7 +116,7 @@ module Syntax = struct { id=id; name = name; period = period; fields = fields } let check_single_ids = fun msgs -> - let tab = Array.create 256 false + let tab = Array.make 256 false and last_id = ref 0 in List.iter (fun msg -> if tab.(msg.id) then diff --git a/sw/tools/generators/gen_messages2.ml b/sw/tools/generators/gen_messages2.ml index aaa40ab6ed..5b58e0da8c 100644 --- a/sw/tools/generators/gen_messages2.ml +++ b/sw/tools/generators/gen_messages2.ml @@ -108,7 +108,7 @@ module Syntax = struct { id=id; name = name; period = period; fields = fields } let check_single_ids = fun msgs -> - let tab = Array.create 256 false + let tab = Array.make 256 false and last_id = ref 0 in List.iter (fun msg -> if tab.(msg.id) then