From 0565a00a4cfdabd325bf2e117620d5f15dd46cda Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Fri, 3 Oct 2008 18:24:04 +0200 Subject: [PATCH] volume_id: use PRIu64i, PRIx64 macros --- extras/volume_id/lib/adaptec_raid.c | 3 +-- extras/volume_id/lib/btrfs.c | 3 +-- extras/volume_id/lib/cramfs.c | 2 +- extras/volume_id/lib/ddf_raid.c | 11 +++++------ extras/volume_id/lib/ext.c | 2 +- extras/volume_id/lib/fat.c | 6 +++--- extras/volume_id/lib/gfs.c | 2 +- extras/volume_id/lib/hfs.c | 4 ++-- extras/volume_id/lib/highpoint.c | 5 ++--- extras/volume_id/lib/hpfs.c | 2 +- extras/volume_id/lib/iso9660.c | 4 ++-- extras/volume_id/lib/isw_raid.c | 3 +-- extras/volume_id/lib/jfs.c | 2 +- extras/volume_id/lib/jmicron_raid.c | 3 +-- extras/volume_id/lib/libvolume_id-private.h | 3 ++- extras/volume_id/lib/linux_raid.c | 6 ++---- extras/volume_id/lib/linux_swap.c | 2 +- extras/volume_id/lib/lsi_raid.c | 3 +-- extras/volume_id/lib/lvm.c | 4 ++-- extras/volume_id/lib/minix.c | 2 +- extras/volume_id/lib/netware.c | 2 +- extras/volume_id/lib/ntfs.c | 6 +++--- extras/volume_id/lib/nvidia_raid.c | 3 +-- extras/volume_id/lib/ocfs.c | 4 ++-- extras/volume_id/lib/oracleasm.c | 2 +- extras/volume_id/lib/promise_raid.c | 3 +-- extras/volume_id/lib/reiserfs.c | 2 +- extras/volume_id/lib/romfs.c | 2 +- extras/volume_id/lib/silicon_raid.c | 3 +-- extras/volume_id/lib/squashfs.c | 2 +- extras/volume_id/lib/sysv.c | 2 +- extras/volume_id/lib/udf.c | 2 +- extras/volume_id/lib/ufs.c | 2 +- extras/volume_id/lib/util.c | 6 +++--- extras/volume_id/lib/via_raid.c | 3 +-- extras/volume_id/lib/volume_id.c | 6 ++---- extras/volume_id/lib/vxfs.c | 2 +- extras/volume_id/lib/xfs.c | 8 ++++---- extras/volume_id/vol_id.c | 3 ++- 39 files changed, 61 insertions(+), 74 deletions(-) diff --git a/extras/volume_id/lib/adaptec_raid.c b/extras/volume_id/lib/adaptec_raid.c index a76b7321d..d20399c0f 100644 --- a/extras/volume_id/lib/adaptec_raid.c +++ b/extras/volume_id/lib/adaptec_raid.c @@ -91,8 +91,7 @@ int volume_id_probe_adaptec_raid(struct volume_id *id, uint64_t off, uint64_t si uint64_t meta_off; struct adaptec_meta *ad; - info("probing at offset 0x%llx, size 0x%llx\n", - (unsigned long long) off, (unsigned long long) size); + info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size); if (size < 0x10000) return -1; diff --git a/extras/volume_id/lib/btrfs.c b/extras/volume_id/lib/btrfs.c index aae2fa616..660e6dab3 100644 --- a/extras/volume_id/lib/btrfs.c +++ b/extras/volume_id/lib/btrfs.c @@ -75,8 +75,7 @@ int volume_id_probe_btrfs(struct volume_id *id, uint64_t off, uint64_t size) const uint8_t *buf; struct btrfs_super_block *bfs; - info("probing at offset 0x%llx, size 0x%llx\n", - (unsigned long long)off, (unsigned long long)size); + info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size); buf = volume_id_get_buffer(id, off + 0x4000, 0x200); if (buf == NULL) diff --git a/extras/volume_id/lib/cramfs.c b/extras/volume_id/lib/cramfs.c index ed54dfd35..b6460da5d 100644 --- a/extras/volume_id/lib/cramfs.c +++ b/extras/volume_id/lib/cramfs.c @@ -50,7 +50,7 @@ int volume_id_probe_cramfs(struct volume_id *id, uint64_t off, uint64_t size) { struct cramfs_super *cs; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); cs = (struct cramfs_super *) volume_id_get_buffer(id, off, 0x200); if (cs == NULL) diff --git a/extras/volume_id/lib/ddf_raid.c b/extras/volume_id/lib/ddf_raid.c index 53d309b8c..58bdae94a 100644 --- a/extras/volume_id/lib/ddf_raid.c +++ b/extras/volume_id/lib/ddf_raid.c @@ -50,8 +50,7 @@ int volume_id_probe_ddf_raid(struct volume_id *id, uint64_t off, uint64_t size) const uint8_t *buf; struct ddf_header *ddf; - info("probing at offset 0x%llx, size 0x%llx\n", - (unsigned long long)off, (unsigned long long)size); + info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size); if (size < 0x30000) return -1; @@ -62,11 +61,11 @@ int volume_id_probe_ddf_raid(struct volume_id *id, uint64_t off, uint64_t size) return -1; ddf = (struct ddf_header *) buf; if (memcmp(ddf->signature, "\x11\xde\x11\xde", 4) == 0) { - info("header (little endian) found at %llu\n", (unsigned long long)(off + ddf_off)); + info("header (little endian) found at %" PRIu64 "\n", (off + ddf_off)); goto found; } if (memcmp(ddf->signature, "\xde\x11\xde\x11", 4) == 0) { - info("header (big endian) found at %llu\n", (unsigned long long)(off + ddf_off)); + info("header (big endian) found at %" PRIu64 "\n", (off + ddf_off)); goto found; } @@ -77,11 +76,11 @@ int volume_id_probe_ddf_raid(struct volume_id *id, uint64_t off, uint64_t size) return -1; ddf = (struct ddf_header *) buf; if (memcmp(ddf->signature, "\x11\xde\x11\xde", 4) == 0) { - info("header adaptec (little endian) found at %llu\n", (unsigned long long)(off + ddf_off)); + info("header adaptec (little endian) found at %" PRIu64 "\n", (off + ddf_off)); goto found; } if (memcmp(ddf->signature, "\xde\x11\xde\x11", 4) == 0) { - info("header adaptec (big endian) found at %llu\n", (unsigned long long)(off + ddf_off)); + info("header adaptec (big endian) found at %" PRIu64 "\n", (off + ddf_off)); goto found; } diff --git a/extras/volume_id/lib/ext.c b/extras/volume_id/lib/ext.c index 97299d60d..13ec47029 100644 --- a/extras/volume_id/lib/ext.c +++ b/extras/volume_id/lib/ext.c @@ -135,7 +135,7 @@ int volume_id_probe_ext(struct volume_id *id, uint64_t off, uint64_t size) uint32_t feature_incompat; uint32_t flags; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); es = (struct ext2_super_block *) volume_id_get_buffer(id, off + EXT_SUPERBLOCK_OFFSET, 0x200); if (es == NULL) diff --git a/extras/volume_id/lib/fat.c b/extras/volume_id/lib/fat.c index 62ff6b664..e5a5cc119 100644 --- a/extras/volume_id/lib/fat.c +++ b/extras/volume_id/lib/fat.c @@ -275,7 +275,7 @@ int volume_id_probe_vfat(struct volume_id *id, uint64_t off, uint64_t size) int maxloop; size_t fnlen; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); buf = volume_id_get_buffer(id, off, 0x400); if (buf == NULL) @@ -380,7 +380,7 @@ magic: /* the label may be an attribute in the root directory */ root_start = (reserved + fat_size) * sector_size; - dbg("root dir start 0x%llx\n", (unsigned long long) root_start); + dbg("root dir start 0x%" PRIx64 "\n", root_start); root_dir_entries = le16_to_cpu(vs->dir_entries); dbg("expected entries 0x%x\n", root_dir_entries); @@ -442,7 +442,7 @@ fat32: dbg("next cluster %u\n", next); next_sect_off = (next - 2) * vs->sectors_per_cluster; next_off = (start_data_sect + next_sect_off) * sector_size; - dbg("cluster offset 0x%llx\n", (unsigned long long) next_off); + dbg("cluster offset 0x%" PRIx64 "\n", next_off); /* get cluster */ buf = volume_id_get_buffer(id, off + next_off, buf_size); diff --git a/extras/volume_id/lib/gfs.c b/extras/volume_id/lib/gfs.c index a8b5080ec..25f96f668 100644 --- a/extras/volume_id/lib/gfs.c +++ b/extras/volume_id/lib/gfs.c @@ -83,7 +83,7 @@ static int volume_id_probe_gfs_generic(struct volume_id *id, uint64_t off, int v { struct gfs2_sb *sbd; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); sbd = (struct gfs2_sb *) volume_id_get_buffer(id, off + GFS_SUPERBLOCK_OFFSET, sizeof(struct gfs2_sb)); diff --git a/extras/volume_id/lib/hfs.c b/extras/volume_id/lib/hfs.c index dbc5f3619..903378b34 100644 --- a/extras/volume_id/lib/hfs.c +++ b/extras/volume_id/lib/hfs.c @@ -188,7 +188,7 @@ int volume_id_probe_hfs_hfsplus(struct volume_id *id, uint64_t off, uint64_t siz struct hfsplus_extent extents[HFSPLUS_EXTENT_COUNT]; const uint8_t *buf; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); buf = volume_id_get_buffer(id, off + HFS_SUPERBLOCK_OFFSET, 0x200); if (buf == NULL) @@ -211,7 +211,7 @@ int volume_id_probe_hfs_hfsplus(struct volume_id *id, uint64_t off, uint64_t siz off += (alloc_first_block * 512) + (embed_first_block * alloc_block_size); - dbg("hfs wrapped hfs+ found at offset 0x%llx\n", (unsigned long long) off); + dbg("hfs wrapped hfs+ found at offset 0x%" PRIx64 "\n", off); buf = volume_id_get_buffer(id, off + HFS_SUPERBLOCK_OFFSET, 0x200); if (buf == NULL) diff --git a/extras/volume_id/lib/highpoint.c b/extras/volume_id/lib/highpoint.c index 7c91f5d2c..33554f29a 100644 --- a/extras/volume_id/lib/highpoint.c +++ b/extras/volume_id/lib/highpoint.c @@ -54,7 +54,7 @@ int volume_id_probe_highpoint_37x_raid(struct volume_id *id, uint64_t off, uint6 struct hpt37x_meta *hpt; uint32_t magic; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); buf = volume_id_get_buffer(id, off + HPT37X_CONFIG_OFF, 0x200); if (buf == NULL) @@ -78,8 +78,7 @@ int volume_id_probe_highpoint_45x_raid(struct volume_id *id, uint64_t off, uint6 uint64_t meta_off; uint32_t magic; - dbg("probing at offset 0x%llx, size 0x%llx\n", - (unsigned long long) off, (unsigned long long) size); + dbg("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size); if (size < 0x10000) return -1; diff --git a/extras/volume_id/lib/hpfs.c b/extras/volume_id/lib/hpfs.c index 80ba28977..ce9118d37 100644 --- a/extras/volume_id/lib/hpfs.c +++ b/extras/volume_id/lib/hpfs.c @@ -80,7 +80,7 @@ int volume_id_probe_hpfs(struct volume_id *id, uint64_t off, uint64_t size) struct hpfs_spare_super *hss; struct hpfs_boot_block *hbb; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); hs = (struct hpfs_super *) volume_id_get_buffer(id, off + HPFS_SUPERBLOCK_OFFSET, 0x400); if (hs == NULL) diff --git a/extras/volume_id/lib/iso9660.c b/extras/volume_id/lib/iso9660.c index 913e5b8a0..ea1464b06 100644 --- a/extras/volume_id/lib/iso9660.c +++ b/extras/volume_id/lib/iso9660.c @@ -64,7 +64,7 @@ int volume_id_probe_iso9660(struct volume_id *id, uint64_t off, uint64_t size) struct iso_volume_descriptor *is; struct high_sierra_volume_descriptor *hs; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); buf = volume_id_get_buffer(id, off + ISO_SUPERBLOCK_OFFSET, 0x200); if (buf == NULL) @@ -91,7 +91,7 @@ int volume_id_probe_iso9660(struct volume_id *id, uint64_t off, uint64_t size) if (is->type != ISO_VD_SUPPLEMENTARY) continue; - dbg("found SVD at offset 0x%llx\n", (unsigned long long) (off + vd_offset)); + dbg("found SVD at offset 0x%" PRIx64 "\n", (off + vd_offset)); if (memcmp(is->escape_sequences, "%/@", 3) == 0|| memcmp(is->escape_sequences, "%/C", 3) == 0|| memcmp(is->escape_sequences, "%/E", 3) == 0) { diff --git a/extras/volume_id/lib/isw_raid.c b/extras/volume_id/lib/isw_raid.c index 382e45d5d..db3124971 100644 --- a/extras/volume_id/lib/isw_raid.c +++ b/extras/volume_id/lib/isw_raid.c @@ -48,8 +48,7 @@ int volume_id_probe_intel_software_raid(struct volume_id *id, uint64_t off, uint uint64_t meta_off; struct isw_meta *isw; - info("probing at offset 0x%llx, size 0x%llx\n", - (unsigned long long) off, (unsigned long long) size); + info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size); if (size < 0x10000) return -1; diff --git a/extras/volume_id/lib/jfs.c b/extras/volume_id/lib/jfs.c index d496cf878..b84ded349 100644 --- a/extras/volume_id/lib/jfs.c +++ b/extras/volume_id/lib/jfs.c @@ -50,7 +50,7 @@ int volume_id_probe_jfs(struct volume_id *id, uint64_t off, uint64_t size) { struct jfs_super_block *js; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); js = (struct jfs_super_block *) volume_id_get_buffer(id, off + JFS_SUPERBLOCK_OFFSET, 0x200); if (js == NULL) diff --git a/extras/volume_id/lib/jmicron_raid.c b/extras/volume_id/lib/jmicron_raid.c index 134e7aa4e..e14862f34 100644 --- a/extras/volume_id/lib/jmicron_raid.c +++ b/extras/volume_id/lib/jmicron_raid.c @@ -44,8 +44,7 @@ int volume_id_probe_jmicron_raid(struct volume_id *id, uint64_t off, uint64_t si uint64_t meta_off; struct jmicron_meta *jm; - info("probing at offset 0x%llx, size 0x%llx\n", - (unsigned long long) off, (unsigned long long) size); + info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size); if (size < 0x10000) return -1; diff --git a/extras/volume_id/lib/libvolume_id-private.h b/extras/volume_id/lib/libvolume_id-private.h index 356d89920..14f7568fe 100644 --- a/extras/volume_id/lib/libvolume_id-private.h +++ b/extras/volume_id/lib/libvolume_id-private.h @@ -20,9 +20,10 @@ #ifndef _LIBVOLUME_ID_PRIVATE_H_ #define _LIBVOLUME_ID_PRIVATE_H_ -#include #include #include +#include +#include #include #include diff --git a/extras/volume_id/lib/linux_raid.c b/extras/volume_id/lib/linux_raid.c index f7d1af4fe..e84557082 100644 --- a/extras/volume_id/lib/linux_raid.c +++ b/extras/volume_id/lib/linux_raid.c @@ -72,8 +72,7 @@ static int volume_id_probe_linux_raid0(struct volume_id *id, uint64_t off, uint6 uint8_t bytes[16]; } uuid; - info("probing at offset 0x%llx, size 0x%llx\n", - (unsigned long long) off, (unsigned long long) size); + info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size); if (size < 0x10000) return -1; @@ -127,8 +126,7 @@ static int volume_id_probe_linux_raid1(struct volume_id *id, uint64_t off, uint6 const uint8_t *buf; struct mdp1_super_block *mdp1; - info("probing at offset 0x%llx, size 0x%llx\n", - (unsigned long long) off, (unsigned long long) size); + info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size); buf = volume_id_get_buffer(id, off, 0x800); if (buf == NULL) diff --git a/extras/volume_id/lib/linux_swap.c b/extras/volume_id/lib/linux_swap.c index 7cf3d3539..7b24a46b2 100644 --- a/extras/volume_id/lib/linux_swap.c +++ b/extras/volume_id/lib/linux_swap.c @@ -48,7 +48,7 @@ int volume_id_probe_linux_swap(struct volume_id *id, uint64_t off, uint64_t size unsigned int page; struct swap_header_v1_2 *sw; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); /* eek, the swap signature is at the end of the PAGE_SIZE */ for (page = 0x1000; page <= LARGEST_PAGESIZE; page <<= 1) { diff --git a/extras/volume_id/lib/lsi_raid.c b/extras/volume_id/lib/lsi_raid.c index b4495a2c5..5a6ba4c72 100644 --- a/extras/volume_id/lib/lsi_raid.c +++ b/extras/volume_id/lib/lsi_raid.c @@ -43,8 +43,7 @@ int volume_id_probe_lsi_mega_raid(struct volume_id *id, uint64_t off, uint64_t s uint64_t meta_off; struct lsi_meta *lsi; - info("probing at offset 0x%llx, size 0x%llx\n", - (unsigned long long) off, (unsigned long long) size); + info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size); if (size < 0x10000) return -1; diff --git a/extras/volume_id/lib/lvm.c b/extras/volume_id/lib/lvm.c index 1d62ec933..a3f409a0e 100644 --- a/extras/volume_id/lib/lvm.c +++ b/extras/volume_id/lib/lvm.c @@ -56,7 +56,7 @@ int volume_id_probe_lvm1(struct volume_id *id, uint64_t off, uint64_t size) const uint8_t *buf; struct lvm1_super_block *lvm; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); buf = volume_id_get_buffer(id, off + LVM1_SB_OFF, 0x800); if (buf == NULL) @@ -83,7 +83,7 @@ int volume_id_probe_lvm2(struct volume_id *id, uint64_t off, uint64_t size) struct lvm2_super_block *lvm; struct lvm2_pv_header *pvhdr; - dbg("probing at offset 0x%llx\n", (unsigned long long) off); + dbg("probing at offset 0x%" PRIx64 "\n", off); buf = volume_id_get_buffer(id, off, LVM2LABEL_SCAN_SECTORS * 0x200); if (buf == NULL) diff --git a/extras/volume_id/lib/minix.c b/extras/volume_id/lib/minix.c index 5644cca43..cca158560 100644 --- a/extras/volume_id/lib/minix.c +++ b/extras/volume_id/lib/minix.c @@ -75,7 +75,7 @@ int volume_id_probe_minix(struct volume_id *id, uint64_t off, uint64_t size) struct minix_super_block *ms; struct minix3_super_block *m3s; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); buf = volume_id_get_buffer(id, off + MINIX_SUPERBLOCK_OFFSET, 0x200); if (buf == NULL) diff --git a/extras/volume_id/lib/netware.c b/extras/volume_id/lib/netware.c index e6ca5da3a..58749e5f0 100644 --- a/extras/volume_id/lib/netware.c +++ b/extras/volume_id/lib/netware.c @@ -87,7 +87,7 @@ int volume_id_probe_netware(struct volume_id *id, uint64_t off, uint64_t size) { struct netware_super_block *nw; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); nw = (struct netware_super_block *) volume_id_get_buffer(id, off + NW_SUPERBLOCK_OFFSET, 0x200); if (nw == NULL) diff --git a/extras/volume_id/lib/ntfs.c b/extras/volume_id/lib/ntfs.c index 8154e7685..f861b4bf2 100644 --- a/extras/volume_id/lib/ntfs.c +++ b/extras/volume_id/lib/ntfs.c @@ -110,7 +110,7 @@ int volume_id_probe_ntfs(struct volume_id *id, uint64_t off, uint64_t size) const uint8_t *buf; const uint8_t *val; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); ns = (struct ntfs_super_block *) volume_id_get_buffer(id, off, 0x200); if (ns == NULL) @@ -137,8 +137,8 @@ int volume_id_probe_ntfs(struct volume_id *id, uint64_t off, uint64_t size) dbg("sectorsize 0x%x\n", sector_size); dbg("clustersize 0x%x\n", cluster_size); - dbg("mftcluster %llu\n", (unsigned long long) mft_cluster); - dbg("mftoffset 0x%llx\n", (unsigned long long) mft_off); + dbg("mftcluster %" PRIu64 "\n", mft_cluster); + dbg("mftoffset 0x%" PRIx64 "\n", mft_off); dbg("cluster per mft_record %i\n", ns->cluster_per_mft_record); dbg("mft record size %i\n", mft_record_size); diff --git a/extras/volume_id/lib/nvidia_raid.c b/extras/volume_id/lib/nvidia_raid.c index cbd0d5b05..2969dbe3d 100644 --- a/extras/volume_id/lib/nvidia_raid.c +++ b/extras/volume_id/lib/nvidia_raid.c @@ -46,8 +46,7 @@ int volume_id_probe_nvidia_raid(struct volume_id *id, uint64_t off, uint64_t siz uint64_t meta_off; struct nvidia_meta *nv; - info("probing at offset 0x%llx, size 0x%llx\n", - (unsigned long long) off, (unsigned long long) size); + info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size); if (size < 0x10000) return -1; diff --git a/extras/volume_id/lib/ocfs.c b/extras/volume_id/lib/ocfs.c index b0038f4cc..e7bf55c42 100644 --- a/extras/volume_id/lib/ocfs.c +++ b/extras/volume_id/lib/ocfs.c @@ -136,7 +136,7 @@ int volume_id_probe_ocfs1(struct volume_id *id, uint64_t off, uint64_t size) struct ocfs1_super_block_header *osh; struct ocfs1_super_block_label *osl; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); buf = volume_id_get_buffer(id, off, 0x200); if (buf == NULL) @@ -174,7 +174,7 @@ int volume_id_probe_ocfs2(struct volume_id *id, uint64_t off, uint64_t size) struct ocfs2_super_block *os; size_t blksize; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); for (blksize = 0x200; blksize <= OCFS2_MAX_BLOCKSIZE; blksize <<= 1) { buf = volume_id_get_buffer(id, off + OCFS2_SUPER_BLOCK_BLKNO * blksize, 0x200); diff --git a/extras/volume_id/lib/oracleasm.c b/extras/volume_id/lib/oracleasm.c index 069bb33ff..8e63fb120 100644 --- a/extras/volume_id/lib/oracleasm.c +++ b/extras/volume_id/lib/oracleasm.c @@ -50,7 +50,7 @@ int volume_id_probe_oracleasm(struct volume_id *id, uint64_t off, uint64_t size) const uint8_t *buf; struct oracleasm_super_block *oracleasm; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); buf = volume_id_get_buffer(id, off + ASM_SB_OFF, 0x800); if (buf == NULL) diff --git a/extras/volume_id/lib/promise_raid.c b/extras/volume_id/lib/promise_raid.c index d4a5b0468..cdc90a1a6 100644 --- a/extras/volume_id/lib/promise_raid.c +++ b/extras/volume_id/lib/promise_raid.c @@ -47,8 +47,7 @@ int volume_id_probe_promise_fasttrack_raid(struct volume_id *id, uint64_t off, u 63, 255, 256, 16, 399, 0 }; - info("probing at offset 0x%llx, size 0x%llx\n", - (unsigned long long) off, (unsigned long long) size); + info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size); if (size < 0x40000) return -1; diff --git a/extras/volume_id/lib/reiserfs.c b/extras/volume_id/lib/reiserfs.c index 5c48c0663..cdc46912a 100644 --- a/extras/volume_id/lib/reiserfs.c +++ b/extras/volume_id/lib/reiserfs.c @@ -65,7 +65,7 @@ int volume_id_probe_reiserfs(struct volume_id *id, uint64_t off, uint64_t size) struct reiser4_super_block *rs4; uint8_t *buf; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); buf = volume_id_get_buffer(id, off + REISERFS_SUPERBLOCK_OFFSET, 0x200); if (buf == NULL) diff --git a/extras/volume_id/lib/romfs.c b/extras/volume_id/lib/romfs.c index a49d7e2aa..1c9a6f249 100644 --- a/extras/volume_id/lib/romfs.c +++ b/extras/volume_id/lib/romfs.c @@ -42,7 +42,7 @@ int volume_id_probe_romfs(struct volume_id *id, uint64_t off, uint64_t size) { struct romfs_super *rfs; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); rfs = (struct romfs_super *) volume_id_get_buffer(id, off, 0x200); if (rfs == NULL) diff --git a/extras/volume_id/lib/silicon_raid.c b/extras/volume_id/lib/silicon_raid.c index abb8a1d30..428978828 100644 --- a/extras/volume_id/lib/silicon_raid.c +++ b/extras/volume_id/lib/silicon_raid.c @@ -58,8 +58,7 @@ int volume_id_probe_silicon_medley_raid(struct volume_id *id, uint64_t off, uint uint64_t meta_off; struct silicon_meta *sil; - info("probing at offset 0x%llx, size 0x%llx\n", - (unsigned long long) off, (unsigned long long) size); + info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size); if (size < 0x10000) return -1; diff --git a/extras/volume_id/lib/squashfs.c b/extras/volume_id/lib/squashfs.c index c4d961d31..6952e5cec 100644 --- a/extras/volume_id/lib/squashfs.c +++ b/extras/volume_id/lib/squashfs.c @@ -50,7 +50,7 @@ int volume_id_probe_squashfs(struct volume_id *id, uint64_t off, uint64_t size) { struct squashfs_super *sqs; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); sqs = (struct squashfs_super *) volume_id_get_buffer(id, off, 0x200); if (sqs == NULL) diff --git a/extras/volume_id/lib/sysv.c b/extras/volume_id/lib/sysv.c index 66262df37..586dc1d14 100644 --- a/extras/volume_id/lib/sysv.c +++ b/extras/volume_id/lib/sysv.c @@ -100,7 +100,7 @@ int volume_id_probe_sysv(struct volume_id *id, uint64_t off, uint64_t size) struct xenix_super *xs; unsigned int boff; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); for (boff = 0x200; boff <= SYSV_MAX_BLOCKSIZE; boff <<= 1) { vs = (struct sysv_super *) diff --git a/extras/volume_id/lib/udf.c b/extras/volume_id/lib/udf.c index bf0833df8..aed0d76b5 100644 --- a/extras/volume_id/lib/udf.c +++ b/extras/volume_id/lib/udf.c @@ -77,7 +77,7 @@ int volume_id_probe_udf(struct volume_id *id, uint64_t off, uint64_t size) unsigned int loc; unsigned int clen; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); vsd = (struct volume_structure_descriptor *) volume_id_get_buffer(id, off + UDF_VSD_OFFSET, 0x200); if (vsd == NULL) diff --git a/extras/volume_id/lib/ufs.c b/extras/volume_id/lib/ufs.c index 54cc85c43..0648b454d 100644 --- a/extras/volume_id/lib/ufs.c +++ b/extras/volume_id/lib/ufs.c @@ -180,7 +180,7 @@ int volume_id_probe_ufs(struct volume_id *id, uint64_t off, uint64_t size) struct ufs_super_block *ufs; int offsets[] = {0, 8, 64, 256, -1}; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); for (i = 0; offsets[i] >= 0; i++) { ufs = (struct ufs_super_block *) volume_id_get_buffer(id, off + (offsets[i] * 0x400), 0x800); diff --git a/extras/volume_id/lib/util.c b/extras/volume_id/lib/util.c index 0fb893796..671f97ee2 100644 --- a/extras/volume_id/lib/util.c +++ b/extras/volume_id/lib/util.c @@ -352,7 +352,7 @@ uint8_t *volume_id_get_buffer(struct volume_id *id, uint64_t off, size_t len) { ssize_t buf_len; - info("get buffer off 0x%llx(%llu), len 0x%zx\n", (unsigned long long) off, (unsigned long long) off, len); + info("get buffer off 0x%" PRIx64 "(%" PRIu64 "), len 0x%zx\n", off, off, len); /* check if requested area fits in superblock buffer */ if (off + len <= SB_BUFFER_SIZE) { if (id->sbbuf == NULL) { @@ -365,7 +365,7 @@ uint8_t *volume_id_get_buffer(struct volume_id *id, uint64_t off, size_t len) /* check if we need to read */ if ((off + len) > id->sbbuf_len) { - info("read sbbuf len:0x%llx\n", (unsigned long long) (off + len)); + info("read sbbuf len:0x%" PRIx64 "\n", (off + len)); if (lseek(id->fd, 0, SEEK_SET) < 0) { dbg("lseek failed (%s)\n", strerror(errno)); return NULL; @@ -401,7 +401,7 @@ uint8_t *volume_id_get_buffer(struct volume_id *id, uint64_t off, size_t len) /* check if we need to read */ if ((off < id->seekbuf_off) || ((off + len) > (id->seekbuf_off + id->seekbuf_len))) { - info("read seekbuf off:0x%llx len:0x%zx\n", (unsigned long long) off, len); + info("read seekbuf off:0x%" PRIx64 " len:0x%zx\n", off, len); if (lseek(id->fd, off, SEEK_SET) < 0) { dbg("lseek failed (%s)\n", strerror(errno)); return NULL; diff --git a/extras/volume_id/lib/via_raid.c b/extras/volume_id/lib/via_raid.c index e4ddd2244..9e4be5a90 100644 --- a/extras/volume_id/lib/via_raid.c +++ b/extras/volume_id/lib/via_raid.c @@ -68,8 +68,7 @@ int volume_id_probe_via_raid(struct volume_id *id, uint64_t off, uint64_t size) uint64_t meta_off; struct via_meta *via; - dbg("probing at offset 0x%llx, size 0x%llx\n", - (unsigned long long) off, (unsigned long long) size); + dbg("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size); if (size < 0x10000) return -1; diff --git a/extras/volume_id/lib/volume_id.c b/extras/volume_id/lib/volume_id.c index c9ad02b9a..791be4351 100644 --- a/extras/volume_id/lib/volume_id.c +++ b/extras/volume_id/lib/volume_id.c @@ -367,8 +367,7 @@ int volume_id_probe_raid(struct volume_id *id, uint64_t off, uint64_t size) if (!device_is_readable(id, off)) return -1; - info("probing at offset 0x%llx, size 0x%llx\n", - (unsigned long long) off, (unsigned long long) size); + info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size); for (i = 0; i < ARRAY_SIZE(prober_raid); i++) if (prober_raid[i].prober(id, off, size) == 0) @@ -401,8 +400,7 @@ int volume_id_probe_filesystem(struct volume_id *id, uint64_t off, uint64_t size if (!device_is_readable(id, off)) return -1; - info("probing at offset 0x%llx, size 0x%llx\n", - (unsigned long long) off, (unsigned long long) size); + info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size); for (i = 0; i < ARRAY_SIZE(prober_filesystem); i++) if (prober_filesystem[i].prober(id, off, size) == 0) diff --git a/extras/volume_id/lib/vxfs.c b/extras/volume_id/lib/vxfs.c index 06501af26..da569495d 100644 --- a/extras/volume_id/lib/vxfs.c +++ b/extras/volume_id/lib/vxfs.c @@ -42,7 +42,7 @@ int volume_id_probe_vxfs(struct volume_id *id, uint64_t off, uint64_t size) { struct vxfs_super *vxs; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); vxs = (struct vxfs_super *) volume_id_get_buffer(id, off + 0x200, 0x200); if (vxs == NULL) diff --git a/extras/volume_id/lib/xfs.c b/extras/volume_id/lib/xfs.c index 98ba6572f..35ba68ed3 100644 --- a/extras/volume_id/lib/xfs.c +++ b/extras/volume_id/lib/xfs.c @@ -32,14 +32,14 @@ #include "libvolume_id-private.h" struct xfs_super_block { - uint8_t magic[4]; + uint8_t magic[4]; uint32_t blocksize; uint64_t dblocks; uint64_t rblocks; uint32_t dummy1[2]; - uint8_t uuid[16]; + uint8_t uuid[16]; uint32_t dummy2[15]; - uint8_t fname[12]; + uint8_t fname[12]; uint32_t dummy3[2]; uint64_t icount; uint64_t ifree; @@ -50,7 +50,7 @@ int volume_id_probe_xfs(struct volume_id *id, uint64_t off, uint64_t size) { struct xfs_super_block *xs; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); xs = (struct xfs_super_block *) volume_id_get_buffer(id, off, 0x200); if (xs == NULL) diff --git a/extras/volume_id/vol_id.c b/extras/volume_id/vol_id.c index b153bc541..b4db5adcd 100644 --- a/extras/volume_id/vol_id.c +++ b/extras/volume_id/vol_id.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include "../../udev/udev.h" @@ -247,7 +248,7 @@ int main(int argc, char *argv[]) if (size == 0) { if (ioctl(fd, BLKGETSIZE64, &size) != 0) size = 0; - info(udev_ctx, "BLKGETSIZE64=%llu (%lluGB)\n", (unsigned long long)size, (unsigned long long)size >> 30); + info(udev_ctx, "BLKGETSIZE64=%" PRIu64 " (%" PRIu64 "GB)\n", size, size >> 30); } /* try to drop all privileges before reading disk content */ -- 2.30.2