From f248d99d7a64aff3cdb1fb243d13f71e6455f1be Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Thu, 27 May 1999 23:15:56 +0000 Subject: [PATCH] Minor Alpha fixes (merged from stable). --- examples/procmap.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/examples/procmap.c b/examples/procmap.c index 0dfd78a1..5b68cce1 100644 --- a/examples/procmap.c +++ b/examples/procmap.c @@ -116,24 +116,41 @@ main (int argc, char *argv []) device_minor = (device & 255); device_major = ((device >> 8) & 255); - if (filename) - fprintf (stderr, "%08lx-%08lx %08lx - " - "%02x:%02x %08lu - %4s - %s\n", + if (filename) { + char *format; + + if (sizeof (void*) == 8) + format = "%016lx-%016lx %016lx - " + "%02x:%02x %08lu - %4s - %s\n"; + else + format = "%08lx-%08lx %08lx - " + "%02x:%02x %08lu - %4s - %s\n"; + + fprintf (stderr, format, (unsigned long) maps [i].start, (unsigned long) maps [i].end, (unsigned long) maps [i].offset, device_major, device_minor, (unsigned long) maps [i].inode, perm, filename); - else - fprintf (stderr, "%08lx-%08lx %08lx - " - "%02x:%02x %08lu - %4s\n", + } else { + char * format; + + if (sizeof (void*) == 8) + format = "%016lx-%016lx %016lx - " + "%02x:%02x %08lu - %4s\n"; + else + format = "%08lx-%08lx %08lx - " + "%02x:%02x %08lu - %4s\n"; + + fprintf (stderr, format, (unsigned long) maps [i].start, (unsigned long) maps [i].end, (unsigned long) maps [i].offset, device_major, device_minor, (unsigned long) maps [i].inode, perm); + } if (filename && (filename != maps [i].filename)) glibtop_free (filename);