]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
change function die, warn, inform and debug 484/head
authorYann Pomarede <yann.pomarede@gmail.com>
Tue, 28 Feb 2017 11:47:03 +0000 (12:47 +0100)
committerYann Pomarede <yann.pomarede@gmail.com>
Tue, 28 Feb 2017 11:47:03 +0000 (12:47 +0100)
change funcions die, warn, inform and debug argument from `char*` to `const char*` to prevent a warning in C==

common.c
common.h

index 53d7715e1b010f7477c7d8e07ba6d32aed46f4cb..0776407d0e4dd06638f7a16efb02c392bc57b0fe 100644 (file)
--- 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;
index d3beeb0d29684d097c224a6470158a6543260a38..19f0cb94e4938fe5607f04cf33450cf37cdd4601 100644 (file)
--- 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);