This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-daemon.git
The following commit(s) were added to refs/heads/master by this push:
new 23b96dd Fix warnings when building on MacOS
23b96dd is described below
commit 23b96dd31e2b53473f8b716ef41a00ea1e28d971
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Jan 7 18:01:04 2025 +0000
Fix warnings when building on MacOS
---
src/native/unix/native/arguments.c | 30 ++++++++++++------------------
1 file changed, 12 insertions(+), 18 deletions(-)
diff --git a/src/native/unix/native/arguments.c
b/src/native/unix/native/arguments.c
index 72c6ea0..267483f 100644
--- a/src/native/unix/native/arguments.c
+++ b/src/native/unix/native/arguments.c
@@ -450,35 +450,29 @@ static arg_data *parse(int argc, char *argv[])
static const char *IsYesNo(bool par)
{
- switch (par) {
- case false:
- return "No";
- case true:
- return "Yes";
+ if (par) {
+ return "Yes";
+ } else {
+ return "No";
}
- return "[Error]";
}
static const char *IsTrueFalse(bool par)
{
- switch (par) {
- case false:
- return "False";
- case true:
- return "True";
+ if (par) {
+ return "True";
+ } else {
+ return "False";
}
- return "[Error]";
}
static const char *IsEnabledDisabled(bool par)
{
- switch (par) {
- case true:
- return "Enabled";
- case false:
- return "Disabled";
+ if (par) {
+ return "Enabled";
+ } else {
+ return "Disabled";
}
- return "[Error]";
}
/* Main entry point: parse command line arguments and dump them */