Mark guile_{extension_,}script_ops as static
authorChristian Biesinger <cbiesinger@google.com>
Mon, 7 Oct 2019 22:38:51 +0000 (17:38 -0500)
committerChristian Biesinger <cbiesinger@google.com>
Wed, 9 Oct 2019 18:18:47 +0000 (13:18 -0500)
This makes it clearer that the structs are only used in this file. It
required moving the definition of extension_language_guile further
down in the file, because static structs can't be forward-declared.

gdb/ChangeLog:

2019-10-09  Christian Biesinger  <cbiesinger@google.com>

* guile/guile.c (guile_extension_script_ops): Remove forward
declaration and mark as static.
(guile_script_ops): Likewise.
(extension_language_guile): Move further down in the file so
it can reference the definitions for guile_{extension_,}script_ops.

gdb/ChangeLog
gdb/guile/guile.c

index 35614ccc324b6e3666698ad2c7733aa18db84a3b..2a39ab29b5ab2f14efbe3effa9ba0d1494131cea 100644 (file)
@@ -1,3 +1,11 @@
+2019-10-09  Christian Biesinger  <cbiesinger@google.com>
+
+       * guile/guile.c (guile_extension_script_ops): Remove forward
+       declaration and mark as static.
+       (guile_script_ops): Likewise.
+       (extension_language_guile): Move further down in the file so
+       it can reference the definitions for guile_{extension_,}script_ops.
+
 2019-10-09  Andreas Arnez  <arnez@linux.ibm.com>
 
        * s390-tdep.c (390_process_record): Handle new arch13 instructions
index defe554f7675a98dd3e8f1f780ea3d191f7e7f08..55929f4455177ba443d03fe50fdf7a4d7f7a643d 100644 (file)
@@ -71,33 +71,6 @@ static const char *const guile_print_excp_enums[] =
    the default.  */
 const char *gdbscm_print_excp = gdbscm_print_excp_message;
 
-#ifdef HAVE_GUILE
-/* Forward decls, these are defined later.  */
-extern const struct extension_language_script_ops guile_extension_script_ops;
-extern const struct extension_language_ops guile_extension_ops;
-#endif
-
-/* The main struct describing GDB's interface to the Guile
-   extension language.  */
-extern const struct extension_language_defn extension_language_guile =
-{
-  EXT_LANG_GUILE,
-  "guile",
-  "Guile",
-
-  ".scm",
-  "-gdb.scm",
-
-  guile_control,
-
-#ifdef HAVE_GUILE
-  &guile_extension_script_ops,
-  &guile_extension_ops
-#else
-  NULL,
-  NULL
-#endif
-};
 \f
 #ifdef HAVE_GUILE
 
@@ -126,7 +99,7 @@ static const char boot_scm_filename[] = "boot.scm";
 
 /* The interface between gdb proper and loading of python scripts.  */
 
-const struct extension_language_script_ops guile_extension_script_ops =
+static const struct extension_language_script_ops guile_extension_script_ops =
 {
   gdbscm_source_script,
   gdbscm_source_objfile_script,
@@ -136,7 +109,7 @@ const struct extension_language_script_ops guile_extension_script_ops =
 
 /* The interface between gdb proper and guile scripting.  */
 
-const struct extension_language_ops guile_extension_ops =
+static const struct extension_language_ops guile_extension_ops =
 {
   gdbscm_finish_initialization,
   gdbscm_initialized,
@@ -159,7 +132,31 @@ const struct extension_language_ops guile_extension_ops =
   NULL, /* gdbscm_check_quit_flag, */
   NULL, /* gdbscm_set_quit_flag, */
 };
+#endif
+
+/* The main struct describing GDB's interface to the Guile
+   extension language.  */
+extern const struct extension_language_defn extension_language_guile =
+{
+  EXT_LANG_GUILE,
+  "guile",
+  "Guile",
+
+  ".scm",
+  "-gdb.scm",
 
+  guile_control,
+
+#ifdef HAVE_GUILE
+  &guile_extension_script_ops,
+  &guile_extension_ops
+#else
+  NULL,
+  NULL
+#endif
+};
+
+#ifdef HAVE_GUILE
 /* Implementation of the gdb "guile-repl" command.  */
 
 static void
This page took 0.048041 seconds and 4 git commands to generate.