installer: Raise WARNS to 6 and fix resulting warnings.
authorSascha Wildner <saw@online.de>
Tue, 28 Sep 2010 01:18:50 +0000 (03:18 +0200)
committerSascha Wildner <saw@online.de>
Tue, 28 Sep 2010 01:19:15 +0000 (03:19 +0200)
usr.sbin/installer/Makefile.inc
usr.sbin/installer/dfuibe_installer/fn_subpart_hammer.c
usr.sbin/installer/dfuibe_installer/fn_subpart_ufs.c
usr.sbin/installer/dfuibe_installer/fn_zonetab.c
usr.sbin/installer/libdfui/system.c
usr.sbin/installer/libinstaller/diskutil.c
usr.sbin/installer/libinstaller/diskutil.h
usr.sbin/installer/libinstaller/survey.c

index 1f5b79a..01b5f23 100644 (file)
@@ -1,3 +1 @@
-WARNS?=        2
-
 .include "../Makefile.inc"
index fcd71d7..d919b2f 100644 (file)
@@ -262,7 +262,7 @@ static int
 check_capacity(struct i_fn_args *a)
 {
        struct subpartition *sp;
-       unsigned long min_capacity[] = {128, 0, DISK_MIN - 128, 0};
+       long min_capacity[] = {128, 0, DISK_MIN - 128, 0};
        unsigned long total_capacity = 0;
        unsigned long remaining_capacity;
        int mtpt, warn_smallpart = 0;
index af96982..8bcf37a 100644 (file)
@@ -268,7 +268,7 @@ static int
 check_capacity(struct i_fn_args *a)
 {
        struct subpartition *sp;
-       unsigned long min_capacity[] = {256, 0, 16, 0, 1536, 0, 0};
+       long min_capacity[] = {256, 0, 16, 0, 1536, 0, 0};
        unsigned long total_capacity = 0;
        int mtpt;
 
index 1508760..bdb344d 100644 (file)
 
 char *
 zt_readfile(char *buf, int len, FILE *f) {
-       int i;
+       int i = 0;
        char *cs;
 
+       /* XXX this is kinda ugly */
        cs = buf;
        while (--len > 0 && (i = getc(f)) != EOF)
                *(cs++) = i;
index e617375..ec1fe23 100644 (file)
@@ -16,7 +16,7 @@
 #include "system.h"
 
 char *
-ostype()
+ostype(void)
 {
        int mib[2];
        size_t len;
@@ -31,7 +31,7 @@ ostype()
 }
 
 int
-has_caps()
+has_caps(void)
 {
 #ifdef HAS_CAPS
        return 1;
@@ -40,7 +40,7 @@ has_caps()
 }
 
 int
-has_npipe()
+has_npipe(void)
 {
 #ifdef HAS_NPIPE
        return 1;
@@ -50,7 +50,7 @@ has_npipe()
 }
 
 int
-has_tcp()
+has_tcp(void)
 {
 #ifdef HAS_TCP
        return 1;
index 4f38148..93db553 100644 (file)
@@ -109,7 +109,7 @@ storage_set_memsize(struct storage *s, unsigned long memsize)
        s->ram = memsize;
 }
 
-unsigned long
+long
 storage_get_memsize(const struct storage *s)
 {
        return(s->ram);
@@ -783,7 +783,7 @@ subpartition_get_bsize(const struct subpartition *sp)
        return(sp->bsize);
 }
 
-unsigned long
+long
 subpartition_get_capacity(const struct subpartition *sp)
 {
        return(sp->capacity);
index 4b972be..e9405c8 100644 (file)
@@ -60,7 +60,7 @@ struct storage {
        struct disk *disk_tail;
        struct disk *selected_disk;
        struct slice *selected_slice;
-       unsigned long ram;                      /* amount of physical memory in MB */
+       long ram;                       /* amount of physical memory in MB */
 };
 
 struct disk {
@@ -117,7 +117,7 @@ struct subpartition {
 struct storage         *storage_new(void);
 void                    storage_free(struct storage *);
 void                    storage_set_memsize(struct storage *, unsigned long);
-unsigned long           storage_get_memsize(const struct storage *);
+long                    storage_get_memsize(const struct storage *);
 struct disk            *storage_disk_first(const struct storage *);
 void                    storage_set_selected_disk(struct storage *, struct disk *);
 struct disk            *storage_get_selected_disk(const struct storage *);
@@ -172,7 +172,7 @@ const char          *subpartition_get_device_name(const struct subpartition *);
 char                    subpartition_get_letter(const struct subpartition *);
 unsigned long           subpartition_get_fsize(const struct subpartition *);
 unsigned long           subpartition_get_bsize(const struct subpartition *);
-unsigned long           subpartition_get_capacity(const struct subpartition *);
+long                    subpartition_get_capacity(const struct subpartition *);
 int                     subpartition_is_swap(const struct subpartition *);
 int                     subpartition_is_softupdated(const struct subpartition *);
 int                     subpartition_is_tmpfsbacked(const struct subpartition *);
index 95bae98..edbdfb4 100644 (file)
@@ -296,7 +296,7 @@ survey_storage(struct i_fn_args *a)
                                disk_set_serno(d, line);
                } else if (strcmp(line, "@SLICES") == 0) {
                        int cyl, hd, sec;
-                       int number, type, flags;
+                       int sliceno, type, flags;
                        unsigned long start, size;
 
                        /*
@@ -306,18 +306,19 @@ survey_storage(struct i_fn_args *a)
                         */
                        while (d != NULL && strcmp(line, "@END") != 0 && fgets_chomp(line, 255, f)) {
                                if (strncmp(line, "/dev/", 5) == 0) {
+                                       cyl = hd = sec = 0;
                                        parse_geometry_info(line, &cyl, &hd, &sec);
                                        disk_set_geometry(d, cyl, hd, sec);
                                } else if (strncmp(line, "Part", 4) == 0) {
                                        /* ignore it */
                                } else {
-                                       if (parse_slice_info(line, &number, &start, &size,
+                                       if (parse_slice_info(line, &sliceno, &start, &size,
                                            &type, &flags)) {
                                                /*
                                                fprintfo(log, "| Found slice #%d, sysid %d, "
-                                                   "start %ld, size %ld\n", number, type, start, size);
+                                                   "start %ld, size %ld\n", sliceno, type, start, size);
                                                */
-                                               slice_new(d, number, type, flags, start, size);
+                                               slice_new(d, sliceno, type, flags, start, size);
                                        }
                                }
                        }