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.
This commit is contained in:
Alan Modra
2022-05-27 12:37:21 +09:30
parent aa9b5dbc0f
commit 0e3c1eebb2
45 changed files with 295 additions and 473 deletions

View File

@@ -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. */