Whamcloud - gitweb
Fix gcc -Wall nits in the blkid library.
authorTheodore Ts'o <tytso@mit.edu>
Sat, 7 May 2005 18:38:10 +0000 (14:38 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 7 May 2005 18:38:10 +0000 (14:38 -0400)
lib/blkid/ChangeLog
lib/blkid/cache.c
lib/blkid/dev.c
lib/blkid/devno.c
lib/blkid/probe.c
lib/blkid/probe.h

index 6bb62b2..40c7d12 100644 (file)
@@ -1,5 +1,7 @@
 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
                code so that we don't use the inline functions DEB_DUMP_*
                and instead use the private functions blkid_debug_dump_*().
index 497b0fe..b43be60 100644 (file)
@@ -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
 }
 
index 3ac3195..66a3923 100644 (file)
@@ -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);
index e665e38..34fbdf6 100644 (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) {
                        *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));
        }
        
 
index a67598e..6756e97 100644 (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)), 
                      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));
        }
 
index e545ef1..ab175ea 100644 (file)
@@ -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];
 };