summaryrefslogtreecommitdiff
path: root/binutils/prdbg.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-05-27 12:37:21 +0930
committerAlan Modra <amodra@gmail.com>2022-05-27 22:08:59 +0930
commit0e3c1eebb22e0ade28b619fb41f42d66ed6fb145 (patch)
tree8a886ac9438d7e9268807c07585eef11a146714d /binutils/prdbg.c
parentaa9b5dbc0f30855aa23034cbd78a1f2025cb9fa9 (diff)
downloadbinutils-gdb-0e3c1eebb22e0ade28b619fb41f42d66ed6fb145.tar.gz
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/prdbg.c')
-rw-r--r--binutils/prdbg.c39
1 files changed, 5 insertions, 34 deletions
diff --git a/binutils/prdbg.c b/binutils/prdbg.c
index d6cbab8578b..c1e41628d26 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. */