From 0e3c1eebb22e0ade28b619fb41f42d66ed6fb145 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 27 May 2022 12:37:21 +0930 Subject: 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. --- binutils/prdbg.c | 39 +++++---------------------------------- 1 file changed, 5 insertions(+), 34 deletions(-) (limited to 'binutils/prdbg.c') diff --git a/binutils/prdbg.c b/binutils/prdbg.c index d6cbab8..c1e4162 100644 --- a/binutils/prdbg.c +++ b/binutils/prdbg.c @@ -485,41 +485,12 @@ pop_type (struct pr_handle *info) static void print_vma (bfd_vma vma, char *buf, bool unsignedp, bool hexp) { - if (sizeof (vma) <= sizeof (unsigned long)) - { - if (hexp) - sprintf (buf, "0x%lx", (unsigned long) vma); - else if (unsignedp) - sprintf (buf, "%lu", (unsigned long) vma); - else - sprintf (buf, "%ld", (long) vma); - } -#if BFD_HOST_64BIT_LONG_LONG - else if (sizeof (vma) <= sizeof (unsigned long long)) - { -#ifndef __MSVCRT__ - if (hexp) - sprintf (buf, "0x%llx", (unsigned long long) vma); - else if (unsignedp) - sprintf (buf, "%llu", (unsigned long long) vma); - else - sprintf (buf, "%lld", (long long) vma); -#else - if (hexp) - sprintf (buf, "0x%I64x", (unsigned long long) vma); - else if (unsignedp) - sprintf (buf, "%I64u", (unsigned long long) vma); - else - sprintf (buf, "%I64d", (long long) vma); -#endif - } -#endif + if (hexp) + sprintf (buf, "%#" PRIx64, (uint64_t) vma); + else if (unsignedp) + sprintf (buf, "%" PRIu64, (uint64_t) vma); else - { - buf[0] = '0'; - buf[1] = 'x'; - sprintf_vma (buf + 2, vma); - } + sprintf (buf, "%" PRId64, (int64_t) vma); } /* Start a new compilation unit. */ -- cgit v1.1