summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-01-17 10:56:42 +0100
committerMax Kellermann <max@musicpd.org>2018-01-17 11:08:03 +0100
commitd588da69e57dad3bff8a90735736601de288a971 (patch)
treeb269133638ca25ef27476562a2bda77dd6e22eaf
parentec54a5c72c92d20ca3fa69717ca4ab197ed8552b (diff)
CommandLine: convert pointer to reference
-rw-r--r--src/CommandLine.cxx12
-rw-r--r--src/CommandLine.hxx2
-rw-r--r--src/Main.cxx2
3 files changed, 8 insertions, 8 deletions
diff --git a/src/CommandLine.cxx b/src/CommandLine.cxx
index a9e1c56a0..b3b54e735 100644
--- a/src/CommandLine.cxx
+++ b/src/CommandLine.cxx
@@ -303,7 +303,7 @@ bool ConfigLoader::TryFile(const AllocatedPath &base_path,
}
void
-ParseCommandLine(int argc, char **argv, struct options *options)
+ParseCommandLine(int argc, char **argv, struct options &options)
{
bool use_config_file = true;
@@ -313,7 +313,7 @@ ParseCommandLine(int argc, char **argv, struct options *options)
while ((option_index = parser.Next()) >= 0) {
switch (Option(option_index)) {
case OPTION_KILL:
- options->kill = true;
+ options.kill = true;
break;
case OPTION_NO_CONFIG:
@@ -321,16 +321,16 @@ ParseCommandLine(int argc, char **argv, struct options *options)
break;
case OPTION_NO_DAEMON:
- options->daemon = false;
+ options.daemon = false;
break;
case OPTION_STDOUT:
case OPTION_STDERR:
- options->log_stderr = true;
+ options.log_stderr = true;
break;
case OPTION_VERBOSE:
- options->verbose = true;
+ options.verbose = true;
break;
case OPTION_VERSION:
@@ -344,7 +344,7 @@ ParseCommandLine(int argc, char **argv, struct options *options)
/* initialize the logging library, so the configuration file
parser can use it already */
- log_early_init(options->verbose);
+ log_early_init(options.verbose);
if (!use_config_file) {
LogDebug(cmdline_domain,
diff --git a/src/CommandLine.hxx b/src/CommandLine.hxx
index 1f270d757..2db067988 100644
--- a/src/CommandLine.hxx
+++ b/src/CommandLine.hxx
@@ -28,6 +28,6 @@ struct options {
};
void
-ParseCommandLine(int argc, char **argv, struct options *options);
+ParseCommandLine(int argc, char **argv, struct options &options);
#endif
diff --git a/src/Main.cxx b/src/Main.cxx
index 195acce33..9a4a0ec8a 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -469,7 +469,7 @@ try {
ReadConfigFile(config_path);
}
#else
- ParseCommandLine(argc, argv, &options);
+ ParseCommandLine(argc, argv, options);
#endif
const auto config = LoadConfig();