aboutsummaryrefslogtreecommitdiffstats
path: root/src/ReplayGainConfig.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-15 22:32:39 +0200
committerMax Kellermann <max@duempel.org>2013-10-15 22:49:01 +0200
commit7de96275dd6e3b6997e799413e4537561041e199 (patch)
tree4eab0c018168c14eb22f9e086917d16ef3f8f6a8 /src/ReplayGainConfig.cxx
parente13d0bf65653550c4cfe3f879441139f5242d8b1 (diff)
downloadmpd-7de96275dd6e3b6997e799413e4537561041e199.tar.gz
mpd-7de96275dd6e3b6997e799413e4537561041e199.tar.xz
mpd-7de96275dd6e3b6997e799413e4537561041e199.zip
ConfigData: use std::string for config_param::value
Diffstat (limited to 'src/ReplayGainConfig.cxx')
-rw-r--r--src/ReplayGainConfig.cxx21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/ReplayGainConfig.cxx b/src/ReplayGainConfig.cxx
index 9665c8fcf..840403923 100644
--- a/src/ReplayGainConfig.cxx
+++ b/src/ReplayGainConfig.cxx
@@ -85,25 +85,28 @@ void replay_gain_global_init(void)
{
const struct config_param *param = config_get_param(CONF_REPLAYGAIN);
- if (param != NULL && !replay_gain_set_mode_string(param->value)) {
+ if (param != NULL &&
+ !replay_gain_set_mode_string(param->value.c_str())) {
FormatFatalError("replaygain value \"%s\" at line %i is invalid\n",
- param->value, param->line);
+ param->value.c_str(), param->line);
}
param = config_get_param(CONF_REPLAYGAIN_PREAMP);
if (param) {
char *test;
- float f = strtod(param->value, &test);
+ float f = strtod(param->value.c_str(), &test);
if (*test != '\0') {
FormatFatalError("Replaygain preamp \"%s\" is not a number at "
- "line %i\n", param->value, param->line);
+ "line %i\n",
+ param->value.c_str(), param->line);
}
if (f < -15 || f > 15) {
FormatFatalError("Replaygain preamp \"%s\" is not between -15 and"
- "15 at line %i\n", param->value, param->line);
+ "15 at line %i\n",
+ param->value.c_str(), param->line);
}
replay_gain_preamp = pow(10, f / 20.0);
@@ -113,16 +116,18 @@ void replay_gain_global_init(void)
if (param) {
char *test;
- float f = strtod(param->value, &test);
+ float f = strtod(param->value.c_str(), &test);
if (*test != '\0') {
FormatFatalError("Replaygain missing preamp \"%s\" is not a number at "
- "line %i\n", param->value, param->line);
+ "line %i\n",
+ param->value.c_str(), param->line);
}
if (f < -15 || f > 15) {
FormatFatalError("Replaygain missing preamp \"%s\" is not between -15 and"
- "15 at line %i\n", param->value, param->line);
+ "15 at line %i\n",
+ param->value.c_str(), param->line);
}
replay_gain_missing_preamp = pow(10, f / 20.0);