From 7de96275dd6e3b6997e799413e4537561041e199 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 15 Oct 2013 22:32:39 +0200 Subject: ConfigData: use std::string for config_param::value --- src/ReplayGainConfig.cxx | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/ReplayGainConfig.cxx') 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); -- cgit v1.2.3