]> wimlib.net Git - wimlib/blobdiff - programs/imagex.c
Fix some compiler warnings
[wimlib] / programs / imagex.c
index fb9201cb330889776eb1cc75030e5dd98dff1837..2d664084606ae10c8e2d09eb99e2e76ea820bafa 100644 (file)
@@ -1011,8 +1011,6 @@ static int imagex_join(int argc, const char **argv)
 {
        int c;
        int flags = WIMLIB_OPEN_FLAG_SPLIT_OK | WIMLIB_OPEN_FLAG_SHOW_PROGRESS;
 {
        int c;
        int flags = WIMLIB_OPEN_FLAG_SPLIT_OK | WIMLIB_OPEN_FLAG_SHOW_PROGRESS;
-       int image;
-       int ret;
        const char *output_path;
 
        for_opt(c, join_options) {
        const char *output_path;
 
        for_opt(c, join_options) {
@@ -1042,7 +1040,6 @@ err:
 /* Mounts an image using a FUSE mount. */
 static int imagex_mount_rw_or_ro(int argc, const char **argv)
 {
 /* Mounts an image using a FUSE mount. */
 static int imagex_mount_rw_or_ro(int argc, const char **argv)
 {
-       bool ro;
        int c;
        int mount_flags = 0;
        int open_flags = WIMLIB_OPEN_FLAG_SHOW_PROGRESS;
        int c;
        int mount_flags = 0;
        int open_flags = WIMLIB_OPEN_FLAG_SHOW_PROGRESS;
@@ -1064,14 +1061,16 @@ static int imagex_mount_rw_or_ro(int argc, const char **argv)
                        mount_flags |= WIMLIB_MOUNT_FLAG_DEBUG;
                        break;
                default:
                        mount_flags |= WIMLIB_MOUNT_FLAG_DEBUG;
                        break;
                default:
-                       usage(ro ? MOUNT : MOUNTRW);
+                       usage((mount_flags & WIMLIB_MOUNT_FLAG_READWRITE)  
+                                       ? MOUNTRW : MOUNT);
                        return -1;
                }
        }
        argc -= optind;
        argv += optind;
        if (argc != 2 && argc != 3) {
                        return -1;
                }
        }
        argc -= optind;
        argv += optind;
        if (argc != 2 && argc != 3) {
-               usage(ro ? MOUNT : MOUNTRW);
+               usage((mount_flags & WIMLIB_MOUNT_FLAG_READWRITE)  
+                               ? MOUNTRW : MOUNT);
                return -1;
        }
 
                return -1;
        }
 
@@ -1087,7 +1086,8 @@ static int imagex_mount_rw_or_ro(int argc, const char **argv)
                if (num_images != 1) {
                        imagex_error("The file `%s' contains %d images; Please "
                                        "select one.\n", wimfile, num_images);
                if (num_images != 1) {
                        imagex_error("The file `%s' contains %d images; Please "
                                        "select one.\n", wimfile, num_images);
-                       usage(ro ? MOUNT : MOUNTRW);
+                       usage((mount_flags & WIMLIB_MOUNT_FLAG_READWRITE)  
+                                       ? MOUNTRW : MOUNT);
                        ret = WIMLIB_ERR_INVALID_IMAGE;
                        goto done;
                }
                        ret = WIMLIB_ERR_INVALID_IMAGE;
                        goto done;
                }