Fix gcc -Wall nits in the blkid library.

bitmap-optimize
Theodore Ts'o 2005-05-07 14:38:10 -04:00
parent 78c7d0efae
commit 12b3c8ec1d
6 changed files with 17 additions and 15 deletions

View File

@ -1,5 +1,7 @@
2005-05-07 Theodore Ts'o <tytso@mit.edu> 2005-05-07 Theodore Ts'o <tytso@mit.edu>
* 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 * 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_* code so that we don't use the inline functions DEB_DUMP_*
and instead use the private functions blkid_debug_dump_*(). and instead use the private functions blkid_debug_dump_*().

View File

@ -46,9 +46,9 @@ static char *safe_getenv(const char *arg)
#endif #endif
#ifdef HAVE___SECURE_GETENV #ifdef HAVE___SECURE_GETENV
return __secure_getenv("BLKID_FILE"); return __secure_getenv(arg);
#else #else
return getenv("BLKID_FILE"); return getenv(arg);
#endif #endif
} }

View File

@ -68,7 +68,7 @@ void blkid_debug_dump_dev(blkid_dev dev)
} }
printf(" dev: name = %s\n", dev->bid_name); 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: TIME=\"%lu\"\n", dev->bid_time);
printf(" dev: PRI=\"%d\"\n", dev->bid_pri); printf(" dev: PRI=\"%d\"\n", dev->bid_pri);
printf(" dev: flags = 0x%08X\n", dev->bid_flags); printf(" dev: flags = 0x%08X\n", dev->bid_flags);

View File

@ -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) { else if (S_ISBLK(st.st_mode) && st.st_rdev == devno) {
*devname = blkid_strdup(path); *devname = blkid_strdup(path);
DBG(DEBUG_DEVNO, DBG(DEBUG_DEVNO,
printf("found 0x%Lx at %s (%p)\n", devno, printf("found 0x%llx at %s (%p)\n", devno,
path, *devname)); path, *devname));
break; break;
} }
@ -183,7 +183,7 @@ char *blkid_devno_to_devname(dev_t devno)
(unsigned long) devno)); (unsigned long) devno));
} else { } else {
DBG(DEBUG_DEVNO, DBG(DEBUG_DEVNO,
printf("found devno 0x%04Lx as %s\n", devno, devname)); printf("found devno 0x%04llx as %s\n", devno, devname));
} }

View File

@ -98,7 +98,8 @@ static void get_ext2_info(blkid_dev dev, unsigned char *buf)
static int probe_ext3(int fd __BLKID_ATTR((unused)), static int probe_ext3(int fd __BLKID_ATTR((unused)),
blkid_cache cache __BLKID_ATTR((unused)), blkid_cache cache __BLKID_ATTR((unused)),
blkid_dev dev, 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; 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)), static int probe_ext2(int fd __BLKID_ATTR((unused)),
blkid_cache cache __BLKID_ATTR((unused)), blkid_cache cache __BLKID_ATTR((unused)),
blkid_dev dev, 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; struct ext2_super_block *es;
const char *sec_type = 0, *label = 0;
es = (struct ext2_super_block *)buf; es = (struct ext2_super_block *)buf;
@ -338,7 +339,6 @@ static int probe_swap1(int fd,
unsigned char *buf __BLKID_ATTR((unused))) unsigned char *buf __BLKID_ATTR((unused)))
{ {
struct swap_id_block *sws; struct swap_id_block *sws;
const char *label = 0;
probe_swap0(fd, cache, dev, id, buf); probe_swap0(fd, cache, dev, id, buf);
/* /*
@ -665,7 +665,7 @@ found_type:
blkid_set_tag(dev, "TYPE", type, 0); 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)); dev->bid_name, st.st_rdev, type));
} }

View File

@ -129,7 +129,7 @@ struct swap_id_block {
__u32 sws_lastpage; __u32 sws_lastpage;
__u32 sws_nrbad; __u32 sws_nrbad;
unsigned char sws_uuid[16]; unsigned char sws_uuid[16];
unsigned char sws_volume[16]; char sws_volume[16];
unsigned char sws_pad[117]; unsigned char sws_pad[117];
__u32 sws_badpg; __u32 sws_badpg;
}; };
@ -231,13 +231,13 @@ struct ocfs_volume_header {
unsigned char minor_version[4]; unsigned char minor_version[4];
unsigned char major_version[4]; unsigned char major_version[4];
unsigned char signature[128]; unsigned char signature[128];
unsigned char mount[128]; char mount[128];
unsigned char mount_len[2]; unsigned char mount_len[2];
}; };
struct ocfs_volume_label { struct ocfs_volume_label {
unsigned char disk_lock[48]; unsigned char disk_lock[48];
unsigned char label[64]; char label[64];
unsigned char label_len[2]; unsigned char label_len[2];
unsigned char vol_id[16]; unsigned char vol_id[16];
unsigned char vol_id_len[2]; unsigned char vol_id_len[2];
@ -256,7 +256,7 @@ struct ocfs2_super_block {
unsigned char signature[8]; unsigned char signature[8];
unsigned char s_dummy1[184]; unsigned char s_dummy1[184];
unsigned char s_dummy2[80]; unsigned char s_dummy2[80];
unsigned char s_label[64]; char s_label[64];
unsigned char s_uuid[16]; unsigned char s_uuid[16];
}; };