summaryrefslogtreecommitdiff
path: root/src/config
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2016-10-28 11:38:37 +0200
committerMax Kellermann <max@musicpd.org>2016-10-28 11:38:37 +0200
commit5b2b4bf13c73dc88a1b1c43651fb3e2c707227fd (patch)
tree143be3e3f9c16254076ed8c8bc61760d5c5768d1 /src/config
parent4bd67bc298fa5214eb2572d8a7c04ba0c24ac60b (diff)
config/Param: use CamelCase
Diffstat (limited to 'src/config')
-rw-r--r--src/config/ConfigFile.cxx10
-rw-r--r--src/config/ConfigGlobal.cxx16
-rw-r--r--src/config/ConfigGlobal.hxx6
-rw-r--r--src/config/Data.hxx4
-rw-r--r--src/config/Param.cxx4
-rw-r--r--src/config/Param.hxx16
6 files changed, 28 insertions, 28 deletions
diff --git a/src/config/ConfigFile.cxx b/src/config/ConfigFile.cxx
index 490de0bed..9eca2ac9b 100644
--- a/src/config/ConfigFile.cxx
+++ b/src/config/ConfigFile.cxx
@@ -145,11 +145,11 @@ ReadConfigBlock(ConfigData &config_data, BufferedReader &reader,
gcc_nonnull_all
static void
-Append(config_param *&head, config_param *p)
+Append(ConfigParam *&head, ConfigParam *p)
{
assert(p->next == nullptr);
- config_param **i = &head;
+ auto **i = &head;
while (*i != nullptr)
i = &(*i)->next;
@@ -163,10 +163,10 @@ ReadConfigParam(ConfigData &config_data, BufferedReader &reader,
{
const unsigned i = unsigned(o);
const ConfigTemplate &option = config_param_templates[i];
- config_param *&head = config_data.params[i];
+ auto *&head = config_data.params[i];
if (head != nullptr && !option.repeatable) {
- struct config_param *param = head;
+ auto *param = head;
throw FormatRuntimeError("config parameter \"%s\" is first defined "
"on line %d and redefined on line %u\n",
name, param->line,
@@ -184,7 +184,7 @@ ReadConfigParam(ConfigData &config_data, BufferedReader &reader,
throw FormatRuntimeError("line %u: Unknown tokens after value",
reader.GetLineNumber());
- auto *param = new config_param(value, reader.GetLineNumber());
+ auto *param = new ConfigParam(value, reader.GetLineNumber());
Append(head, param);
}
diff --git a/src/config/ConfigGlobal.cxx b/src/config/ConfigGlobal.cxx
index 23f356638..05290024b 100644
--- a/src/config/ConfigGlobal.cxx
+++ b/src/config/ConfigGlobal.cxx
@@ -75,10 +75,10 @@ void config_global_check(void)
Check(*p);
}
-const config_param *
+const ConfigParam *
config_get_param(ConfigOption option)
{
- config_param *param = config_data.params[unsigned(option)];
+ auto *param = config_data.params[unsigned(option)];
if (param != nullptr)
param->used = true;
return param;
@@ -113,7 +113,7 @@ config_find_block(ConfigBlockOption option, const char *key, const char *value)
const char *
config_get_string(ConfigOption option, const char *default_value)
{
- const struct config_param *param = config_get_param(option);
+ const auto *param = config_get_param(option);
if (param == nullptr)
return default_value;
@@ -124,7 +124,7 @@ config_get_string(ConfigOption option, const char *default_value)
AllocatedPath
config_get_path(ConfigOption option, Error &error)
{
- const struct config_param *param = config_get_param(option);
+ const auto *param = config_get_param(option);
if (param == nullptr)
return AllocatedPath::Null();
@@ -132,7 +132,7 @@ config_get_path(ConfigOption option, Error &error)
}
AllocatedPath
-config_parse_path(const struct config_param *param, Error & error)
+config_parse_path(const ConfigParam *param, Error & error)
{
AllocatedPath path = ParsePath(param->value.c_str(), error);
if (gcc_unlikely(path.IsNull()))
@@ -145,7 +145,7 @@ config_parse_path(const struct config_param *param, Error & error)
unsigned
config_get_unsigned(ConfigOption option, unsigned default_value)
{
- const struct config_param *param = config_get_param(option);
+ const auto *param = config_get_param(option);
long value;
char *endptr;
@@ -163,7 +163,7 @@ config_get_unsigned(ConfigOption option, unsigned default_value)
unsigned
config_get_positive(ConfigOption option, unsigned default_value)
{
- const struct config_param *param = config_get_param(option);
+ const auto *param = config_get_param(option);
long value;
char *endptr;
@@ -184,7 +184,7 @@ config_get_positive(ConfigOption option, unsigned default_value)
bool
config_get_bool(ConfigOption option, bool default_value)
{
- const struct config_param *param = config_get_param(option);
+ const auto *param = config_get_param(option);
bool success, value;
if (param == nullptr)
diff --git a/src/config/ConfigGlobal.hxx b/src/config/ConfigGlobal.hxx
index 38c9d4d47..5d97302a3 100644
--- a/src/config/ConfigGlobal.hxx
+++ b/src/config/ConfigGlobal.hxx
@@ -26,7 +26,7 @@
class Error;
class Path;
class AllocatedPath;
-struct config_param;
+struct ConfigParam;
struct ConfigBlock;
void
@@ -46,7 +46,7 @@ void
ReadConfigFile(Path path);
gcc_pure
-const config_param *
+const ConfigParam *
config_get_param(enum ConfigOption option);
gcc_pure
@@ -90,7 +90,7 @@ config_get_path(enum ConfigOption option, Error &error);
* not be parsed, returns AllocatedPath::Null() and sets the error.
*/
AllocatedPath
-config_parse_path(const struct config_param *param, Error & error_r);
+config_parse_path(const ConfigParam *param, Error & error_r);
gcc_pure
unsigned
diff --git a/src/config/Data.hxx b/src/config/Data.hxx
index ef4fc126c..20efec4ac 100644
--- a/src/config/Data.hxx
+++ b/src/config/Data.hxx
@@ -24,11 +24,11 @@
#include <array>
-struct config_param;
+struct ConfigParam;
struct ConfigBlock;
struct ConfigData {
- std::array<config_param *, std::size_t(ConfigOption::MAX)> params;
+ std::array<ConfigParam *, std::size_t(ConfigOption::MAX)> params;
std::array<ConfigBlock *, std::size_t(ConfigBlockOption::MAX)> blocks;
void Clear();
diff --git a/src/config/Param.cxx b/src/config/Param.cxx
index 9c292c6de..a3959c330 100644
--- a/src/config/Param.cxx
+++ b/src/config/Param.cxx
@@ -20,10 +20,10 @@
#include "config.h"
#include "Param.hxx"
-config_param::config_param(const char *_value, int _line)
+ConfigParam::ConfigParam(const char *_value, int _line)
:next(nullptr), value(_value), line(_line), used(false) {}
-config_param::~config_param()
+ConfigParam::~ConfigParam()
{
delete next;
}
diff --git a/src/config/Param.hxx b/src/config/Param.hxx
index d66bd8aa3..469bcc79a 100644
--- a/src/config/Param.hxx
+++ b/src/config/Param.hxx
@@ -25,12 +25,12 @@
#include <string>
-struct config_param {
+struct ConfigParam {
/**
- * The next config_param with the same name. The destructor
+ * The next ConfigParam with the same name. The destructor
* deletes the whole chain.
*/
- struct config_param *next;
+ ConfigParam *next;
std::string value;
@@ -42,17 +42,17 @@ struct config_param {
*/
bool used;
- explicit config_param(int _line=-1)
+ explicit ConfigParam(int _line=-1)
:next(nullptr), line(_line), used(false) {}
gcc_nonnull_all
- config_param(const char *_value, int _line=-1);
+ ConfigParam(const char *_value, int _line=-1);
- config_param(const config_param &) = delete;
+ ConfigParam(const ConfigParam &) = delete;
- ~config_param();
+ ~ConfigParam();
- config_param &operator=(const config_param &) = delete;
+ ConfigParam &operator=(const ConfigParam &) = delete;
/**
* Determine if this is a "null" instance, i.e. an empty