[6/6] show-parse: use show_typename() instead of show_type()
diff mbox series

Message ID 20181216172151.1361-7-luc.vanoostenryck@gmail.com
State Superseded, archived
Headers show
Series
  • small improvements of show_typename()
Related show

Commit Message

Luc Van Oostenryck Dec. 16, 2018, 5:21 p.m. UTC
show_type() is essentially a copy of show_typename() which
also outputs its result to stdout.

Replace its unique use by a call to show_typename() + printf()
so this function name can be used later for a version which
display only a type and not the associated identifier.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 show-parse.c | 13 +------------
 symbol.h     |  1 -
 2 files changed, 1 insertion(+), 13 deletions(-)

Patch
diff mbox series

diff --git a/show-parse.c b/show-parse.c
index 7bff8f95f..1fa936b50 100644
--- a/show-parse.c
+++ b/show-parse.c
@@ -406,17 +406,6 @@  out:
 		name->end--;
 }
 
-void show_type(struct symbol *sym)
-{
-	char array[200];
-	struct type_name name;
-
-	name.start = name.end = array+100;
-	do_show_type(sym, &name);
-	*name.end = 0;
-	printf("%s", name.start);
-}
-
 const char *show_typename(struct symbol *sym)
 {
 	static char array[200];
@@ -438,7 +427,7 @@  void show_symbol(struct symbol *sym)
 	if (sym->ctype.alignment)
 		printf(".align %ld\n", sym->ctype.alignment);
 
-	show_type(sym);
+	printf("%s", show_typename(sym));
 	type = sym->ctype.base_type;
 	if (!type) {
 		printf("\n");
diff --git a/symbol.h b/symbol.h
index 91e1ea730..77c91c171 100644
--- a/symbol.h
+++ b/symbol.h
@@ -306,7 +306,6 @@  extern void init_builtins(int stream);
 extern void declare_builtins(void);
 extern void init_ctype(void);
 extern struct symbol *alloc_symbol(struct position, int type);
-extern void show_type(struct symbol *);
 extern const char *modifier_string(unsigned long mod);
 extern void show_symbol(struct symbol *);
 extern int show_symbol_expr_init(struct symbol *sym);