aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandan Babu R <chandan.babu@oracle.com>2023-11-06 18:40:36 +0530
committerCarlos Maiolino <cem@kernel.org>2023-11-21 14:09:36 +0100
commitc7196b8bb24a065553c70ccaedf02329903a18e4 (patch)
treec54b67fdd2ef47562a32654abed97b7ee28f4082
parent0d3650b23a3a79a03c1e4968593ec695b6d575ff (diff)
downloadxfsprogs-dev-c7196b8bb24a065553c70ccaedf02329903a18e4.tar.gz
metadump: Declare boolean variables with bool type
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: Chandan Babu R <chandan.babu@oracle.com> Signed-off-by: Carlos Maiolino <cem@kernel.org>
-rw-r--r--db/metadump.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/db/metadump.c b/db/metadump.c
index dab14e592f..14eda6880c 100644
--- a/db/metadump.c
+++ b/db/metadump.c
@@ -52,13 +52,13 @@ static int cur_index;
static xfs_ino_t cur_ino;
-static int show_progress = 0;
-static int stop_on_read_error = 0;
+static bool show_progress = false;
+static bool stop_on_read_error = false;
static int max_extent_size = DEFAULT_MAX_EXT_SIZE;
-static int obfuscate = 1;
-static int zero_stale_data = 1;
-static int show_warnings = 0;
-static int progress_since_warning = 0;
+static bool obfuscate = true;
+static bool zero_stale_data = true;
+static bool show_warnings = false;
+static bool progress_since_warning = false;
static bool stdout_metadump;
void
@@ -101,7 +101,7 @@ print_warning(const char *fmt, ...)
fprintf(stderr, "%s%s: %s\n", progress_since_warning ? "\n" : "",
progname, buf);
- progress_since_warning = 0;
+ progress_since_warning = false;
}
static void
@@ -122,7 +122,7 @@ print_progress(const char *fmt, ...)
f = stdout_metadump ? stderr : stdout;
fprintf(f, "\r%-59s", buf);
fflush(f);
- progress_since_warning = 1;
+ progress_since_warning = true;
}
/*
@@ -2659,9 +2659,9 @@ metadump_f(
char *p;
exitcode = 1;
- show_progress = 0;
- show_warnings = 0;
- stop_on_read_error = 0;
+ show_progress = false;
+ show_warnings = false;
+ stop_on_read_error = false;
if (mp->m_sb.sb_magicnum != XFS_SB_MAGIC) {
print_warning("bad superblock magic number %x, giving up",
@@ -2682,13 +2682,13 @@ metadump_f(
while ((c = getopt(argc, argv, "aegm:ow")) != EOF) {
switch (c) {
case 'a':
- zero_stale_data = 0;
+ zero_stale_data = false;
break;
case 'e':
- stop_on_read_error = 1;
+ stop_on_read_error = true;
break;
case 'g':
- show_progress = 1;
+ show_progress = true;
break;
case 'm':
max_extent_size = (int)strtol(optarg, &p, 0);
@@ -2699,10 +2699,10 @@ metadump_f(
}
break;
case 'o':
- obfuscate = 0;
+ obfuscate = false;
break;
case 'w':
- show_warnings = 1;
+ show_warnings = true;
break;
default:
print_warning("bad option for metadump command");