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.
This commit is contained in:
parent
e6ae40982e
commit
c06ce44768
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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, ...)
|
||||
{
|
||||
|
@ -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);
|
||||
|
14
src/log.h
14
src/log.h
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user