From 7b9d523a3558290b4487c3ff9a4a5b43e8941158 Mon Sep 17 00:00:00 2001 From: Roland Lutz Date: Mon, 7 Sep 2020 14:48:39 +0200 Subject: [PATCH] gattrib: Fix global variable definitions Reported-by: Glen W. Ruch --- gattrib/include/globals.h | 24 ++++++++++++------------ gattrib/src/globals.c | 17 +++++++++++++++++ 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/gattrib/include/globals.h b/gattrib/include/globals.h index a4ddd25cf..17c72563d 100644 --- a/gattrib/include/globals.h +++ b/gattrib/include/globals.h @@ -88,7 +88,7 @@ * structs.h */ /*------------------------------------------------------------------*/ -TOPLEVEL *pr_current; +extern TOPLEVEL *pr_current; /*------------------------------------------------------------------*/ /*! @@ -97,7 +97,7 @@ TOPLEVEL *pr_current; * callbacks. It is defined in structs.h */ /*------------------------------------------------------------------*/ -SHEET_DATA *sheet_head; +extern SHEET_DATA *sheet_head; /*------------------------------------------------------------------ * GTKsheet includes: stuff for dealing with windows. @@ -106,18 +106,18 @@ SHEET_DATA *sheet_head; #define DEFAULT_SPACE 8 #define NUM_SHEETS 3 /* Components, Nets, and Pins */ -GtkWidget *window; /* Main window */ -GtkWidget *notebook; +extern GtkWidget *window; /* Main window */ +extern GtkWidget *notebook; -GtkSheet **sheets; /* These are the spreadsheet widgets themselves */ +extern GtkSheet **sheets; /* These are the spreadsheet widgets themselves */ -GtkWidget **scrolled_windows; -GtkWidget *entry; -GtkWidget *location; -GtkWidget *left_button; -GtkWidget *center_button; -GtkWidget *right_button; -GtkWidget *label; +extern GtkWidget **scrolled_windows; +extern GtkWidget *entry; +extern GtkWidget *location; +extern GtkWidget *left_button; +extern GtkWidget *center_button; +extern GtkWidget *right_button; +extern GtkWidget *label; /* command line switch settings */ extern int verbose_mode; diff --git a/gattrib/src/globals.c b/gattrib/src/globals.c index f4e5cf543..67e5ef7ee 100644 --- a/gattrib/src/globals.c +++ b/gattrib/src/globals.c @@ -34,6 +34,23 @@ #include "../include/prototype.h" /* function prototypes */ #include "../include/globals.h" +TOPLEVEL *pr_current; + +SHEET_DATA *sheet_head; + +GtkWidget *window; +GtkWidget *notebook; + +GtkSheet **sheets; + +GtkWidget **scrolled_windows; +GtkWidget *entry; +GtkWidget *location; +GtkWidget *left_button; +GtkWidget *center_button; +GtkWidget *right_button; +GtkWidget *label; + /* command line arguments */ int verbose_mode=FALSE; //!< Reflects the value of the command line flag int quiet_mode=FALSE; //!< Reflects the value of the command line flag -- 2.11.4.GIT