[RFA,09/42] Make context_stack_size static in buildsym.c

Message ID 20180523045851.11660-10-tom@tromey.com
State New, archived
Headers

Commit Message

Tom Tromey May 23, 2018, 4:58 a.m. UTC
  context_stack_size is declared in buildsym.h, but only used in
buildsym.c.  This makes it static in buildsym.c.

gdb/ChangeLog
2018-05-22  Tom Tromey  <tom@tromey.com>

	* buildsym.h (context_stack_size): Don't declare.
	* buildsym.c (context_stack_size): New global.
---
 gdb/ChangeLog  | 5 +++++
 gdb/buildsym.c | 4 ++++
 gdb/buildsym.h | 4 ----
 3 files changed, 9 insertions(+), 4 deletions(-)
  

Comments

Simon Marchi July 8, 2018, 4:16 p.m. UTC | #1
On 2018-05-23 12:58 AM, Tom Tromey wrote:
> context_stack_size is declared in buildsym.h, but only used in
> buildsym.c.  This makes it static in buildsym.c.

LGTM.
  

Patch

diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 583c294790..85b450383e 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -258,6 +258,10 @@  struct subfile_stack
 
 static struct subfile_stack *subfile_stack;
 
+/* Currently allocated size of context stack.  */
+
+static int context_stack_size;
+
 static void free_buildsym_compunit (void);
 
 static int compare_line_numbers (const void *ln1p, const void *ln2p);
diff --git a/gdb/buildsym.h b/gdb/buildsym.h
index 088c1d790e..191db8ca4f 100644
--- a/gdb/buildsym.h
+++ b/gdb/buildsym.h
@@ -159,10 +159,6 @@  EXTERN struct context_stack *context_stack;
 
 EXTERN int context_stack_depth;
 
-/* Currently allocated size of context stack.  */
-
-EXTERN int context_stack_size;
-
 /* Non-zero if the context stack is empty.  */
 #define outermost_context_p() (context_stack_depth == 0)