From patchwork Mon Oct 7 22:38:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Terekhov, Mikhail via Gdb-patches" X-Patchwork-Id: 34862 Received: (qmail 23243 invoked by alias); 7 Oct 2019 22:38:57 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 23234 invoked by uid 89); 7 Oct 2019 22:38:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=H*MI:google X-HELO: mail-qt1-f201.google.com Received: from mail-qt1-f201.google.com (HELO mail-qt1-f201.google.com) (209.85.160.201) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Oct 2019 22:38:56 +0000 Received: by mail-qt1-f201.google.com with SMTP id m20so16884082qtq.16 for ; Mon, 07 Oct 2019 15:38:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc :content-transfer-encoding; bh=GZTK/sbQIKA/vPtM1QB8SaofTU4UKHvlSKeHqrHcGz4=; b=n0MugsyLYaIwQ33A5FZ8gpOZDP1Us6Z07UnwuX2XQKJhUn8AnKnOwAFa8TFq81N/YT C3kOHN59EQquoYzZUHR/wz4lRC0YCYSb5VSaoU+BYAGK7u4xQlnM5iYBJ38kjueiT1xU FlPURKE+EsRL9Z0Fp0VilUnSKZlqkgt+dWw6iG/+pCK1HxYOSaZqBwSNoP9sXyNG8A6N VRVeIsb3D1zJN26MXCD5hITpUX/eCrhw/oWHuOm29tDH9yRt6eJafe0yIue2qVwgJXV6 k+KO7aIP+cj9SLpeaJxQmDx2MkzAOHmT4VbmB/Hos/12hgQRB7jyfeqo5m8qF1eCZQIV yBjA== Date: Mon, 7 Oct 2019 17:38:51 -0500 Message-Id: <20191007223851.101950-1-cbiesinger@google.com> Mime-Version: 1.0 Subject: [PATCH] Mark guile_{extension_,}script_ops as static X-Patchwork-Original-From: "Christian Biesinger via gdb-patches" From: "Terekhov, Mikhail via Gdb-patches" Reply-To: Christian Biesinger To: gdb-patches@sourceware.org Cc: Christian Biesinger X-IsSubscribed: yes 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-07 Christian Biesinger * 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/guile/guile.c | 55 ++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/gdb/guile/guile.c b/gdb/guile/guile.c index defe554f76..55929f4455 100644 --- a/gdb/guile/guile.c +++ b/gdb/guile/guile.c @@ -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 -}; #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