diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-12-03 15:54:58 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-12-09 16:39:33 +0100 |
| commit | e206ae0348021d4d3c2c7c02f41fb5dbcf14cdb2 (patch) | |
| tree | 86f192441f27f368ba06a5260187d82ffc9bf0a7 /show-parse.c | |
| parent | fff61b26c44a6ead0dde04f214f909f3269140b8 (diff) | |
| download | sparse-dev-e206ae0348021d4d3c2c7c02f41fb5dbcf14cdb2.tar.gz | |
as-name: add and use show_as()
Use a function to display the address spaces.
This will allow to display a real name instead of '<asn:1>'.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'show-parse.c')
| -rw-r--r-- | show-parse.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/show-parse.c b/show-parse.c index 6328439c..ae098c28 100644 --- a/show-parse.c +++ b/show-parse.c @@ -182,6 +182,17 @@ void show_symbol_list(struct symbol_list *list, const char *sep) } END_FOR_EACH_PTR(sym); } +const char *show_as(unsigned int as) +{ + static char buffer[4][32]; + static int n; + char *buff; + + buff = buffer[3 & ++n]; + sprintf(buff, "<asn:%u>", as); + return buff; +} + struct type_name { char *start; char *end; @@ -288,7 +299,7 @@ deeper: size_t len; if (as) - prepend(name, "<asn:%d>", as); + prepend(name, "%s ", show_as(as)); s = modifier_string(mod); len = strlen(s); |
