diff options
author | Thomas Jansen <mithi@mithi.net> | 2008-12-02 03:00:02 +0100 |
---|---|---|
committer | Thomas Jansen <mithi@mithi.net> | 2008-12-02 03:00:02 +0100 |
commit | c06ce44768d6fd5a87b97d9c8ab6df10dd692eb6 (patch) | |
tree | 654ac296c574154b71d72e0eabd1a4c4fa123141 | |
parent | e6ae40982e89053a4326058e726422ef7602bd1a (diff) | |
download | mpd-c06ce44768d6fd5a87b97d9c8ab6df10dd692eb6.tar.gz mpd-c06ce44768d6fd5a87b97d9c8ab6df10dd692eb6.tar.xz mpd-c06ce44768d6fd5a87b97d9c8ab6df10dd692eb6.zip |
replaced mpd_printf etc by G_GNUC_PRINTF
We want to remove gcc.h eventually. This takes care of all the G_GNUC_PRINTF
macros.
-rw-r--r-- | src/client.c | 2 | ||||
-rw-r--r-- | src/client.h | 5 | ||||
-rw-r--r-- | src/command.c | 8 | ||||
-rw-r--r-- | src/command.h | 5 | ||||
-rw-r--r-- | src/log.c | 4 | ||||
-rw-r--r-- | src/log.h | 14 |
6 files changed, 17 insertions, 21 deletions
diff --git a/src/client.c b/src/client.c index 991f0d0b2..f654797b7 100644 --- a/src/client.c +++ b/src/client.c @@ -760,7 +760,7 @@ void client_vprintf(struct client *client, const char *fmt, va_list args) free(buffer); } -mpd_fprintf void client_printf(struct client *client, const char *fmt, ...) +G_GNUC_PRINTF(2, 3) void client_printf(struct client *client, const char *fmt, ...) { va_list args; diff --git a/src/client.h b/src/client.h index 9c7031820..196afe7fa 100644 --- a/src/client.h +++ b/src/client.h @@ -19,8 +19,7 @@ #ifndef MPD_CLIENT_H #define MPD_CLIENT_H -#include "gcc.h" - +#include <glib.h> #include <stdbool.h> #include <stddef.h> #include <stdarg.h> @@ -65,7 +64,7 @@ void client_vprintf(struct client *client, const char *fmt, va_list args); /** * Write a printf-like formatted string to the client. */ -mpd_fprintf void client_printf(struct client *client, const char *fmt, ...); +G_GNUC_PRINTF(2, 3) void client_printf(struct client *client, const char *fmt, ...); /** * Adds the specified idle flags to all clients and immediately sends diff --git a/src/command.c b/src/command.c index 6b01fd45d..c725282aa 100644 --- a/src/command.c +++ b/src/command.c @@ -102,8 +102,8 @@ static void command_error_v(struct client *client, enum ack error, current_command = NULL; } -mpd_fprintf_ void command_error(struct client *client, enum ack error, - const char *fmt, ...) +G_GNUC_PRINTF(3, 4) void command_error(struct client *client, enum ack error, + const char *fmt, ...) { va_list args; va_start(args, fmt); @@ -111,7 +111,7 @@ mpd_fprintf_ void command_error(struct client *client, enum ack error, va_end(args); } -static bool mpd_fprintf__ +static bool G_GNUC_PRINTF(4, 5) check_uint32(struct client *client, uint32_t *dst, const char *s, const char *fmt, ...) { @@ -128,7 +128,7 @@ check_uint32(struct client *client, uint32_t *dst, return true; } -static bool mpd_fprintf__ +static bool G_GNUC_PRINTF(4, 5) check_int(struct client *client, int *value_r, const char *s, const char *fmt, ...) { diff --git a/src/command.h b/src/command.h index ac557b2fc..b67e9567e 100644 --- a/src/command.h +++ b/src/command.h @@ -19,7 +19,6 @@ #ifndef MPD_COMMAND_H #define MPD_COMMAND_H -#include "gcc.h" #include "ack.h" #include <glib.h> @@ -47,7 +46,7 @@ command_process(struct client *client, char *commandString); void command_success(struct client *client); -mpd_fprintf_ void command_error(struct client *client, enum ack error, - const char *fmt, ...); +G_GNUC_PRINTF(3, 4) void command_error(struct client *client, enum ack error, + const char *fmt, ...); #endif @@ -164,7 +164,7 @@ void setup_log_output(bool use_stdout) } #define log_func(func,level) \ -mpd_printf void func(const char *fmt, ...) \ +G_GNUC_PRINTF(1, 2) void func(const char *fmt, ...) \ { \ if (level <= (int)log_threshold) { \ va_list args; \ @@ -182,7 +182,7 @@ log_func(DEBUG, G_LOG_LEVEL_DEBUG) #undef log_func -mpd_printf G_GNUC_NORETURN void FATAL(const char *fmt, ...) +G_GNUC_PRINTF(1, 2) G_GNUC_NORETURN void FATAL(const char *fmt, ...) { va_list args; va_start(args, fmt); @@ -19,17 +19,15 @@ #ifndef MPD_LOG_H #define MPD_LOG_H -#include "gcc.h" - #include <glib.h> #include <stdbool.h> -mpd_printf void ERROR(const char *fmt, ...); -mpd_printf void LOG(const char *fmt, ...); -mpd_printf void SECURE(const char *fmt, ...); -mpd_printf void DEBUG(const char *fmt, ...); -mpd_printf void WARNING(const char *fmt, ...); -mpd_printf G_GNUC_NORETURN void FATAL(const char *fmt, ...); +G_GNUC_PRINTF(1, 2) void ERROR(const char *fmt, ...); +G_GNUC_PRINTF(1, 2) void LOG(const char *fmt, ...); +G_GNUC_PRINTF(1, 2) void SECURE(const char *fmt, ...); +G_GNUC_PRINTF(1, 2) void DEBUG(const char *fmt, ...); +G_GNUC_PRINTF(1, 2) void WARNING(const char *fmt, ...); +G_GNUC_PRINTF(1, 2) G_GNUC_NORETURN void FATAL(const char *fmt, ...); void initLog(bool verbose); |