From 29030b54c98b0aee65fbc10ebf7ba36bed98c02c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 10 Aug 2013 18:02:44 +0200 Subject: util/Error: new error passing library Replaces GLib's GError. --- src/ConfigGlobal.cxx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/ConfigGlobal.cxx') diff --git a/src/ConfigGlobal.cxx b/src/ConfigGlobal.cxx index 1f89a1283..0bf2b4433 100644 --- a/src/ConfigGlobal.cxx +++ b/src/ConfigGlobal.cxx @@ -24,6 +24,7 @@ #include "ConfigFile.hxx" #include "ConfigPath.hxx" #include "fs/Path.hxx" +#include "util/Error.hxx" #include "mpd_error.h" #include @@ -47,9 +48,9 @@ void config_global_init(void) } bool -ReadConfigFile(const Path &path, GError **error_r) +ReadConfigFile(const Path &path, Error &error) { - return ReadConfigFile(config_data, path, error_r); + return ReadConfigFile(config_data, path, error); } static void @@ -98,20 +99,16 @@ config_get_string(ConfigOption option, const char *default_value) } Path -config_get_path(ConfigOption option, GError **error_r) +config_get_path(ConfigOption option, Error &error) { - assert(error_r != NULL); - assert(*error_r == NULL); - const struct config_param *param = config_get_param(option); if (param == NULL) return Path::Null(); - Path path = ParsePath(param->value, error_r); + Path path = ParsePath(param->value, error); if (gcc_unlikely(path.IsNull())) - g_prefix_error(error_r, - "Invalid path at line %i: ", - param->line); + error.FormatPrefix("Invalid path at line %i: ", + param->line); return path; } -- cgit v1.2.3