From e74ac27bf36cea743be6026011691b06a2c21f80 Mon Sep 17 00:00:00 2001
From: Michele Alberti <michele.alberti@cea.fr>
Date: Thu, 23 Apr 2020 17:19:49 +0200
Subject: [PATCH] Review the usage of mode.

---
 src/plugins/gui/gtk_helper.ml | 2 +-
 src/plugins/wp/ProverWhy3.ml  | 2 +-
 src/plugins/wp/driver.mll     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/plugins/gui/gtk_helper.ml b/src/plugins/gui/gtk_helper.ml
index 9253046cb29..a3b75c3b142 100644
--- a/src/plugins/gui/gtk_helper.ml
+++ b/src/plugins/gui/gtk_helper.ml
@@ -47,7 +47,7 @@ let framac_logo, framac_icon =
 module Configuration = struct
   include Cilconfig
   let configuration_file () =
-    Gui_parameters.Config.get_file "frama-c-gui.config"
+    Gui_parameters.Config.get_file ~mode:`Create_path "frama-c-gui.config"
   let load () = loadConfiguration (configuration_file ())
   let save () = saveConfiguration (configuration_file ())
   let reset () = Extlib.safe_remove (configuration_file () :> string);
diff --git a/src/plugins/wp/ProverWhy3.ml b/src/plugins/wp/ProverWhy3.ml
index 2b31bf272f2..299e199eefd 100644
--- a/src/plugins/wp/ProverWhy3.ml
+++ b/src/plugins/wp/ProverWhy3.ml
@@ -51,7 +51,7 @@ let get_why3_env = Env.memoize
       let main = Why3.Whyconf.get_main config in
       let ld =
         (WpContext.directory ())::
-        ((Wp_parameters.Share.get_file "why3") :> string)::
+        ((Wp_parameters.Share.get_dir ~mode:`Must_exist "why3") :> string)::
         (Why3.Whyconf.loadpath main) in
       Why3.Env.create_env ld
     end
diff --git a/src/plugins/wp/driver.mll b/src/plugins/wp/driver.mll
index 1a13f28d9e6..06fc29c30ff 100644
--- a/src/plugins/wp/driver.mll
+++ b/src/plugins/wp/driver.mll
@@ -501,7 +501,7 @@ and bal = parse
         let descr = String.concat "," drvs in
         let includes =
           let directories =
-            [(Wp_parameters.Share.get_dir "." :> string)]
+            [(Wp_parameters.Share.get_dir ~mode:`Must_exist "." :> string)]
           in
           if Wp_parameters.has_dkey dkey then
             Wp_parameters.debug ~dkey "Included directories:%t"
-- 
GitLab