From bd6c0e57e4c522148b26817e8a2a1237e5ba6288 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 9 Sep 2019 17:52:08 -0700 Subject: [PATCH] Change 0/1 to true/false Found with clang-tidy --- src/autotune.c | 2 +- src/folder.c | 2 +- src/hashes.c | 12 ++++++------ src/hwmon.c | 2 +- src/potfile.c | 2 +- src/slow_candidates.c | 12 ++++++------ src/terminal.c | 4 ++-- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/autotune.c b/src/autotune.c index 24aa16979..bcf1ac33b 100644 --- a/src/autotune.c +++ b/src/autotune.c @@ -199,7 +199,7 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param u32 kernel_loops_max_reduced = kernel_loops_max; - if (1) + if (true) { double exec_msec = try_run (hashcat_ctx, device_param, kernel_accel_min, kernel_loops_min); diff --git a/src/folder.c b/src/folder.c index 27b4837cb..be81daed1 100644 --- a/src/folder.c +++ b/src/folder.c @@ -458,7 +458,7 @@ int folder_config_init (hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const char *ins hcfree (cpath); //if (getenv ("TMP") == NULL) - if (1) + if (true) { char *tmp; diff --git a/src/hashes.c b/src/hashes.c index a92af200e..2c0107ba5 100644 --- a/src/hashes.c +++ b/src/hashes.c @@ -887,10 +887,10 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) hlfmt_hash (hashcat_ctx, hashlist_format, input_buf, input_len, &hash_buf, &hash_len); - bool hash_fmt_error = 0; + bool hash_fmt_error = false; - if (hash_len < 1) hash_fmt_error = 1; - if (hash_buf == NULL) hash_fmt_error = 1; + if (hash_len < 1) hash_fmt_error = true; + if (hash_buf == NULL) hash_fmt_error = true; if (hash_fmt_error) { @@ -1034,10 +1034,10 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) hlfmt_hash (hashcat_ctx, hashlist_format, line_buf, line_len, &hash_buf, &hash_len); - bool hash_fmt_error = 0; + bool hash_fmt_error = false; - if (hash_len < 1) hash_fmt_error = 1; - if (hash_buf == NULL) hash_fmt_error = 1; + if (hash_len < 1) hash_fmt_error = true; + if (hash_buf == NULL) hash_fmt_error = true; if (hash_fmt_error) { diff --git a/src/hwmon.c b/src/hwmon.c index 905ce6e61..6d154280c 100644 --- a/src/hwmon.c +++ b/src/hwmon.c @@ -2557,7 +2557,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) if (hwmon_ctx->hm_sysfs) { - if (1) + if (true) { int hm_adapters_id = 0; diff --git a/src/potfile.c b/src/potfile.c index 58a247406..3a973ba07 100644 --- a/src/potfile.c +++ b/src/potfile.c @@ -247,7 +247,7 @@ void potfile_write_append (hashcat_ctx_t *hashcat_ctx, const char *out_buf, cons int tmp_len = 0; - if (1) + if (true) { memcpy (tmp_buf + tmp_len, out_buf, out_len); diff --git a/src/slow_candidates.c b/src/slow_candidates.c index 222cc4a92..6fef1fcdd 100644 --- a/src/slow_candidates.c +++ b/src/slow_candidates.c @@ -35,7 +35,7 @@ void slow_candidates_seek (hashcat_ctx_t *hashcat_ctx, void *extra_info, const u char *line_buf = NULL; u32 line_len = 0; - while (1) + while (true) { HCFILE *fp = &extra_info_straight->fp; @@ -86,7 +86,7 @@ void slow_candidates_seek (hashcat_ctx_t *hashcat_ctx, void *extra_info, const u char *line_buf = NULL; u32 line_len = 0; - while (1) + while (true) { get_next_word (hashcat_ctx, base_fp, &line_buf, &line_len); @@ -121,7 +121,7 @@ void slow_candidates_seek (hashcat_ctx_t *hashcat_ctx, void *extra_info, const u char *line_buf = extra_info_combi->scratch_buf; u32 line_len = 0; - while (1) + while (true) { line_len = (u32) fgetl (combs_fp, line_buf, HCBUFSIZ_LARGE); @@ -174,7 +174,7 @@ void slow_candidates_next (hashcat_ctx_t *hashcat_ctx, void *extra_info) char *line_buf = NULL; u32 line_len = 0; - while (1) + while (true) { HCFILE *fp = &extra_info_straight->fp; @@ -246,7 +246,7 @@ void slow_candidates_next (hashcat_ctx_t *hashcat_ctx, void *extra_info) char *line_buf = NULL; u32 line_len = 0; - while (1) + while (true) { get_next_word (hashcat_ctx, base_fp, &line_buf, &line_len); @@ -284,7 +284,7 @@ void slow_candidates_next (hashcat_ctx_t *hashcat_ctx, void *extra_info) char *line_buf = extra_info_combi->scratch_buf; u32 line_len = 0; - while (1) + while (true) { line_len = (u32) fgetl (combs_fp, line_buf, HCBUFSIZ_LARGE); diff --git a/src/terminal.c b/src/terminal.c index e0ae0137f..208117b08 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -555,7 +555,7 @@ void example_hashes (hashcat_ctx_t *hashcat_ctx) { event_log_info (hashcat_ctx, "HASH: %s", hashconfig->st_hash); - if (need_hexify ((const u8 *) hashconfig->st_pass, strlen (hashconfig->st_pass), user_options->separator, 0)) + if (need_hexify ((const u8 *) hashconfig->st_pass, strlen (hashconfig->st_pass), user_options->separator, false)) { char tmp_buf[HCBUFSIZ_LARGE] = { 0 }; @@ -615,7 +615,7 @@ void example_hashes (hashcat_ctx_t *hashcat_ctx) { event_log_info (hashcat_ctx, "HASH: %s", hashconfig->st_hash); - if (need_hexify ((const u8 *) hashconfig->st_pass, strlen (hashconfig->st_pass), user_options->separator, 0)) + if (need_hexify ((const u8 *) hashconfig->st_pass, strlen (hashconfig->st_pass), user_options->separator, false)) { char tmp_buf[HCBUFSIZ_LARGE] = { 0 };