summaryrefslogtreecommitdiff
path: root/scanpci
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2011-11-09 09:46:30 -0800
committerJeremy Huddleston <jeremyhu@apple.com>2011-11-09 09:47:16 -0800
commitcbb3c63affc1792ade0433691aa67f0edad52b0b (patch)
tree871f3eaecec4a0e5619bbd9c4b5ca3cd46313fef /scanpci
parenta0a53a67c91c698007dcac3e7aba27c999c4f6ed (diff)
downloadlibpciaccess-cbb3c63affc1792ade0433691aa67f0edad52b0b.tar.gz
Fix some -Wformat errors in scanpci
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'scanpci')
-rw-r--r--scanpci/scanpci.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/scanpci/scanpci.c b/scanpci/scanpci.c
index 219c814..1f5f8bd 100644
--- a/scanpci/scanpci.c
+++ b/scanpci/scanpci.c
@@ -29,6 +29,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
+#include <inttypes.h>
#ifdef HAVE_ERR_H
#include <err.h>
@@ -51,19 +52,19 @@
static void
print_pci_bridge( const struct pci_bridge_info * info )
{
- printf( " Bus: primary=%02x, secondary=%02x, subordinate=%02x, "
- "sec-latency=%u\n",
+ printf( " Bus: primary=%02"PRIx8", secondary=%02"PRIx8", subordinate=%02"PRIx8", "
+ "sec-latency=%"PRIu8"\n",
info->primary_bus,
info->secondary_bus,
info->subordinate_bus,
info->secondary_latency_timer );
- printf( " I/O behind bridge: %08x-%08x\n",
+ printf( " I/O behind bridge: %08"PRIx32"-%08"PRIx32"\n",
info->io_base,
info->io_limit );
- printf( " Memory behind bridge: %08x-%08x\n",
+ printf( " Memory behind bridge: %08"PRIx32"-%08"PRIx32"\n",
info->mem_base,
info->mem_limit );
- printf( " Prefetchable memory behind bridge: %08llx-%08llx\n",
+ printf( " Prefetchable memory behind bridge: %08"PRIx64"-%08"PRIx64"\n",
info->prefetch_mem_base,
info->prefetch_mem_limit );
}
@@ -150,7 +151,7 @@ print_pci_device( struct pci_device * dev, int verbose )
pci_device_probe( dev );
for ( i = 0 ; i < 6 ; i++ ) {
if ( dev->regions[i].base_addr != 0 ) {
- printf( " BASE%u 0x%08x SIZE %d %s",
+ printf( " BASE%u 0x%08"PRIxPTR" SIZE %zu %s",
i,
(intptr_t) dev->regions[i].base_addr,
(size_t) dev->regions[i].size,