mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Replace GCC_FMT_ATTR with G_GNUC_PRINTF
One less qemu-specific macro. It also helps to make some headers/units only depend on glib, and thus moved in standalone projects eventually. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
This commit is contained in:
+2
-2
@@ -72,7 +72,7 @@ struct alsa_params_obt {
|
||||
snd_pcm_uframes_t samples;
|
||||
};
|
||||
|
||||
static void GCC_FMT_ATTR (2, 3) alsa_logerr (int err, const char *fmt, ...)
|
||||
static void G_GNUC_PRINTF (2, 3) alsa_logerr (int err, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
@@ -83,7 +83,7 @@ static void GCC_FMT_ATTR (2, 3) alsa_logerr (int err, const char *fmt, ...)
|
||||
AUD_log (AUDIO_CAP, "Reason: %s\n", snd_strerror (err));
|
||||
}
|
||||
|
||||
static void GCC_FMT_ATTR (3, 4) alsa_logerr2 (
|
||||
static void G_GNUC_PRINTF (3, 4) alsa_logerr2 (
|
||||
int err,
|
||||
const char *typ,
|
||||
const char *fmt,
|
||||
|
||||
+2
-2
@@ -91,8 +91,8 @@ typedef struct QEMUAudioTimeStamp {
|
||||
uint64_t old_ts;
|
||||
} QEMUAudioTimeStamp;
|
||||
|
||||
void AUD_vlog (const char *cap, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0);
|
||||
void AUD_log (const char *cap, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
|
||||
void AUD_vlog (const char *cap, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0);
|
||||
void AUD_log (const char *cap, const char *fmt, ...) G_GNUC_PRINTF(2, 3);
|
||||
|
||||
void AUD_register_card (const char *name, QEMUSoundCard *card);
|
||||
void AUD_remove_card (QEMUSoundCard *card);
|
||||
|
||||
+2
-2
@@ -211,7 +211,7 @@ static void coreaudio_logstatus (OSStatus status)
|
||||
AUD_log (AUDIO_CAP, "Reason: %s\n", str);
|
||||
}
|
||||
|
||||
static void GCC_FMT_ATTR (2, 3) coreaudio_logerr (
|
||||
static void G_GNUC_PRINTF (2, 3) coreaudio_logerr (
|
||||
OSStatus status,
|
||||
const char *fmt,
|
||||
...
|
||||
@@ -226,7 +226,7 @@ static void GCC_FMT_ATTR (2, 3) coreaudio_logerr (
|
||||
coreaudio_logstatus (status);
|
||||
}
|
||||
|
||||
static void GCC_FMT_ATTR (3, 4) coreaudio_logerr2 (
|
||||
static void G_GNUC_PRINTF (3, 4) coreaudio_logerr2 (
|
||||
OSStatus status,
|
||||
const char *typ,
|
||||
const char *fmt,
|
||||
|
||||
+2
-2
@@ -222,7 +222,7 @@ static void dsound_log_hresult (HRESULT hr)
|
||||
AUD_log (AUDIO_CAP, "Reason: %s\n", str);
|
||||
}
|
||||
|
||||
static void GCC_FMT_ATTR (2, 3) dsound_logerr (
|
||||
static void G_GNUC_PRINTF (2, 3) dsound_logerr (
|
||||
HRESULT hr,
|
||||
const char *fmt,
|
||||
...
|
||||
@@ -237,7 +237,7 @@ static void GCC_FMT_ATTR (2, 3) dsound_logerr (
|
||||
dsound_log_hresult (hr);
|
||||
}
|
||||
|
||||
static void GCC_FMT_ATTR (3, 4) dsound_logerr2 (
|
||||
static void G_GNUC_PRINTF (3, 4) dsound_logerr2 (
|
||||
HRESULT hr,
|
||||
const char *typ,
|
||||
const char *fmt,
|
||||
|
||||
+2
-2
@@ -63,7 +63,7 @@ struct oss_params {
|
||||
int fragsize;
|
||||
};
|
||||
|
||||
static void GCC_FMT_ATTR (2, 3) oss_logerr (int err, const char *fmt, ...)
|
||||
static void G_GNUC_PRINTF (2, 3) oss_logerr (int err, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
@@ -74,7 +74,7 @@ static void GCC_FMT_ATTR (2, 3) oss_logerr (int err, const char *fmt, ...)
|
||||
AUD_log (AUDIO_CAP, "Reason: %s\n", strerror (err));
|
||||
}
|
||||
|
||||
static void GCC_FMT_ATTR (3, 4) oss_logerr2 (
|
||||
static void G_GNUC_PRINTF (3, 4) oss_logerr2 (
|
||||
int err,
|
||||
const char *typ,
|
||||
const char *fmt,
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ typedef struct {
|
||||
|
||||
static void qpa_conn_fini(PAConnection *c);
|
||||
|
||||
static void GCC_FMT_ATTR (2, 3) qpa_logerr (int err, const char *fmt, ...)
|
||||
static void G_GNUC_PRINTF (2, 3) qpa_logerr (int err, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ typedef struct SDLVoiceIn {
|
||||
SDL_AudioDeviceID devid;
|
||||
} SDLVoiceIn;
|
||||
|
||||
static void GCC_FMT_ATTR (1, 2) sdl_logerr (const char *fmt, ...)
|
||||
static void G_GNUC_PRINTF (1, 2) sdl_logerr (const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ typedef struct BlkverifyRequest {
|
||||
QEMUIOVector *raw_qiov; /* cloned I/O vector for raw file */
|
||||
} BlkverifyRequest;
|
||||
|
||||
static void GCC_FMT_ATTR(2, 3) blkverify_err(BlkverifyRequest *r,
|
||||
static void G_GNUC_PRINTF(2, 3) blkverify_err(BlkverifyRequest *r,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
+1
-1
@@ -838,7 +838,7 @@ int qcow2_update_header(BlockDriverState *bs);
|
||||
|
||||
void qcow2_signal_corruption(BlockDriverState *bs, bool fatal, int64_t offset,
|
||||
int64_t size, const char *message_format, ...)
|
||||
GCC_FMT_ATTR(5, 6);
|
||||
G_GNUC_PRINTF(5, 6);
|
||||
|
||||
int qcow2_validate_table(BlockDriverState *bs, uint64_t offset,
|
||||
uint64_t entries, size_t entry_len,
|
||||
|
||||
+2
-2
@@ -108,7 +108,7 @@ static void ssh_state_free(BDRVSSHState *s)
|
||||
}
|
||||
}
|
||||
|
||||
static void GCC_FMT_ATTR(3, 4)
|
||||
static void G_GNUC_PRINTF(3, 4)
|
||||
session_error_setg(Error **errp, BDRVSSHState *s, const char *fs, ...)
|
||||
{
|
||||
va_list args;
|
||||
@@ -133,7 +133,7 @@ session_error_setg(Error **errp, BDRVSSHState *s, const char *fs, ...)
|
||||
g_free(msg);
|
||||
}
|
||||
|
||||
static void GCC_FMT_ATTR(3, 4)
|
||||
static void G_GNUC_PRINTF(3, 4)
|
||||
sftp_error_setg(Error **errp, BDRVSSHState *s, const char *fs, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
+1
-1
@@ -175,7 +175,7 @@ abi_long do_netbsd_syscall(void *cpu_env, int num, abi_long arg1,
|
||||
abi_long do_openbsd_syscall(void *cpu_env, int num, abi_long arg1,
|
||||
abi_long arg2, abi_long arg3, abi_long arg4,
|
||||
abi_long arg5, abi_long arg6);
|
||||
void gemu_log(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
|
||||
void gemu_log(const char *fmt, ...) G_GNUC_PRINTF(1, 2);
|
||||
extern __thread CPUState *thread_cpu;
|
||||
void cpu_loop(CPUArchState *env);
|
||||
char *target_strerror(int err);
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ void v9fs_string_free(V9fsString *str)
|
||||
str->size = 0;
|
||||
}
|
||||
|
||||
void GCC_FMT_ATTR(2, 3)
|
||||
void G_GNUC_PRINTF(2, 3)
|
||||
v9fs_string_sprintf(V9fsString *str, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
@@ -57,7 +57,7 @@ static bool is_daemon;
|
||||
static bool get_version; /* IOC getversion IOCTL supported */
|
||||
static char *prog_name;
|
||||
|
||||
static void GCC_FMT_ATTR(2, 3) do_log(int loglevel, const char *format, ...)
|
||||
static void G_GNUC_PRINTF(2, 3) do_log(int loglevel, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
|
||||
+1
-1
@@ -203,7 +203,7 @@ void v9fs_path_free(V9fsPath *path)
|
||||
}
|
||||
|
||||
|
||||
void GCC_FMT_ATTR(2, 3)
|
||||
void G_GNUC_PRINTF(2, 3)
|
||||
v9fs_path_sprintf(V9fsPath *path, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
+2
-2
@@ -207,7 +207,7 @@ build_append_nameseg(GArray *array, const char *seg)
|
||||
g_array_append_vals(array, "____", ACPI_NAMESEG_LEN - len);
|
||||
}
|
||||
|
||||
static void GCC_FMT_ATTR(2, 0)
|
||||
static void G_GNUC_PRINTF(2, 0)
|
||||
build_append_namestringv(GArray *array, const char *format, va_list ap)
|
||||
{
|
||||
char *s;
|
||||
@@ -270,7 +270,7 @@ build_append_namestringv(GArray *array, const char *format, va_list ap)
|
||||
g_strfreev(segs);
|
||||
}
|
||||
|
||||
GCC_FMT_ATTR(2, 3)
|
||||
G_GNUC_PRINTF(2, 3)
|
||||
static void build_append_namestring(GArray *array, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
+1
-1
@@ -149,7 +149,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(PCIQXLDevice, PCI_QXL)
|
||||
/* qxl.c */
|
||||
void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL phys, int group_id);
|
||||
void qxl_set_guest_bug(PCIQXLDevice *qxl, const char *msg, ...)
|
||||
GCC_FMT_ATTR(2, 3);
|
||||
G_GNUC_PRINTF(2, 3);
|
||||
|
||||
void qxl_spice_update_area(PCIQXLDevice *qxl, uint32_t surface_id,
|
||||
struct QXLRect *area, struct QXLRect *dirty_rects,
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ static struct _loaderparams {
|
||||
const char *initrd_filename;
|
||||
} loaderparams;
|
||||
|
||||
static void GCC_FMT_ATTR(3, 4) prom_set(uint32_t *prom_buf, int index,
|
||||
static void G_GNUC_PRINTF(3, 4) prom_set(uint32_t *prom_buf, int index,
|
||||
const char *string, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
+1
-1
@@ -995,7 +995,7 @@ static void write_bootloader(uint8_t *base, uint64_t run_addr,
|
||||
|
||||
}
|
||||
|
||||
static void GCC_FMT_ATTR(3, 4) prom_set(uint32_t *prom_buf, int index,
|
||||
static void G_GNUC_PRINTF(3, 4) prom_set(uint32_t *prom_buf, int index,
|
||||
const char *string, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
fprintf(stderr, "%s ROCKER: " fmt, nowstr, ## __VA_ARGS__);\
|
||||
} while (0)
|
||||
#else
|
||||
static inline GCC_FMT_ATTR(1, 2) int DPRINTF(const char *fmt, ...)
|
||||
static inline G_GNUC_PRINTF(1, 2) int DPRINTF(const char *fmt, ...)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@
|
||||
# define DPRINTF(fmt, ...) \
|
||||
do { fprintf(stderr, "RTL8139: " fmt, ## __VA_ARGS__); } while (0)
|
||||
#else
|
||||
static inline GCC_FMT_ATTR(1, 2) int DPRINTF(const char *fmt, ...)
|
||||
static inline G_GNUC_PRINTF(1, 2) int DPRINTF(const char *fmt, ...)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user