Whamcloud - gitweb
Add a bunch of type fixes for debug/"make check" code paths.
authorMatthias Andree <matthias.andree@gmx.de>
Mon, 29 May 2006 23:48:51 +0000 (01:48 +0200)
committerMatthias Andree <matthias.andree@gmx.de>
Mon, 29 May 2006 23:48:51 +0000 (01:48 +0200)
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
lib/blkid/dev.c
lib/blkid/devno.c
lib/blkid/probe.c
lib/blkid/read.c
lib/blkid/tag.c
lib/blkid/tst_types.c

index ea2ccea..770632b 100644 (file)
@@ -68,8 +68,8 @@ void blkid_debug_dump_dev(blkid_dev dev)
        }
 
        printf("  dev: name = %s\n", dev->bid_name);
-       printf("  dev: DEVNO=\"0x%0llx\"\n", dev->bid_devno);
-       printf("  dev: TIME=\"%ld\"\n", dev->bid_time);
+       printf("  dev: DEVNO=\"0x%0llx\"\n", (long long)dev->bid_devno);
+       printf("  dev: TIME=\"%ld\"\n", (long)dev->bid_time);
        printf("  dev: PRI=\"%d\"\n", dev->bid_pri);
        printf("  dev: flags = 0x%08X\n", dev->bid_flags);
 
@@ -196,7 +196,7 @@ extern int optind;
 void usage(char *prog)
 {
        fprintf(stderr, "Usage: %s [-f blkid_file] [-m debug_mask]\n", prog);
-       fprintf(stderr, "\tList all devices and exit\n", prog);
+       fprintf(stderr, "\tList all devices and exit\n");
        exit(1);
 }
 
@@ -219,7 +219,7 @@ int main(int argc, char **argv)
                case 'm':
                        blkid_debug_mask = strtoul (optarg, &tmp, 0);
                        if (*tmp) {
-                               fprintf(stderr, "Invalid debug mask: %d\n", 
+                               fprintf(stderr, "Invalid debug mask: %s\n", 
                                        optarg);
                                exit(1);
                        }
index 34fbdf6..bd9fc12 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%llx at %s (%p)\n", devno,
+                           printf("found 0x%llx at %s (%p)\n", (long long)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%04llx as %s\n", devno, devname));
+                   printf("found devno 0x%04llx as %s\n", (long long)devno, devname));
        }
        
 
@@ -224,7 +224,7 @@ int main(int argc, char** argv)
                }
                devno = makedev(major, minor);
        }
-       printf("Looking for device 0x%04Lx\n", devno);
+       printf("Looking for device 0x%04llx\n", (long long)devno);
        devname = blkid_devno_to_devname(devno);
        if (devname)
                free(devname);
index 17f71d0..e7fdc9c 100644 (file)
@@ -224,7 +224,7 @@ static char *no_name = "NO NAME    ";
 
 static unsigned char *search_fat_label(struct vfat_dir_entry *dir, int count)
 {
-       unsigned int i;
+       int i;
 
        for (i = 0; i < count; i++) {
                if (dir[i].name[0] == 0x00)
@@ -764,8 +764,8 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
                return dev;
 
        DBG(DEBUG_PROBE,
-           printf("need to revalidate %s (time since last check %lu)\n", 
-                  dev->bid_name, diff));
+           printf("need to revalidate %s (time since last check %llu)\n", 
+                  dev->bid_name, (unsigned long long)diff));
 
        if (((probe.fd = open(dev->bid_name, O_RDONLY)) < 0) ||
            (fstat(probe.fd, &st) < 0)) {
@@ -852,7 +852,7 @@ found_type:
                blkid_set_tag(dev, "TYPE", type, 0);
                                
                DBG(DEBUG_PROBE, printf("%s: devno 0x%04llx, type %s\n",
-                          dev->bid_name, st.st_rdev, type));
+                          dev->bid_name, (long long)st.st_rdev, type));
        }
 
        if (probe.sbbuf)
index 010d9f3..7a147f6 100644 (file)
@@ -452,8 +452,8 @@ static void debug_dump_dev(blkid_dev dev)
        }
 
        printf("  dev: name = %s\n", dev->bid_name);
-       printf("  dev: DEVNO=\"0x%0llx\"\n", dev->bid_devno);
-       printf("  dev: TIME=\"%ld\"\n", dev->bid_time);
+       printf("  dev: DEVNO=\"0x%0llx\"\n", (long long)dev->bid_devno);
+       printf("  dev: TIME=\"%lld\"\n", (long long)dev->bid_time);
        printf("  dev: PRI=\"%d\"\n", dev->bid_pri);
        printf("  dev: flags = 0x%08X\n", dev->bid_flags);
 
index b6539a8..a3c13b8 100644 (file)
@@ -386,7 +386,7 @@ void usage(char *prog)
        fprintf(stderr, "Usage: %s [-f blkid_file] [-m debug_mask] device "
                "[type value]\n", 
                prog);
-       fprintf(stderr, "\tList all tags for a device and exit\n", prog);
+       fprintf(stderr, "\tList all tags for a device and exit\n");
        exit(1);
 }
 
@@ -412,7 +412,7 @@ int main(int argc, char **argv)
                case 'm':
                        blkid_debug_mask = strtoul (optarg, &tmp, 0);
                        if (*tmp) {
-                               fprintf(stderr, "Invalid debug mask: %d\n", 
+                               fprintf(stderr, "Invalid debug mask: %s\n", 
                                        optarg);
                                exit(1);
                        }
index 53cfc81..7dadb1d 100644 (file)
 
 #include "blkid/blkid_types.h"
 
-main(int argc, char **argv)
+#include <stdlib.h>
+#include <stdio.h>
+
+int main(int argc, char **argv)
 {
        if (sizeof(__u8) != 1) {
                printf("Sizeof(__u8) is %d should be 1\n",