diff options
author | Max Kellermann <max@duempel.org> | 2015-01-21 22:19:36 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-01-21 22:19:36 +0100 |
commit | a38f02541d82ce27666e27bf7e3123bff621ca70 (patch) | |
tree | 1180a760127795137085a9c332b50bd997deb5a6 | |
parent | fdba76ba47920a5dc1cc23f0be3131e4b85a041a (diff) | |
download | mpd-a38f02541d82ce27666e27bf7e3123bff621ca70.tar.gz mpd-a38f02541d82ce27666e27bf7e3123bff621ca70.tar.xz mpd-a38f02541d82ce27666e27bf7e3123bff621ca70.zip |
config/Param: make "line" signed
Diffstat (limited to '')
-rw-r--r-- | src/LogInit.cxx | 8 | ||||
-rw-r--r-- | src/config/Param.hxx | 4 | ||||
-rw-r--r-- | src/output/plugins/ShoutOutputPlugin.cxx | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/LogInit.cxx b/src/LogInit.cxx index d9fd846fa..b154bcec4 100644 --- a/src/LogInit.cxx +++ b/src/LogInit.cxx @@ -72,14 +72,14 @@ open_log_file(void) } static bool -log_init_file(unsigned line, Error &error) +log_init_file(int line, Error &error) { assert(!out_path.IsNull()); out_fd = open_log_file(); if (out_fd < 0) { const std::string out_path_utf8 = out_path.ToUTF8(); - error.FormatErrno("failed to open log file \"%s\" (config line %u)", + error.FormatErrno("failed to open log file \"%s\" (config line %d)", out_path_utf8.c_str(), line); return false; } @@ -89,7 +89,7 @@ log_init_file(unsigned line, Error &error) } static inline LogLevel -parse_log_level(const char *value, unsigned line) +parse_log_level(const char *value, int line) { if (0 == strcmp(value, "default")) return LogLevel::DEFAULT; @@ -98,7 +98,7 @@ parse_log_level(const char *value, unsigned line) else if (0 == strcmp(value, "verbose")) return LogLevel::DEBUG; else { - FormatFatalError("unknown log level \"%s\" at line %u", + FormatFatalError("unknown log level \"%s\" at line %d", value, line); } } diff --git a/src/config/Param.hxx b/src/config/Param.hxx index 7f3737494..a3cd3f83a 100644 --- a/src/config/Param.hxx +++ b/src/config/Param.hxx @@ -38,7 +38,7 @@ struct config_param { std::string value; - unsigned int line; + int line; std::vector<BlockParam> block_params; @@ -66,7 +66,7 @@ struct config_param { * configuration file. */ bool IsNull() const { - return line == unsigned(-1); + return line < 0; } gcc_nonnull_all diff --git a/src/output/plugins/ShoutOutputPlugin.cxx b/src/output/plugins/ShoutOutputPlugin.cxx index f9070026e..9157afd37 100644 --- a/src/output/plugins/ShoutOutputPlugin.cxx +++ b/src/output/plugins/ShoutOutputPlugin.cxx @@ -97,7 +97,7 @@ require_block_string(const config_param ¶m, const char *name) const char *value = param.GetBlockValue(name); if (value == nullptr) FormatFatalError("no \"%s\" defined for shout device defined " - "at line %u\n", name, param.line); + "at line %d\n", name, param.line); return value; } |