From 5a7ed4fccd376f0c589d4086ee9c586981337387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20B=C3=BChler?= <david.buhler@cea.fr> Date: Thu, 29 Jun 2023 13:15:32 +0200 Subject: [PATCH] Applies generative functors to () instead of deprecated (struct end). Avoids warning 73 with OCaml 5.1. --- src/kernel_services/ast_queries/logic_env.ml | 2 +- src/kernel_services/cmdline_parameters/cmdline.ml | 4 ++-- src/kernel_services/plugin_entry_points/db.ml | 2 +- src/libraries/project/project.ml | 6 +++--- src/plugins/e-acsl/src/libraries/gmp_types.ml | 4 ++-- src/plugins/gui/gtk_helper.ml | 2 +- src/plugins/gui/launcher.ml | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/kernel_services/ast_queries/logic_env.ml b/src/kernel_services/ast_queries/logic_env.ml index 9ba7c2a34f2..cee9bf044d5 100644 --- a/src/kernel_services/ast_queries/logic_env.ml +++ b/src/kernel_services/ast_queries/logic_env.ml @@ -317,7 +317,7 @@ let builtin_states = [ Logic_builtin.self; Logic_type_builtin.self; Logic_ctor_builtin.self ] module Builtins= struct - include Hook.Make(struct end) + include Hook.Make() (* ensures we do not apply the hooks twice *) module Applied = State_builder.False_ref diff --git a/src/kernel_services/cmdline_parameters/cmdline.ml b/src/kernel_services/cmdline_parameters/cmdline.ml index 8e8917faa97..019989e9ef1 100644 --- a/src/kernel_services/cmdline_parameters/cmdline.ml +++ b/src/kernel_services/cmdline_parameters/cmdline.ml @@ -158,7 +158,7 @@ let protect = function (** {2 Exiting Frama-C} *) (* ************************************************************************* *) -module NormalExit = Hook.Make(struct end) +module NormalExit = Hook.Make() let at_normal_exit = NormalExit.extend let run_normal_exit_hook = NormalExit.apply @@ -617,7 +617,7 @@ struct let nb_actions = ref 0 let is_going_to_run () = incr nb_actions - module H = Hook.Make(struct end) + module H = Hook.Make() let () = H.extend Log.treat_deferred_error diff --git a/src/kernel_services/plugin_entry_points/db.ml b/src/kernel_services/plugin_entry_points/db.ml index 4266f7dd127..23617509775 100644 --- a/src/kernel_services/plugin_entry_points/db.ml +++ b/src/kernel_services/plugin_entry_points/db.ml @@ -37,7 +37,7 @@ let register_guarded_compute is_computed r f = r := compute module Main = struct - include Hook.Make(struct end) + include Hook.Make() let play = mk_fun "Main.play" end diff --git a/src/libraries/project/project.ml b/src/libraries/project/project.ml index c0acfdff894..c2be72957be 100644 --- a/src/libraries/project/project.ml +++ b/src/libraries/project/project.ml @@ -435,13 +435,13 @@ let clear_all () = exception IOError = Sys_error -module Before_load = Hook.Make(struct end) +module Before_load = Hook.Make() let register_before_load_hook = Before_load.extend -module After_load = Hook.Make(struct end) +module After_load = Hook.Make() let register_after_load_hook = After_load.extend -module After_global_load = Hook.Make(struct end) +module After_global_load = Hook.Make() let register_after_global_load_hook = After_global_load.extend let magic = 9 (* magic number *) diff --git a/src/plugins/e-acsl/src/libraries/gmp_types.ml b/src/plugins/e-acsl/src/libraries/gmp_types.ml index 9e23d23a5d4..965406bdc33 100644 --- a/src/plugins/e-acsl/src/libraries/gmp_types.ml +++ b/src/plugins/e-acsl/src/libraries/gmp_types.ml @@ -76,8 +76,8 @@ module Make() = struct end -module Z = Make(struct end) -module Q = Make(struct end) +module Z = Make() +module Q = Make() let bitcnt_type_info_ref = mk_dummy_type_info_ref () diff --git a/src/plugins/gui/gtk_helper.ml b/src/plugins/gui/gtk_helper.ml index 7ca273c4caa..20df4ae9601 100644 --- a/src/plugins/gui/gtk_helper.ml +++ b/src/plugins/gui/gtk_helper.ml @@ -287,7 +287,7 @@ module Lock = struct end module Unlock = struct let first = ref (fun () -> ()) - module H = Hook.Make(struct end) + module H = Hook.Make() let extend is_first f = if is_first then first := f else H.extend f let apply () = !first (); H.apply () end diff --git a/src/plugins/gui/launcher.ml b/src/plugins/gui/launcher.ml index 138bce2502e..e6d9dbf1fb4 100644 --- a/src/plugins/gui/launcher.ml +++ b/src/plugins/gui/launcher.ml @@ -22,7 +22,7 @@ open Gtk_helper -module Kernel_hook = Hook.Make(struct end) +module Kernel_hook = Hook.Make() class type basic_main = object inherit host -- GitLab