From 12b3c8ec1d314b8775fc7d9cefd6bfff551f1de0 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 7 May 2005 14:38:10 -0400 Subject: [PATCH] Fix gcc -Wall nits in the blkid library. --- lib/blkid/ChangeLog | 2 ++ lib/blkid/cache.c | 4 ++-- lib/blkid/dev.c | 2 +- lib/blkid/devno.c | 4 ++-- lib/blkid/probe.c | 10 +++++----- lib/blkid/probe.h | 10 +++++----- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/lib/blkid/ChangeLog b/lib/blkid/ChangeLog index 6bb62b2c..40c7d122 100644 --- a/lib/blkid/ChangeLog +++ b/lib/blkid/ChangeLog @@ -1,5 +1,7 @@ 2005-05-07 Theodore Ts'o + * cache.c, dev.c, devno.c, probe.c, probe.h: Fix gcc -Wall nits. + * blkidP.h, cache.c, dev.c, read.c, tag.c: Clean up the debugging code so that we don't use the inline functions DEB_DUMP_* and instead use the private functions blkid_debug_dump_*(). diff --git a/lib/blkid/cache.c b/lib/blkid/cache.c index 497b0fef..b43be606 100644 --- a/lib/blkid/cache.c +++ b/lib/blkid/cache.c @@ -46,9 +46,9 @@ static char *safe_getenv(const char *arg) #endif #ifdef HAVE___SECURE_GETENV - return __secure_getenv("BLKID_FILE"); + return __secure_getenv(arg); #else - return getenv("BLKID_FILE"); + return getenv(arg); #endif } diff --git a/lib/blkid/dev.c b/lib/blkid/dev.c index 3ac3195e..66a39235 100644 --- a/lib/blkid/dev.c +++ b/lib/blkid/dev.c @@ -68,7 +68,7 @@ void blkid_debug_dump_dev(blkid_dev dev) } printf(" dev: name = %s\n", dev->bid_name); - printf(" dev: DEVNO=\"0x%0Lx\"\n", dev->bid_devno); + printf(" dev: DEVNO=\"0x%0llx\"\n", dev->bid_devno); printf(" dev: TIME=\"%lu\"\n", dev->bid_time); printf(" dev: PRI=\"%d\"\n", dev->bid_pri); printf(" dev: flags = 0x%08X\n", dev->bid_flags); diff --git a/lib/blkid/devno.c b/lib/blkid/devno.c index e665e38c..34fbdf61 100644 --- a/lib/blkid/devno.c +++ b/lib/blkid/devno.c @@ -125,7 +125,7 @@ static void scan_dir(char *dirname, dev_t devno, struct dir_list **list, else if (S_ISBLK(st.st_mode) && st.st_rdev == devno) { *devname = blkid_strdup(path); DBG(DEBUG_DEVNO, - printf("found 0x%Lx at %s (%p)\n", devno, + printf("found 0x%llx at %s (%p)\n", devno, path, *devname)); break; } @@ -183,7 +183,7 @@ char *blkid_devno_to_devname(dev_t devno) (unsigned long) devno)); } else { DBG(DEBUG_DEVNO, - printf("found devno 0x%04Lx as %s\n", devno, devname)); + printf("found devno 0x%04llx as %s\n", devno, devname)); } diff --git a/lib/blkid/probe.c b/lib/blkid/probe.c index a67598ef..6756e977 100644 --- a/lib/blkid/probe.c +++ b/lib/blkid/probe.c @@ -98,7 +98,8 @@ static void get_ext2_info(blkid_dev dev, unsigned char *buf) static int probe_ext3(int fd __BLKID_ATTR((unused)), blkid_cache cache __BLKID_ATTR((unused)), blkid_dev dev, - struct blkid_magic *id, unsigned char *buf) + struct blkid_magic *id __BLKID_ATTR((unused)), + unsigned char *buf) { struct ext2_super_block *es; @@ -124,10 +125,10 @@ static int probe_ext3(int fd __BLKID_ATTR((unused)), static int probe_ext2(int fd __BLKID_ATTR((unused)), blkid_cache cache __BLKID_ATTR((unused)), blkid_dev dev, - struct blkid_magic *id, unsigned char *buf) + struct blkid_magic *id __BLKID_ATTR((unused)), + unsigned char *buf) { struct ext2_super_block *es; - const char *sec_type = 0, *label = 0; es = (struct ext2_super_block *)buf; @@ -338,7 +339,6 @@ static int probe_swap1(int fd, unsigned char *buf __BLKID_ATTR((unused))) { struct swap_id_block *sws; - const char *label = 0; probe_swap0(fd, cache, dev, id, buf); /* @@ -665,7 +665,7 @@ found_type: blkid_set_tag(dev, "TYPE", type, 0); - DBG(DEBUG_PROBE, printf("%s: devno 0x%04Lx, type %s\n", + DBG(DEBUG_PROBE, printf("%s: devno 0x%04llx, type %s\n", dev->bid_name, st.st_rdev, type)); } diff --git a/lib/blkid/probe.h b/lib/blkid/probe.h index e545ef19..ab175eab 100644 --- a/lib/blkid/probe.h +++ b/lib/blkid/probe.h @@ -129,7 +129,7 @@ struct swap_id_block { __u32 sws_lastpage; __u32 sws_nrbad; unsigned char sws_uuid[16]; - unsigned char sws_volume[16]; + char sws_volume[16]; unsigned char sws_pad[117]; __u32 sws_badpg; }; @@ -231,13 +231,13 @@ struct ocfs_volume_header { unsigned char minor_version[4]; unsigned char major_version[4]; unsigned char signature[128]; - unsigned char mount[128]; - unsigned char mount_len[2]; + char mount[128]; + unsigned char mount_len[2]; }; struct ocfs_volume_label { unsigned char disk_lock[48]; - unsigned char label[64]; + char label[64]; unsigned char label_len[2]; unsigned char vol_id[16]; unsigned char vol_id_len[2]; @@ -256,7 +256,7 @@ struct ocfs2_super_block { unsigned char signature[8]; unsigned char s_dummy1[184]; unsigned char s_dummy2[80]; - unsigned char s_label[64]; + char s_label[64]; unsigned char s_uuid[16]; };