From 9637d9449091632f158f8e2be8afbad4bda200fc Mon Sep 17 00:00:00 2001 From: David Steele Date: Tue, 2 May 2023 09:37:42 +0300 Subject: [PATCH] Use boolean variant constants where possible instead of redeclaring. --- src/command/restore/restore.c | 4 ++-- test/src/module/command/repoTest.c | 2 +- test/src/module/common/typeVariantTest.c | 2 +- test/src/module/config/parseTest.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/command/restore/restore.c b/src/command/restore/restore.c index 668a2298b..3fb39789d 100644 --- a/src/command/restore/restore.c +++ b/src/command/restore/restore.c @@ -84,8 +84,8 @@ restorePathValidate(void) strZ(cfgOptionDisplay(cfgOptPgPath))); // Disable delta and force so restore will fail if the directories are not empty - cfgOptionSet(cfgOptDelta, cfgSourceDefault, VARBOOL(false)); - cfgOptionSet(cfgOptForce, cfgSourceDefault, VARBOOL(false)); + cfgOptionSet(cfgOptDelta, cfgSourceDefault, BOOL_FALSE_VAR); + cfgOptionSet(cfgOptForce, cfgSourceDefault, BOOL_FALSE_VAR); } } MEM_CONTEXT_TEMP_END(); diff --git a/test/src/module/command/repoTest.c b/test/src/module/command/repoTest.c index 381fd9a23..596e79cce 100644 --- a/test/src/module/command/repoTest.c +++ b/test/src/module/command/repoTest.c @@ -160,7 +160,7 @@ testRun(void) // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("recurse"); - cfgOptionSet(cfgOptRecurse, cfgSourceParam, VARBOOL(true)); + cfgOptionSet(cfgOptRecurse, cfgSourceParam, BOOL_TRUE_VAR); output = bufNew(0); cfgOptionSet(cfgOptOutput, cfgSourceParam, VARUINT64(CFGOPTVAL_OUTPUT_TEXT)); diff --git a/test/src/module/common/typeVariantTest.c b/test/src/module/common/typeVariantTest.c index 0b9e363ec..7b636dc5f 100644 --- a/test/src/module/common/typeVariantTest.c +++ b/test/src/module/common/typeVariantTest.c @@ -31,7 +31,7 @@ testRun(void) TEST_RESULT_BOOL(varBool(BOOL_FALSE_VAR), false, "false bool variant"); // ------------------------------------------------------------------------------------------------------------------------- - TEST_RESULT_BOOL(varBoolForce(VARBOOL(false)), false, "force bool to bool"); + TEST_RESULT_BOOL(varBoolForce(BOOL_FALSE_VAR), false, "force bool to bool"); TEST_RESULT_BOOL(varBoolForce(VARINT(1)), true, "force int to bool"); TEST_RESULT_BOOL(varBoolForce(VARUINT(0)), false, "force uint to bool"); TEST_RESULT_BOOL(varBoolForce(VARINT64(false)), false, "force int64 to bool"); diff --git a/test/src/module/config/parseTest.c b/test/src/module/config/parseTest.c index 8d9db5304..1910b1cc7 100644 --- a/test/src/module/config/parseTest.c +++ b/test/src/module/config/parseTest.c @@ -1991,7 +1991,7 @@ testRun(void) // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("cfgOptionSet() and cfgOptionIdxSet()"); - TEST_RESULT_VOID(cfgOptionSet(cfgOptForce, cfgSourceParam, VARBOOL(false)), "set boolean"); + TEST_RESULT_VOID(cfgOptionSet(cfgOptForce, cfgSourceParam, BOOL_FALSE_VAR), "set boolean"); TEST_RESULT_BOOL(cfgOptionBool(cfgOptForce), false, "check boolean"); TEST_RESULT_VOID(cfgOptionSet(cfgOptProtocolTimeout, cfgSourceParam, VARINT64(1000)), "set protocol-timeout to 1");