From: Yann Pomarede Date: Tue, 28 Feb 2017 11:47:03 +0000 (+0100) Subject: change function die, warn, inform and debug X-Git-Tag: 3.1.d1~3^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F484%2Fhead;p=thirdparty%2Fshairport-sync.git change function die, warn, inform and debug change funcions die, warn, inform and debug argument from `char*` to `const char*` to prevent a warning in C== --- diff --git a/common.c b/common.c index 53d7715e..0776407d 100644 --- a/common.c +++ b/common.c @@ -91,7 +91,7 @@ int get_requested_connection_state_to_output() { return requested_connection_sta void set_requested_connection_state_to_output(int v) { requested_connection_state_to_output = v; } -void die(char *format, ...) { +void die(const char *format, ...) { char s[1024]; s[0] = 0; va_list args; @@ -103,7 +103,7 @@ void die(char *format, ...) { exit(1); } -void warn(char *format, ...) { +void warn(const char *format, ...) { char s[1024]; s[0] = 0; va_list args; @@ -113,7 +113,7 @@ void warn(char *format, ...) { daemon_log(LOG_WARNING, "%s", s); } -void debug(int level, char *format, ...) { +void debug(int level, const char *format, ...) { if (level > debuglev) return; char s[1024]; @@ -125,7 +125,7 @@ void debug(int level, char *format, ...) { daemon_log(LOG_DEBUG, "%s", s); } -void inform(char *format, ...) { +void inform(const char *format, ...) { char s[1024]; s[0] = 0; va_list args; diff --git a/common.h b/common.h index d3beeb0d..19f0cb94 100644 --- a/common.h +++ b/common.h @@ -172,10 +172,10 @@ uint64_t ranarray64u(); int64_t ranarray64i(); extern int debuglev; -void die(char *format, ...); -void warn(char *format, ...); -void inform(char *format, ...); -void debug(int level, char *format, ...); +void die(const char *format, ...); +void warn(const char *format, ...); +void inform(const char *format, ...); +void debug(int level, const char *format, ...); uint8_t *base64_dec(char *input, int *outlen); char *base64_enc(uint8_t *input, int length);