forked from Imagelibrary/binutils-gdb
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:
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user