diff options
Diffstat (limited to 'src/config')
-rw-r--r-- | src/config/ConfigData.cxx | 6 | ||||
-rw-r--r-- | src/config/ConfigData.hxx | 4 | ||||
-rw-r--r-- | src/config/ConfigDefaults.hxx | 2 | ||||
-rw-r--r-- | src/config/ConfigError.cxx | 2 | ||||
-rw-r--r-- | src/config/ConfigError.hxx | 2 | ||||
-rw-r--r-- | src/config/ConfigFile.cxx | 2 | ||||
-rw-r--r-- | src/config/ConfigFile.hxx | 2 | ||||
-rw-r--r-- | src/config/ConfigGlobal.cxx | 3 | ||||
-rw-r--r-- | src/config/ConfigGlobal.hxx | 2 | ||||
-rw-r--r-- | src/config/ConfigOption.hxx | 2 | ||||
-rw-r--r-- | src/config/ConfigParser.cxx | 6 | ||||
-rw-r--r-- | src/config/ConfigParser.hxx | 2 | ||||
-rw-r--r-- | src/config/ConfigPath.cxx | 2 | ||||
-rw-r--r-- | src/config/ConfigPath.hxx | 2 | ||||
-rw-r--r-- | src/config/ConfigTemplates.cxx | 6 | ||||
-rw-r--r-- | src/config/ConfigTemplates.hxx | 2 |
16 files changed, 24 insertions, 23 deletions
diff --git a/src/config/ConfigData.cxx b/src/config/ConfigData.cxx index 70e1e55ed..95c54a294 100644 --- a/src/config/ConfigData.cxx +++ b/src/config/ConfigData.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -80,7 +80,7 @@ config_param::GetBlockParam(const char *name) const } } - return NULL; + return nullptr; } const char * @@ -152,7 +152,7 @@ bool config_param::GetBlockValue(const char *name, bool default_value) const { const block_param *bp = GetBlockParam(name); - if (bp == NULL) + if (bp == nullptr) return default_value; return bp->GetBoolValue(); diff --git a/src/config/ConfigData.hxx b/src/config/ConfigData.hxx index e42d674ba..e794c044f 100644 --- a/src/config/ConfigData.hxx +++ b/src/config/ConfigData.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -109,7 +109,7 @@ struct config_param { const char *default_value=nullptr) const; /** - * Same as config_dup_path(), but looks up the setting in the + * Same as config_get_path(), but looks up the setting in the * specified block. */ AllocatedPath GetBlockPath(const char *name, const char *default_value, diff --git a/src/config/ConfigDefaults.hxx b/src/config/ConfigDefaults.hxx index c50f28c91..2dca5d469 100644 --- a/src/config/ConfigDefaults.hxx +++ b/src/config/ConfigDefaults.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify diff --git a/src/config/ConfigError.cxx b/src/config/ConfigError.cxx index 70aff7175..b2a773b15 100644 --- a/src/config/ConfigError.cxx +++ b/src/config/ConfigError.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify diff --git a/src/config/ConfigError.hxx b/src/config/ConfigError.hxx index cbfa79df3..89543599d 100644 --- a/src/config/ConfigError.hxx +++ b/src/config/ConfigError.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify diff --git a/src/config/ConfigFile.cxx b/src/config/ConfigFile.cxx index 1329c4cd4..75b3c7851 100644 --- a/src/config/ConfigFile.cxx +++ b/src/config/ConfigFile.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify diff --git a/src/config/ConfigFile.hxx b/src/config/ConfigFile.hxx index b87182c6a..30bee0614 100644 --- a/src/config/ConfigFile.hxx +++ b/src/config/ConfigFile.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify diff --git a/src/config/ConfigGlobal.cxx b/src/config/ConfigGlobal.cxx index 9bc83398c..281c841a4 100644 --- a/src/config/ConfigGlobal.cxx +++ b/src/config/ConfigGlobal.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -38,6 +38,7 @@ void config_global_finish(void) { for (auto i : config_data.params) delete i; + config_data.params.fill(0); } void config_global_init(void) diff --git a/src/config/ConfigGlobal.hxx b/src/config/ConfigGlobal.hxx index 831418d03..ac7d5c4fd 100644 --- a/src/config/ConfigGlobal.hxx +++ b/src/config/ConfigGlobal.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify diff --git a/src/config/ConfigOption.hxx b/src/config/ConfigOption.hxx index 8eb4c7eaf..1c177acf0 100644 --- a/src/config/ConfigOption.hxx +++ b/src/config/ConfigOption.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify diff --git a/src/config/ConfigParser.cxx b/src/config/ConfigParser.cxx index 3535c9a13..40afe1edd 100644 --- a/src/config/ConfigParser.cxx +++ b/src/config/ConfigParser.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -23,8 +23,8 @@ bool get_bool(const char *value, bool *value_r) { - static const char *t[] = { "yes", "true", "1", nullptr }; - static const char *f[] = { "no", "false", "0", nullptr }; + static const char *const t[] = { "yes", "true", "1", nullptr }; + static const char *const f[] = { "no", "false", "0", nullptr }; if (string_array_contains(t, value)) { *value_r = true; diff --git a/src/config/ConfigParser.hxx b/src/config/ConfigParser.hxx index 06151b0bd..c696801f5 100644 --- a/src/config/ConfigParser.hxx +++ b/src/config/ConfigParser.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify diff --git a/src/config/ConfigPath.cxx b/src/config/ConfigPath.cxx index a3b3f83a5..c10b3a1d5 100644 --- a/src/config/ConfigPath.cxx +++ b/src/config/ConfigPath.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify diff --git a/src/config/ConfigPath.hxx b/src/config/ConfigPath.hxx index a5518a497..afd3e0435 100644 --- a/src/config/ConfigPath.hxx +++ b/src/config/ConfigPath.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify diff --git a/src/config/ConfigTemplates.cxx b/src/config/ConfigTemplates.cxx index 58ee56425..1949a5ff1 100644 --- a/src/config/ConfigTemplates.cxx +++ b/src/config/ConfigTemplates.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -19,6 +19,7 @@ #include "ConfigTemplates.hxx" #include "ConfigOption.hxx" +#include "util/Macros.hxx" #include <string.h> @@ -81,8 +82,7 @@ const ConfigTemplate config_templates[] = { { "neighbors", true, true }, }; -static constexpr unsigned n_config_templates = - sizeof(config_templates) / sizeof(config_templates[0]); +static constexpr unsigned n_config_templates = ARRAY_SIZE(config_templates); static_assert(n_config_templates == unsigned(CONF_MAX), "Wrong number of config_templates"); diff --git a/src/config/ConfigTemplates.hxx b/src/config/ConfigTemplates.hxx index 90d098dc0..f034773e3 100644 --- a/src/config/ConfigTemplates.hxx +++ b/src/config/ConfigTemplates.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify |