diff options
author | Alan Modra <amodra@gmail.com> | 2022-05-27 12:37:21 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-05-27 22:08:59 +0930 |
commit | 0e3c1eebb22e0ade28b619fb41f42d66ed6fb145 (patch) | |
tree | 8a886ac9438d7e9268807c07585eef11a146714d /binutils/nm.c | |
parent | aa9b5dbc0f30855aa23034cbd78a1f2025cb9fa9 (diff) | |
download | gdb-0e3c1eebb22e0ade28b619fb41f42d66ed6fb145.zip gdb-0e3c1eebb22e0ade28b619fb41f42d66ed6fb145.tar.gz gdb-0e3c1eebb22e0ade28b619fb41f42d66ed6fb145.tar.bz2 |
Remove use of bfd_uint64_t and similar
Requiring C99 means that uses of bfd_uint64_t can be replaced with
uint64_t, and similarly for bfd_int64_t, BFD_HOST_U_64_BIT, and
BFD_HOST_64_BIT. This patch does that, removes #ifdef BFD_HOST_*
and tidies a few places that print 64-bit values.
Diffstat (limited to 'binutils/nm.c')
-rw-r--r-- | binutils/nm.c | 49 |
1 files changed, 5 insertions, 44 deletions
diff --git a/binutils/nm.c b/binutils/nm.c index 60e4d85..539c568 100644 --- a/binutils/nm.c +++ b/binutils/nm.c @@ -1557,29 +1557,15 @@ get_print_format (void) padding = "016"; } - const char * length = "l"; - if (print_width == 64) - { -#if BFD_HOST_64BIT_LONG - ; -#elif BFD_HOST_64BIT_LONG_LONG -#ifndef __MSVCRT__ - length = "ll"; -#else - length = "I64"; -#endif -#endif - } - const char * radix = NULL; switch (print_radix) { - case 8: radix = "o"; break; - case 10: radix = "d"; break; - case 16: radix = "x"; break; + case 8: radix = PRIo64; break; + case 10: radix = PRId64; break; + case 16: radix = PRIx64; break; } - return concat ("%", padding, length, radix, NULL); + return concat ("%", padding, radix, NULL); } static void @@ -1874,33 +1860,8 @@ print_value (bfd *abfd ATTRIBUTE_UNUSED, bfd_vma val) switch (print_width) { case 32: - printf (print_format_string, (unsigned long) val); - break; - case 64: -#if BFD_HOST_64BIT_LONG || BFD_HOST_64BIT_LONG_LONG - printf (print_format_string, val); -#else - /* We have a 64 bit value to print, but the host is only 32 bit. */ - if (print_radix == 16) - bfd_fprintf_vma (abfd, stdout, val); - else - { - char buf[30]; - char *s; - - s = buf + sizeof buf; - *--s = '\0'; - while (val > 0) - { - *--s = (val % print_radix) + '0'; - val /= print_radix; - } - while ((buf + sizeof buf - 1) - s < 16) - *--s = '0'; - printf ("%s", s); - } -#endif + printf (print_format_string, (uint64_t) val); break; default: |