Whamcloud - gitweb
AOSP: ext2simg: use bool where appropriate
authorEric Biggers <ebiggers@google.com>
Thu, 23 Mar 2023 00:44:21 +0000 (00:44 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 20 May 2024 16:57:14 +0000 (12:57 -0400)
For the values that get used as the 'bool' parameters of
sparse_file_write(), use 'bool' in ext2simg too.  No change in behavior.

Change-Id: I05f7d6fd3027eb10231c035f9fdc8e946e2c4c90
Signed-off-by: Eric Biggers <ebiggers@google.com>
From AOSP commit: 2728c6e766976acbf442d3721f2d93960e13682e

contrib/android/ext2simg.c

index 1bc2308..efb4e41 100644 (file)
 #include <sparse/sparse.h>
 
 struct {
-       int     crc;
-       int     sparse;
-       int     gzip;
+       bool    crc;
+       bool    sparse;
+       bool    gzip;
        char    *in_file;
        char    *out_file;
        bool    overwrite_input;
 } params = {
-       .crc        = 0,
-       .sparse     = 1,
-       .gzip       = 0,
+       .sparse     = true,
 };
 
 #define ext2fs_fatal(Retval, Format, ...) \
@@ -201,13 +199,13 @@ int main(int argc, char *argv[])
        while ((opt = getopt(argc, argv, "czS")) != -1) {
                switch(opt) {
                case 'c':
-                       params.crc = 1;
+                       params.crc = true;
                        break;
                case 'z':
-                       params.gzip = 1;
+                       params.gzip = true;
                        break;
                case 'S':
-                       params.sparse = 0;
+                       params.sparse = false;
                        break;
                default:
                        usage(argv[0]);