diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2009-05-13 17:53:17 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2009-05-13 17:53:17 +0000 |
commit | 001faf3269541f0231482e0fccc846f62f8930b2 (patch) | |
tree | a5a7b0143f3fd9d71e42eb03c4967f8763ec3501 | |
parent | 4cfce484c5d7e514c23689f3194055b5463d6054 (diff) | |
download | qemu-001faf3269541f0231482e0fccc846f62f8930b2.zip qemu-001faf3269541f0231482e0fccc846f62f8930b2.tar.gz qemu-001faf3269541f0231482e0fccc846f62f8930b2.tar.bz2 |
Replace gcc variadic macro extension with C99 version
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
70 files changed, 268 insertions, 268 deletions
diff --git a/block-raw-posix.c b/block-raw-posix.c index 0663c06..bcb3e01 100644 --- a/block-raw-posix.c +++ b/block-raw-posix.c @@ -73,10 +73,10 @@ //#define DEBUG_BLOCK #if defined(DEBUG_BLOCK) -#define DEBUG_BLOCK_PRINT(formatCstr, args...) do { if (qemu_log_enabled()) \ - { qemu_log(formatCstr, ##args); qemu_log_flush(); } } while (0) +#define DEBUG_BLOCK_PRINT(formatCstr, ...) do { if (qemu_log_enabled()) \ + { qemu_log(formatCstr, ## __VA_ARGS__); qemu_log_flush(); } } while (0) #else -#define DEBUG_BLOCK_PRINT(formatCstr, args...) +#define DEBUG_BLOCK_PRINT(formatCstr, ...) #endif /* OS X does not have O_DSYNC */ diff --git a/darwin-user/main.c b/darwin-user/main.c index 51c6aa0..5e3c48d 100644 --- a/darwin-user/main.c +++ b/darwin-user/main.c @@ -158,12 +158,12 @@ int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, target_ulong val) return -1; } -#define EXCP_DUMP(env, fmt, args...) \ -do { \ - fprintf(stderr, fmt , ##args); \ - cpu_dump_state(env, stderr, fprintf, 0); \ - qemu_log(fmt, ##args); \ - log_cpu_state(env, 0); \ +#define EXCP_DUMP(env, fmt, ...) \ +do { \ + fprintf(stderr, fmt , ## __VA_ARGS__); \ + cpu_dump_state(env, stderr, fprintf, 0); \ + qemu_log(fmt, ## __VA_ARGS__); \ + log_cpu_state(env, 0); \ } while (0) void cpu_loop(CPUPPCState *env) diff --git a/darwin-user/syscall.c b/darwin-user/syscall.c index 130d33c..0c68787 100644 --- a/darwin-user/syscall.c +++ b/darwin-user/syscall.c @@ -627,7 +627,7 @@ static inline void byteswap_winsize(struct winsize *w) tswap16s(&w->ws_ypixel); } -#define STRUCT(name, list...) STRUCT_ ## name, +#define STRUCT(name, ...) STRUCT_ ## name, #define STRUCT_SPECIAL(name) STRUCT_ ## name, enum { #include "ioctls_types.h" @@ -635,7 +635,7 @@ enum { #undef STRUCT #undef STRUCT_SPECIAL -#define STRUCT(name, list...) const argtype struct_ ## name ## _def[] = { list, TYPE_NULL }; +#define STRUCT(name, ...) const argtype struct_ ## name ## _def[] = { __VA_ARGS__, TYPE_NULL }; #define STRUCT_SPECIAL(name) #include "ioctls_types.h" #undef STRUCT @@ -656,8 +656,8 @@ typedef struct IOCTLEntry { #define MAX_STRUCT_SIZE 4096 static IOCTLEntry ioctl_entries[] = { -#define IOCTL(cmd, access, types...) \ - { cmd, cmd, #cmd, access, { types } }, +#define IOCTL(cmd, access, ...) \ + { cmd, cmd, #cmd, access, { __VA_ARGS__ } }, #include "ioctls.h" { 0, 0, }, }; @@ -898,10 +898,10 @@ typedef long (*syscall_function_t)(void *cpu_env, int num); #define WRAPPER_CALL_DIRECT_6(function, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) long __qemu_##function(void *cpu_env) { int i = 0; typeof(_arg1) arg1 = _arg1; typeof(_arg2) arg2 = _arg2; typeof(_arg3) arg3 = _arg3; typeof(_arg4) arg4 = _arg4; typeof(_arg5) arg5 = _arg5; typeof(_arg6) arg6 = _arg6; return (long)function(arg1, arg2, arg3, arg4, arg5, arg6); } #define WRAPPER_CALL_DIRECT_7(function, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) long __qemu_##function(void *cpu_env) { int i = 0; typeof(_arg1) arg1 = _arg1; typeof(_arg2) arg2 = _arg2; typeof(_arg3) arg3 = _arg3; typeof(_arg4) arg4 = _arg4; typeof(_arg5) arg5 = _arg5; typeof(_arg6) arg6 = _arg6; typeof(_arg7) arg7 = _arg7; return (long)function(arg1, arg2, arg3, arg4, arg5, arg6, arg7); } #define WRAPPER_CALL_DIRECT_8(function, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) long __qemu_##function(void *cpu_env) { int i = 0; typeof(_arg1) arg1 = _arg1; typeof(_arg2) arg2 = _arg2; typeof(_arg3) arg3 = _arg3; typeof(_arg4) arg4 = _arg4; typeof(_arg5) arg5 = _arg5; typeof(_arg6) arg6 = _arg6; typeof(_arg7) arg7 = _arg7; typeof(_arg8) arg8 = _arg8; return (long)function(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); } -#define WRAPPER_CALL_DIRECT(function, nargs, args...) WRAPPER_CALL_DIRECT_##nargs(function, args) -#define WRAPPER_CALL_NOERRNO(function, nargs, args...) WRAPPER_CALL_DIRECT(function, nargs, args) -#define WRAPPER_CALL_INDIRECT(function, nargs, args...) -#define ENTRY(name, number, function, nargs, call_type, args...) WRAPPER_##call_type(function, nargs, args) +#define WRAPPER_CALL_DIRECT(function, nargs, ...) WRAPPER_CALL_DIRECT_##nargs(function, __VA_ARGS__) +#define WRAPPER_CALL_NOERRNO(function, nargs, ...) WRAPPER_CALL_DIRECT(function, nargs, __VA_ARGS__) +#define WRAPPER_CALL_INDIRECT(function, nargs, ...) +#define ENTRY(name, number, function, nargs, call_type, ...) WRAPPER_##call_type(function, nargs, __VA_ARGS__) #include "syscalls.h" @@ -926,7 +926,7 @@ typedef long (*syscall_function_t)(void *cpu_env, int num); #define ENTRY_CALL_DIRECT(name, number, function, nargs, call_type) _ENTRY(name, number, __qemu_##function, nargs, call_type) #define ENTRY_CALL_NOERRNO(name, number, function, nargs, call_type) ENTRY_CALL_DIRECT(name, number, function, nargs, call_type) #define ENTRY_CALL_INDIRECT(name, number, function, nargs, call_type) _ENTRY(name, number, function, nargs, call_type) -#define ENTRY(name, number, function, nargs, call_type, args...) ENTRY_##call_type(name, number, function, nargs, call_type) +#define ENTRY(name, number, function, nargs, call_type, ...) ENTRY_##call_type(name, number, function, nargs, call_type) #define CALL_DIRECT 1 #define CALL_INDIRECT 2 @@ -29,10 +29,10 @@ //#define DEBUG_ADB #ifdef DEBUG_ADB -#define ADB_DPRINTF(fmt, args...) \ -do { printf("ADB: " fmt , ##args); } while (0) +#define ADB_DPRINTF(fmt, ...) \ +do { printf("ADB: " fmt , ## __VA_ARGS__); } while (0) #else -#define ADB_DPRINTF(fmt, args...) +#define ADB_DPRINTF(fmt, ...) #endif /* ADB commands */ diff --git a/hw/apb_pci.c b/hw/apb_pci.c index 36ecb55..d6ce9f4 100644 --- a/hw/apb_pci.c +++ b/hw/apb_pci.c @@ -33,10 +33,10 @@ //#define DEBUG_APB #ifdef DEBUG_APB -#define APB_DPRINTF(fmt, args...) \ -do { printf("APB: " fmt , ##args); } while (0) +#define APB_DPRINTF(fmt, ...) \ +do { printf("APB: " fmt , ## __VA_ARGS__); } while (0) #else -#define APB_DPRINTF(fmt, args...) +#define APB_DPRINTF(fmt, ...) #endif typedef target_phys_addr_t pci_addr_t; diff --git a/hw/arm_gic.c b/hw/arm_gic.c index 2f484e1..cb774d6 100644 --- a/hw/arm_gic.c +++ b/hw/arm_gic.c @@ -14,10 +14,10 @@ //#define DEBUG_GIC #ifdef DEBUG_GIC -#define DPRINTF(fmt, args...) \ -do { printf("arm_gic: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ +do { printf("arm_gic: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) do {} while(0) +#define DPRINTF(fmt, ...) do {} while(0) #endif #ifdef NVIC diff --git a/hw/cs4231.c b/hw/cs4231.c index 59d83e0..2266980 100644 --- a/hw/cs4231.c +++ b/hw/cs4231.c @@ -46,10 +46,10 @@ typedef struct CSState { #define CS_CDC_VER 0x8a #ifdef DEBUG_CS -#define DPRINTF(fmt, args...) \ - do { printf("CS: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ + do { printf("CS: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) +#define DPRINTF(fmt, ...) #endif static void cs_reset(void *opaque) @@ -36,10 +36,10 @@ //#define DEBUG_CUDA_PACKET #ifdef DEBUG_CUDA -#define CUDA_DPRINTF(fmt, args...) \ -do { printf("CUDA: " fmt , ##args); } while (0) +#define CUDA_DPRINTF(fmt, ...) \ + do { printf("CUDA: " fmt , ## __VA_ARGS__); } while (0) #else -#define CUDA_DPRINTF(fmt, args...) +#define CUDA_DPRINTF(fmt, ...) #endif /* Bits in B data register: all active low */ diff --git a/hw/dp8393x.c b/hw/dp8393x.c index 6170588..4418409 100644 --- a/hw/dp8393x.c +++ b/hw/dp8393x.c @@ -34,8 +34,8 @@ #endif #ifdef DEBUG_SONIC -#define DPRINTF(fmt, args...) \ -do { printf("sonic: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ +do { printf("sonic: " fmt , ## __VA_ARGS__); } while (0) static const char* reg_names[] = { "CR", "DCR", "RCR", "TCR", "IMR", "ISR", "UTDA", "CTDA", "TPS", "TFC", "TSA0", "TSA1", "TFS", "URDA", "CRDA", "CRBA0", @@ -46,11 +46,11 @@ static const char* reg_names[] = { "0x30", "0x31", "0x32", "0x33", "0x34", "0x35", "0x36", "0x37", "0x38", "0x39", "0x3a", "0x3b", "0x3c", "0x3d", "0x3e", "DCR2" }; #else -#define DPRINTF(fmt, args...) do {} while (0) +#define DPRINTF(fmt, ...) do {} while (0) #endif -#define SONIC_ERROR(fmt, args...) \ -do { printf("sonic ERROR: %s: " fmt, __func__ , ##args); } while (0) +#define SONIC_ERROR(fmt, ...) \ +do { printf("sonic ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0) #define SONIC_CR 0x00 #define SONIC_DCR 0x01 diff --git a/hw/eccmemctl.c b/hw/eccmemctl.c index 28519c8..07f5ef7 100644 --- a/hw/eccmemctl.c +++ b/hw/eccmemctl.c @@ -28,10 +28,10 @@ //#define DEBUG_ECC #ifdef DEBUG_ECC -#define DPRINTF(fmt, args...) \ - do { printf("ECC: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ + do { printf("ECC: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) +#define DPRINTF(fmt, ...) #endif /* There are 3 versions of this chip used in SMP sun4m systems: diff --git a/hw/eepro100.c b/hw/eepro100.c index 235e598..7dbbca0 100644 --- a/hw/eepro100.c +++ b/hw/eepro100.c @@ -60,9 +60,9 @@ //~ #define DEBUG_EEPRO100 #ifdef DEBUG_EEPRO100 -#define logout(fmt, args...) fprintf(stderr, "EE100\t%-24s" fmt, __func__, ##args) +#define logout(fmt, ...) fprintf(stderr, "EE100\t%-24s" fmt, __func__, ## __VA_ARGS__) #else -#define logout(fmt, args...) ((void)0) +#define logout(fmt, ...) ((void)0) #endif /* Set flags to 0 to disable debug output. */ diff --git a/hw/eeprom93xx.c b/hw/eeprom93xx.c index ae15a7f..e4b6b13 100644 --- a/hw/eeprom93xx.c +++ b/hw/eeprom93xx.c @@ -44,9 +44,9 @@ //~ #define DEBUG_EEPROM #ifdef DEBUG_EEPROM -#define logout(fmt, args...) fprintf(stderr, "EEPROM\t%-24s" fmt, __func__, ##args) +#define logout(fmt, ...) fprintf(stderr, "EEPROM\t%-24s" fmt, __func__, ## __VA_ARGS__) #else -#define logout(fmt, args...) ((void)0) +#define logout(fmt, ...) ((void)0) #endif #define EEPROM_INSTANCE 0 @@ -62,22 +62,22 @@ */ #ifdef DEBUG_SERIAL -#define SER_DPRINTF(fmt, args...) \ -do { printf("SER: " fmt , ##args); } while (0) +#define SER_DPRINTF(fmt, ...) \ + do { printf("SER: " fmt , ## __VA_ARGS__); } while (0) #else -#define SER_DPRINTF(fmt, args...) +#define SER_DPRINTF(fmt, ...) #endif #ifdef DEBUG_KBD -#define KBD_DPRINTF(fmt, args...) \ -do { printf("KBD: " fmt , ##args); } while (0) +#define KBD_DPRINTF(fmt, ...) \ + do { printf("KBD: " fmt , ## __VA_ARGS__); } while (0) #else -#define KBD_DPRINTF(fmt, args...) +#define KBD_DPRINTF(fmt, ...) #endif #ifdef DEBUG_MOUSE -#define MS_DPRINTF(fmt, args...) \ -do { printf("MSC: " fmt , ##args); } while (0) +#define MS_DPRINTF(fmt, ...) \ + do { printf("MSC: " fmt , ## __VA_ARGS__); } while (0) #else -#define MS_DPRINTF(fmt, args...) +#define MS_DPRINTF(fmt, ...) #endif typedef enum { @@ -38,14 +38,14 @@ */ #ifdef DEBUG_ESP -#define DPRINTF(fmt, args...) \ -do { printf("ESP: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ + do { printf("ESP: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) do {} while (0) +#define DPRINTF(fmt, ...) do {} while (0) #endif -#define ESP_ERROR(fmt, args...) \ -do { printf("ESP ERROR: %s: " fmt, __func__ , ##args); } while (0) +#define ESP_ERROR(fmt, ...) \ + do { printf("ESP ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0) #define ESP_REGS 16 #define TI_BUFSZ 16 @@ -37,14 +37,14 @@ //#define DEBUG_FLOPPY #ifdef DEBUG_FLOPPY -#define FLOPPY_DPRINTF(fmt, args...) \ -do { printf("FLOPPY: " fmt , ##args); } while (0) +#define FLOPPY_DPRINTF(fmt, ...) \ + do { printf("FLOPPY: " fmt , ## __VA_ARGS__); } while (0) #else -#define FLOPPY_DPRINTF(fmt, args...) +#define FLOPPY_DPRINTF(fmt, ...) #endif -#define FLOPPY_ERROR(fmt, args...) \ -do { printf("FLOPPY ERROR: %s: " fmt, __func__ , ##args); } while (0) +#define FLOPPY_ERROR(fmt, ...) \ + do { printf("FLOPPY ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0) /********************************************************/ /* Floppy drive emulation */ diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c index e1b19d7..39bd955 100644 --- a/hw/fw_cfg.c +++ b/hw/fw_cfg.c @@ -30,10 +30,10 @@ //#define DEBUG_FW_CFG #ifdef DEBUG_FW_CFG -#define FW_CFG_DPRINTF(fmt, args...) \ - do { printf("FW_CFG: " fmt , ##args); } while (0) +#define FW_CFG_DPRINTF(fmt, ...) \ + do { printf("FW_CFG: " fmt , ## __VA_ARGS__); } while (0) #else -#define FW_CFG_DPRINTF(fmt, args...) +#define FW_CFG_DPRINTF(fmt, ...) #endif #define FW_CFG_SIZE 2 diff --git a/hw/g364fb.c b/hw/g364fb.c index 6d37ca1..54c201c 100644 --- a/hw/g364fb.c +++ b/hw/g364fb.c @@ -26,13 +26,13 @@ //#define DEBUG_G364 #ifdef DEBUG_G364 -#define DPRINTF(fmt, args...) \ -do { printf("g364: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ +do { printf("g364: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) do {} while (0) +#define DPRINTF(fmt, ...) do {} while (0) #endif -#define BADF(fmt, args...) \ -do { fprintf(stderr, "g364 ERROR: " fmt , ##args);} while (0) +#define BADF(fmt, ...) \ +do { fprintf(stderr, "g364 ERROR: " fmt , ## __VA_ARGS__);} while (0) typedef struct G364State { /* hardware */ diff --git a/hw/grackle_pci.c b/hw/grackle_pci.c index 61606b2..e9769cd 100644 --- a/hw/grackle_pci.c +++ b/hw/grackle_pci.c @@ -31,10 +31,10 @@ //#define DEBUG_GRACKLE #ifdef DEBUG_GRACKLE -#define GRACKLE_DPRINTF(fmt, args...) \ -do { printf("GRACKLE: " fmt , ##args); } while (0) +#define GRACKLE_DPRINTF(fmt, ...) \ + do { printf("GRACKLE: " fmt , ## __VA_ARGS__); } while (0) #else -#define GRACKLE_DPRINTF(fmt, args...) +#define GRACKLE_DPRINTF(fmt, ...) #endif typedef target_phys_addr_t pci_addr_t; diff --git a/hw/heathrow_pic.c b/hw/heathrow_pic.c index f0518bb..9a67ec0 100644 --- a/hw/heathrow_pic.c +++ b/hw/heathrow_pic.c @@ -29,10 +29,10 @@ //#define DEBUG_PIC #ifdef DEBUG_PIC -#define PIC_DPRINTF(fmt, args...) \ -do { printf("PIC: " fmt , ##args); } while (0) +#define PIC_DPRINTF(fmt, ...) \ + do { printf("PIC: " fmt , ## __VA_ARGS__); } while (0) #else -#define PIC_DPRINTF(fmt, args...) +#define PIC_DPRINTF(fmt, ...) #endif typedef struct HeathrowPIC { @@ -28,10 +28,10 @@ //#define DEBUG_IOMMU #ifdef DEBUG_IOMMU -#define DPRINTF(fmt, args...) \ -do { printf("IOMMU: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ + do { printf("IOMMU: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) +#define DPRINTF(fmt, ...) #endif #define IOMMU_NREGS (4*4096/4) diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c index 1f4f8b7..f4e57ae 100644 --- a/hw/lsi53c895a.c +++ b/hw/lsi53c895a.c @@ -19,14 +19,14 @@ //#define DEBUG_LSI_REG #ifdef DEBUG_LSI -#define DPRINTF(fmt, args...) \ -do { printf("lsi_scsi: " fmt , ##args); } while (0) -#define BADF(fmt, args...) \ -do { fprintf(stderr, "lsi_scsi: error: " fmt , ##args); exit(1);} while (0) +#define DPRINTF(fmt, ...) \ +do { printf("lsi_scsi: " fmt , ## __VA_ARGS__); } while (0) +#define BADF(fmt, ...) \ +do { fprintf(stderr, "lsi_scsi: error: " fmt , ## __VA_ARGS__); exit(1);} while (0) #else -#define DPRINTF(fmt, args...) do {} while(0) -#define BADF(fmt, args...) \ -do { fprintf(stderr, "lsi_scsi: error: " fmt , ##args);} while (0) +#define DPRINTF(fmt, ...) do {} while(0) +#define BADF(fmt, ...) \ +do { fprintf(stderr, "lsi_scsi: error: " fmt , ## __VA_ARGS__);} while (0) #endif #define LSI_SCNTL0_TRG 0x01 diff --git a/hw/m48t59.c b/hw/m48t59.c index 0cfdab3..c6829be 100644 --- a/hw/m48t59.c +++ b/hw/m48t59.c @@ -30,9 +30,9 @@ //#define DEBUG_NVRAM #if defined(DEBUG_NVRAM) -#define NVRAM_PRINTF(fmt, args...) do { printf(fmt , ##args); } while (0) +#define NVRAM_PRINTF(fmt, ...) do { printf(fmt , ## __VA_ARGS__); } while (0) #else -#define NVRAM_PRINTF(fmt, args...) do { } while (0) +#define NVRAM_PRINTF(fmt, ...) do { } while (0) #endif /* diff --git a/hw/mac_dbdma.c b/hw/mac_dbdma.c index e863980..a94cd09 100644 --- a/hw/mac_dbdma.c +++ b/hw/mac_dbdma.c @@ -44,10 +44,10 @@ //#define DEBUG_DBDMA #ifdef DEBUG_DBDMA -#define DBDMA_DPRINTF(fmt, args...) \ -do { printf("DBDMA: " fmt , ##args); } while (0) +#define DBDMA_DPRINTF(fmt, ...) \ + do { printf("DBDMA: " fmt , ## __VA_ARGS__); } while (0) #else -#define DBDMA_DPRINTF(fmt, args...) +#define DBDMA_DPRINTF(fmt, ...) #endif /* diff --git a/hw/mac_nvram.c b/hw/mac_nvram.c index ae4d4bb..36648d1 100644 --- a/hw/mac_nvram.c +++ b/hw/mac_nvram.c @@ -31,10 +31,10 @@ //#define DEBUG_NVR #ifdef DEBUG_NVR -#define NVR_DPRINTF(fmt, args...) \ -do { printf("NVR: " fmt , ##args); } while (0) +#define NVR_DPRINTF(fmt, ...) \ + do { printf("NVR: " fmt , ## __VA_ARGS__); } while (0) #else -#define NVR_DPRINTF(fmt, args...) +#define NVR_DPRINTF(fmt, ...) #endif struct MacIONVRAMState { diff --git a/hw/mcf_fec.c b/hw/mcf_fec.c index 81f179b..6c0acc5 100644 --- a/hw/mcf_fec.c +++ b/hw/mcf_fec.c @@ -14,10 +14,10 @@ //#define DEBUG_FEC 1 #ifdef DEBUG_FEC -#define DPRINTF(fmt, args...) \ -do { printf("mcf_fec: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ +do { printf("mcf_fec: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) do {} while(0) +#define DPRINTF(fmt, ...) do {} while(0) #endif #define FEC_MAX_FRAME_SIZE 2032 diff --git a/hw/mips_malta.c b/hw/mips_malta.c index fd81753..9710adc 100644 --- a/hw/mips_malta.c +++ b/hw/mips_malta.c @@ -114,9 +114,9 @@ static void malta_fpga_update_display(void *opaque) //~ #define DEBUG #if defined(DEBUG) -# define logout(fmt, args...) fprintf(stderr, "MALTA\t%-24s" fmt, __func__, ##args) +# define logout(fmt, ...) fprintf(stderr, "MALTA\t%-24s" fmt, __func__, ## __VA_ARGS__) #else -# define logout(fmt, args...) ((void)0) +# define logout(fmt, ...) ((void)0) #endif struct _eeprom24c0x_t { diff --git a/hw/openpic.c b/hw/openpic.c index 53747c4..561c609 100644 --- a/hw/openpic.c +++ b/hw/openpic.c @@ -40,9 +40,9 @@ //#define DEBUG_OPENPIC #ifdef DEBUG_OPENPIC -#define DPRINTF(fmt, args...) do { printf(fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) do { printf(fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) do { } while (0) +#define DPRINTF(fmt, ...) do { } while (0) #endif #define USE_MPCxxx /* Intel model is broken, for now */ diff --git a/hw/parallel.c b/hw/parallel.c index 0abd0a2..dd2eeda 100644 --- a/hw/parallel.c +++ b/hw/parallel.c @@ -30,9 +30,9 @@ //#define DEBUG_PARALLEL #ifdef DEBUG_PARALLEL -#define pdebug(fmt, arg...) printf("pp: " fmt, ##arg) +#define pdebug(fmt, ...) printf("pp: " fmt, ## __VA_ARGS__) #else -#define pdebug(fmt, arg...) ((void)0) +#define pdebug(fmt, ...) ((void)0) #endif #define PARA_REG_DATA 0 diff --git a/hw/pci_host.h b/hw/pci_host.h index c4f42a4..757b0e2 100644 --- a/hw/pci_host.h +++ b/hw/pci_host.h @@ -29,10 +29,10 @@ //#define DEBUG_PCI #ifdef DEBUG_PCI -#define PCI_DPRINTF(fmt, args...) \ -do { printf("pci_host_data: " fmt , ##args); } while (0) +#define PCI_DPRINTF(fmt, ...) \ +do { printf("pci_host_data: " fmt , ## __VA_ARGS__); } while (0) #else -#define PCI_DPRINTF(fmt, args...) +#define PCI_DPRINTF(fmt, ...) #endif typedef struct { diff --git a/hw/pflash_cfi01.c b/hw/pflash_cfi01.c index 1c433aa..d696560 100644 --- a/hw/pflash_cfi01.c +++ b/hw/pflash_cfi01.c @@ -42,20 +42,20 @@ #include "block.h" #include "qemu-timer.h" -#define PFLASH_BUG(fmt, args...) \ +#define PFLASH_BUG(fmt, ...) \ do { \ - printf("PFLASH: Possible BUG - " fmt, ##args); \ + printf("PFLASH: Possible BUG - " fmt, ## __VA_ARGS__); \ exit(1); \ } while(0) /* #define PFLASH_DEBUG */ #ifdef PFLASH_DEBUG -#define DPRINTF(fmt, args...) \ +#define DPRINTF(fmt, ...) \ do { \ - printf("PFLASH: " fmt , ##args); \ + printf("PFLASH: " fmt , ## __VA_ARGS__); \ } while (0) #else -#define DPRINTF(fmt, args...) do { } while (0) +#define DPRINTF(fmt, ...) do { } while (0) #endif struct pflash_t { diff --git a/hw/pflash_cfi02.c b/hw/pflash_cfi02.c index 799398c..60edbf5 100644 --- a/hw/pflash_cfi02.c +++ b/hw/pflash_cfi02.c @@ -43,12 +43,12 @@ //#define PFLASH_DEBUG #ifdef PFLASH_DEBUG -#define DPRINTF(fmt, args...) \ +#define DPRINTF(fmt, ...) \ do { \ - printf("PFLASH: " fmt , ##args); \ + printf("PFLASH: " fmt , ## __VA_ARGS__); \ } while (0) #else -#define DPRINTF(fmt, args...) do { } while (0) +#define DPRINTF(fmt, ...) do { } while (0) #endif struct pflash_t { @@ -13,14 +13,14 @@ //#define DEBUG_PL022 1 #ifdef DEBUG_PL022 -#define DPRINTF(fmt, args...) \ -do { printf("pl022: " fmt , ##args); } while (0) -#define BADF(fmt, args...) \ -do { fprintf(stderr, "pl022: error: " fmt , ##args); exit(1);} while (0) +#define DPRINTF(fmt, ...) \ +do { printf("pl022: " fmt , ## __VA_ARGS__); } while (0) +#define BADF(fmt, ...) \ +do { fprintf(stderr, "pl022: error: " fmt , ## __VA_ARGS__); exit(1);} while (0) #else -#define DPRINTF(fmt, args...) do {} while(0) -#define BADF(fmt, args...) \ -do { fprintf(stderr, "pl022: error: " fmt , ##args);} while (0) +#define DPRINTF(fmt, ...) do {} while(0) +#define BADF(fmt, ...) \ +do { fprintf(stderr, "pl022: error: " fmt , ## __VA_ARGS__);} while (0) #endif #define PL022_CR1_LBM 0x01 @@ -16,10 +16,10 @@ //#define DEBUG_PL031 #ifdef DEBUG_PL031 -#define DPRINTF(fmt, args...) \ -do { printf("pl031: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ +do { printf("pl031: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) do {} while(0) +#define DPRINTF(fmt, ...) do {} while(0) #endif #define RTC_DR 0x00 /* Data read register */ @@ -14,14 +14,14 @@ //#define DEBUG_PL061 1 #ifdef DEBUG_PL061 -#define DPRINTF(fmt, args...) \ -do { printf("pl061: " fmt , ##args); } while (0) -#define BADF(fmt, args...) \ -do { fprintf(stderr, "pl061: error: " fmt , ##args); exit(1);} while (0) +#define DPRINTF(fmt, ...) \ +do { printf("pl061: " fmt , ## __VA_ARGS__); } while (0) +#define BADF(fmt, ...) \ +do { fprintf(stderr, "pl061: error: " fmt , ## __VA_ARGS__); exit(1);} while (0) #else -#define DPRINTF(fmt, args...) do {} while(0) -#define BADF(fmt, args...) \ -do { fprintf(stderr, "pl061: error: " fmt , ##args);} while (0) +#define DPRINTF(fmt, ...) do {} while(0) +#define BADF(fmt, ...) \ +do { fprintf(stderr, "pl061: error: " fmt , ## __VA_ARGS__);} while (0) #endif static const uint8_t pl061_id[12] = @@ -14,10 +14,10 @@ //#define DEBUG_PL181 1 #ifdef DEBUG_PL181 -#define DPRINTF(fmt, args...) \ -do { printf("pl181: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ +do { printf("pl181: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) do {} while(0) +#define DPRINTF(fmt, ...) do {} while(0) #endif #define PL181_FIFO_LEN 16 diff --git a/hw/ppc4xx_pci.c b/hw/ppc4xx_pci.c index 2e67508..5198bbb 100644 --- a/hw/ppc4xx_pci.c +++ b/hw/ppc4xx_pci.c @@ -33,7 +33,7 @@ typedef target_phys_addr_t pci_addr_t; #ifdef DEBUG #define DPRINTF(fmt, ...) do { printf(fmt, ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) +#define DPRINTF(fmt, ...) #endif /* DEBUG */ struct PCIMasterMap { diff --git a/hw/ppc_newworld.c b/hw/ppc_newworld.c index 760249e..29faa06 100644 --- a/hw/ppc_newworld.c +++ b/hw/ppc_newworld.c @@ -44,10 +44,10 @@ //#define DEBUG_UNIN #ifdef DEBUG_UNIN -#define UNIN_DPRINTF(fmt, args...) \ -do { printf("UNIN: " fmt , ##args); } while (0) +#define UNIN_DPRINTF(fmt, ...) \ + do { printf("UNIN: " fmt , ## __VA_ARGS__); } while (0) #else -#define UNIN_DPRINTF(fmt, args...) +#define UNIN_DPRINTF(fmt, ...) #endif /* UniN device */ diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c index 9584d91..b98c6c2 100644 --- a/hw/ppc_prep.c +++ b/hw/ppc_prep.c @@ -50,18 +50,18 @@ #endif #if defined (HARD_DEBUG_PPC_IO) -#define PPC_IO_DPRINTF(fmt, args...) \ +#define PPC_IO_DPRINTF(fmt, ...) \ do { \ if (qemu_loglevel_mask(CPU_LOG_IOPORT)) { \ - qemu_log("%s: " fmt, __func__ , ##args); \ + qemu_log("%s: " fmt, __func__ , ## __VA_ARGS__); \ } else { \ - printf("%s : " fmt, __func__ , ##args); \ + printf("%s : " fmt, __func__ , ## __VA_ARGS__); \ } \ } while (0) #elif defined (DEBUG_PPC_IO) -#define PPC_IO_DPRINTF(fmt, args...) qemu_log_mask(CPU_LOG_IOPORT, ## __VA_ARGS__) +#define PPC_IO_DPRINTF(fmt, ...) qemu_log_mask(CPU_LOG_IOPORT, ## __VA_ARGS__) #else -#define PPC_IO_DPRINTF(fmt, args...) do { } while (0) +#define PPC_IO_DPRINTF(fmt, ...) do { } while (0) #endif /* Constants for devices init */ diff --git a/hw/ppce500_pci.c b/hw/ppce500_pci.c index 547218f..9eed890 100644 --- a/hw/ppce500_pci.c +++ b/hw/ppce500_pci.c @@ -24,9 +24,9 @@ typedef target_phys_addr_t pci_addr_t; #include "qemu-log.h" #ifdef DEBUG_PCI -#define pci_debug(fmt, arg...) fprintf(stderr, fmt, ##arg) +#define pci_debug(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__) #else -#define pci_debug(fmt, arg...) +#define pci_debug(fmt, ...) #endif #define PCIE500_CFGADDR 0x0 diff --git a/hw/rc4030.c b/hw/rc4030.c index 2f9bb0e..7fe84ff 100644 --- a/hw/rc4030.c +++ b/hw/rc4030.c @@ -33,16 +33,16 @@ //#define DEBUG_RC4030_DMA #ifdef DEBUG_RC4030 -#define DPRINTF(fmt, args...) \ -do { printf("rc4030: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ +do { printf("rc4030: " fmt , ## __VA_ARGS__); } while (0) static const char* irq_names[] = { "parallel", "floppy", "sound", "video", "network", "scsi", "keyboard", "mouse", "serial0", "serial1" }; #else -#define DPRINTF(fmt, args...) +#define DPRINTF(fmt, ...) #endif -#define RC4030_ERROR(fmt, args...) \ -do { fprintf(stderr, "rc4030 ERROR: %s: " fmt, __func__ , ##args); } while (0) +#define RC4030_ERROR(fmt, ...) \ +do { fprintf(stderr, "rc4030 ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0) /********************************************************/ /* rc4030 emulation */ @@ -28,10 +28,10 @@ //#define DEBUG_IRQ #ifdef DEBUG_IRQ -#define DPRINTF(fmt, args...) \ -do { printf("IRQ: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ + do { printf("IRQ: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) +#define DPRINTF(fmt, ...) #endif #define MAX_CPUS 16 diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 8f1afab..a0485db 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -18,14 +18,14 @@ //#define DEBUG_SCSI #ifdef DEBUG_SCSI -#define DPRINTF(fmt, args...) \ -do { printf("scsi-disk: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ +do { printf("scsi-disk: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) do {} while(0) +#define DPRINTF(fmt, ...) do {} while(0) #endif -#define BADF(fmt, args...) \ -do { fprintf(stderr, "scsi-disk: " fmt , ##args); } while (0) +#define BADF(fmt, ...) \ +do { fprintf(stderr, "scsi-disk: " fmt , ## __VA_ARGS__); } while (0) #include "qemu-common.h" #include "block.h" diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c index f4c615b..c827c04 100644 --- a/hw/scsi-generic.c +++ b/hw/scsi-generic.c @@ -28,14 +28,14 @@ SCSIDevice *scsi_generic_init(BlockDriverState *bdrv, int tcq, //#define DEBUG_SCSI #ifdef DEBUG_SCSI -#define DPRINTF(fmt, args...) \ -do { printf("scsi-generic: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ +do { printf("scsi-generic: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) do {} while(0) +#define DPRINTF(fmt, ...) do {} while(0) #endif -#define BADF(fmt, args...) \ -do { fprintf(stderr, "scsi-generic: " fmt , ##args); } while (0) +#define BADF(fmt, ...) \ +do { fprintf(stderr, "scsi-generic: " fmt , ## __VA_ARGS__); } while (0) #include <stdio.h> #include <sys/types.h> @@ -36,10 +36,10 @@ //#define DEBUG_SD 1 #ifdef DEBUG_SD -#define DPRINTF(fmt, args...) \ -do { fprintf(stderr, "SD: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ +do { fprintf(stderr, "SD: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) do {} while(0) +#define DPRINTF(fmt, ...) do {} while(0) #endif typedef enum { diff --git a/hw/sh_intc.h b/hw/sh_intc.h index a9750ae..c117d6f 100644 --- a/hw/sh_intc.h +++ b/hw/sh_intc.h @@ -18,7 +18,7 @@ struct intc_group { intc_enum enum_ids[32]; }; -#define INTC_GROUP(enum_id, ids...) { enum_id, { ids } } +#define INTC_GROUP(enum_id, ...) { enum_id, { __VA_ARGS__ } } struct intc_mask_reg { unsigned long set_reg, clr_reg, reg_width; diff --git a/hw/slavio_intctl.c b/hw/slavio_intctl.c index 9ee5ff8..b688934 100644 --- a/hw/slavio_intctl.c +++ b/hw/slavio_intctl.c @@ -29,10 +29,10 @@ //#define DEBUG_IRQ #ifdef DEBUG_IRQ -#define DPRINTF(fmt, args...) \ -do { printf("IRQ: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ + do { printf("IRQ: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) +#define DPRINTF(fmt, ...) #endif /* diff --git a/hw/slavio_misc.c b/hw/slavio_misc.c index 8da7f4a..ecece54 100644 --- a/hw/slavio_misc.c +++ b/hw/slavio_misc.c @@ -37,10 +37,10 @@ */ #ifdef DEBUG_MISC -#define MISC_DPRINTF(fmt, args...) \ -do { printf("MISC: " fmt , ##args); } while (0) +#define MISC_DPRINTF(fmt, ...) \ + do { printf("MISC: " fmt , ## __VA_ARGS__); } while (0) #else -#define MISC_DPRINTF(fmt, args...) +#define MISC_DPRINTF(fmt, ...) #endif typedef struct MiscState { diff --git a/hw/slavio_timer.c b/hw/slavio_timer.c index 6a29ce2..725b16d 100644 --- a/hw/slavio_timer.c +++ b/hw/slavio_timer.c @@ -28,10 +28,10 @@ //#define DEBUG_TIMER #ifdef DEBUG_TIMER -#define DPRINTF(fmt, args...) \ -do { printf("TIMER: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ + do { printf("TIMER: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) do {} while (0) +#define DPRINTF(fmt, ...) do {} while (0) #endif /* @@ -47,9 +47,9 @@ //#define DEBUG_BITBLT #ifdef DEBUG_SM501 -#define SM501_DPRINTF(fmt...) printf(fmt) +#define SM501_DPRINTF(fmt, ...) printf(fmt, ## __VA_ARGS__) #else -#define SM501_DPRINTF(fmt...) do {} while(0) +#define SM501_DPRINTF(fmt, ...) do {} while(0) #endif @@ -16,14 +16,14 @@ //#define DEBUG_SMBUS 1 #ifdef DEBUG_SMBUS -#define DPRINTF(fmt, args...) \ -do { printf("smbus(%02x): " fmt , dev->i2c.address, ##args); } while (0) -#define BADF(fmt, args...) \ -do { fprintf(stderr, "smbus: error: " fmt , ##args); exit(1);} while (0) +#define DPRINTF(fmt, ...) \ +do { printf("smbus(%02x): " fmt , dev->i2c.address, ## __VA_ARGS__); } while (0) +#define BADF(fmt, ...) \ +do { fprintf(stderr, "smbus: error: " fmt , ## __VA_ARGS__); exit(1);} while (0) #else -#define DPRINTF(fmt, args...) do {} while(0) -#define BADF(fmt, args...) \ -do { fprintf(stderr, "smbus: error: " fmt , ##args);} while (0) +#define DPRINTF(fmt, ...) do {} while(0) +#define BADF(fmt, ...) \ +do { fprintf(stderr, "smbus: error: " fmt , ## __VA_ARGS__);} while (0) #endif enum { diff --git a/hw/sparc32_dma.c b/hw/sparc32_dma.c index b1495dd..cab9af7 100644 --- a/hw/sparc32_dma.c +++ b/hw/sparc32_dma.c @@ -37,10 +37,10 @@ */ #ifdef DEBUG_DMA -#define DPRINTF(fmt, args...) \ -do { printf("DMA: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ + do { printf("DMA: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) +#define DPRINTF(fmt, ...) #endif #define DMA_REGS 4 diff --git a/hw/ssd0303.c b/hw/ssd0303.c index 56cf72d..f13f804 100644 --- a/hw/ssd0303.c +++ b/hw/ssd0303.c @@ -17,14 +17,14 @@ //#define DEBUG_SSD0303 1 #ifdef DEBUG_SSD0303 -#define DPRINTF(fmt, args...) \ -do { printf("ssd0303: " fmt , ##args); } while (0) -#define BADF(fmt, args...) \ -do { fprintf(stderr, "ssd0303: error: " fmt , ##args); exit(1);} while (0) +#define DPRINTF(fmt, ...) \ +do { printf("ssd0303: " fmt , ## __VA_ARGS__); } while (0) +#define BADF(fmt, ...) \ +do { fprintf(stderr, "ssd0303: error: " fmt , ## __VA_ARGS__); exit(1);} while (0) #else -#define DPRINTF(fmt, args...) do {} while(0) -#define BADF(fmt, args...) \ -do { fprintf(stderr, "ssd0303: error: " fmt , ##args);} while (0) +#define DPRINTF(fmt, ...) do {} while(0) +#define BADF(fmt, ...) \ +do { fprintf(stderr, "ssd0303: error: " fmt , ## __VA_ARGS__);} while (0) #endif /* Scaling factor for pixels. */ diff --git a/hw/ssd0323.c b/hw/ssd0323.c index b640dd0..5b83d27 100644 --- a/hw/ssd0323.c +++ b/hw/ssd0323.c @@ -17,14 +17,14 @@ //#define DEBUG_SSD0323 1 #ifdef DEBUG_SSD0323 -#define DPRINTF(fmt, args...) \ -do { printf("ssd0323: " fmt , ##args); } while (0) -#define BADF(fmt, args...) \ -do { fprintf(stderr, "ssd0323: error: " fmt , ##args); exit(1);} while (0) +#define DPRINTF(fmt, ...) \ +do { printf("ssd0323: " fmt , ## __VA_ARGS__); } while (0) +#define BADF(fmt, ...) \ +do { fprintf(stderr, "ssd0323: error: " fmt , ## __VA_ARGS__); exit(1);} while (0) #else -#define DPRINTF(fmt, args...) do {} while(0) -#define BADF(fmt, args...) \ -do { fprintf(stderr, "ssd0323: error: " fmt , ##args);} while (0) +#define DPRINTF(fmt, ...) do {} while(0) +#define BADF(fmt, ...) \ +do { fprintf(stderr, "ssd0323: error: " fmt , ## __VA_ARGS__);} while (0) #endif /* Scaling factor for pixels. */ diff --git a/hw/ssi-sd.c b/hw/ssi-sd.c index 93d2374..a1af85b 100644 --- a/hw/ssi-sd.c +++ b/hw/ssi-sd.c @@ -13,14 +13,14 @@ //#define DEBUG_SSI_SD 1 #ifdef DEBUG_SSI_SD -#define DPRINTF(fmt, args...) \ -do { printf("ssi_sd: " fmt , ##args); } while (0) -#define BADF(fmt, args...) \ -do { fprintf(stderr, "ssi_sd: error: " fmt , ##args); exit(1);} while (0) +#define DPRINTF(fmt, ...) \ +do { printf("ssi_sd: " fmt , ## __VA_ARGS__); } while (0) +#define BADF(fmt, ...) \ +do { fprintf(stderr, "ssi_sd: error: " fmt , ## __VA_ARGS__); exit(1);} while (0) #else -#define DPRINTF(fmt, args...) do {} while(0) -#define BADF(fmt, args...) \ -do { fprintf(stderr, "ssi_sd: error: " fmt , ##args);} while (0) +#define DPRINTF(fmt, ...) do {} while(0) +#define BADF(fmt, ...) \ +do { fprintf(stderr, "ssi_sd: error: " fmt , ## __VA_ARGS__);} while (0) #endif typedef enum { diff --git a/hw/stellaris_enet.c b/hw/stellaris_enet.c index c9a0909..d1ec61a 100644 --- a/hw/stellaris_enet.c +++ b/hw/stellaris_enet.c @@ -14,14 +14,14 @@ //#define DEBUG_STELLARIS_ENET 1 #ifdef DEBUG_STELLARIS_ENET -#define DPRINTF(fmt, args...) \ -do { printf("stellaris_enet: " fmt , ##args); } while (0) -#define BADF(fmt, args...) \ -do { fprintf(stderr, "stellaris_enet: error: " fmt , ##args); exit(1);} while (0) +#define DPRINTF(fmt, ...) \ +do { printf("stellaris_enet: " fmt , ## __VA_ARGS__); } while (0) +#define BADF(fmt, ...) \ +do { fprintf(stderr, "stellaris_enet: error: " fmt , ## __VA_ARGS__); exit(1);} while (0) #else -#define DPRINTF(fmt, args...) do {} while(0) -#define BADF(fmt, args...) \ -do { fprintf(stderr, "stellaris_enet: error: " fmt , ##args);} while (0) +#define DPRINTF(fmt, ...) do {} while(0) +#define BADF(fmt, ...) \ +do { fprintf(stderr, "stellaris_enet: error: " fmt , ## __VA_ARGS__);} while (0) #endif #define SE_INT_RX 0x01 diff --git a/hw/sun4c_intctl.c b/hw/sun4c_intctl.c index 33df653..1b55557 100644 --- a/hw/sun4c_intctl.c +++ b/hw/sun4c_intctl.c @@ -28,10 +28,10 @@ //#define DEBUG_IRQ #ifdef DEBUG_IRQ -#define DPRINTF(fmt, args...) \ -do { printf("IRQ: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ + do { printf("IRQ: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) +#define DPRINTF(fmt, ...) #endif /* @@ -68,10 +68,10 @@ */ #ifdef DEBUG_IRQ -#define DPRINTF(fmt, args...) \ - do { printf("CPUIRQ: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ + do { printf("CPUIRQ: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) +#define DPRINTF(fmt, ...) #endif #define KERNEL_LOAD_ADDR 0x00004000 @@ -36,10 +36,10 @@ //#define DEBUG_IRQ #ifdef DEBUG_IRQ -#define DPRINTF(fmt, args...) \ - do { printf("CPUIRQ: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ + do { printf("CPUIRQ: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) +#define DPRINTF(fmt, ...) #endif #define KERNEL_LOAD_ADDR 0x00404000 diff --git a/hw/unin_pci.c b/hw/unin_pci.c index b751916..8277b67 100644 --- a/hw/unin_pci.c +++ b/hw/unin_pci.c @@ -29,10 +29,10 @@ //#define DEBUG_UNIN #ifdef DEBUG_UNIN -#define UNIN_DPRINTF(fmt, args...) \ -do { printf("UNIN: " fmt , ##args); } while (0) +#define UNIN_DPRINTF(fmt, ...) \ + do { printf("UNIN: " fmt , ## __VA_ARGS__); } while (0) #else -#define UNIN_DPRINTF(fmt, args...) +#define UNIN_DPRINTF(fmt, ...) #endif typedef target_phys_addr_t pci_addr_t; diff --git a/hw/usb-msd.c b/hw/usb-msd.c index 41c92c3..3a3eb4a 100644 --- a/hw/usb-msd.c +++ b/hw/usb-msd.c @@ -16,10 +16,10 @@ //#define DEBUG_MSD #ifdef DEBUG_MSD -#define DPRINTF(fmt, args...) \ -do { printf("usb-msd: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ +do { printf("usb-msd: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) do {} while(0) +#define DPRINTF(fmt, ...) do {} while(0) #endif /* USB requests. */ diff --git a/hw/usb-serial.c b/hw/usb-serial.c index 5208482..be231f9 100644 --- a/hw/usb-serial.c +++ b/hw/usb-serial.c @@ -15,10 +15,10 @@ //#define DEBUG_Serial #ifdef DEBUG_Serial -#define DPRINTF(fmt, args...) \ -do { printf("usb-serial: " fmt , ##args); } while (0) +#define DPRINTF(fmt, ...) \ +do { printf("usb-serial: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF(fmt, args...) do {} while(0) +#define DPRINTF(fmt, ...) do {} while(0) #endif #define RECV_BUF 384 diff --git a/linux-user/flatload.c b/linux-user/flatload.c index 00e0312..8eba5a8 100644 --- a/linux-user/flatload.c +++ b/linux-user/flatload.c @@ -47,9 +47,9 @@ //#define DEBUG #ifdef DEBUG -#define DBG_FLT(a...) printf(a) +#define DBG_FLT(...) printf(__VA_ARGS__) #else -#define DBG_FLT(a...) +#define DBG_FLT(...) #endif #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) diff --git a/linux-user/main.c b/linux-user/main.c index dc39b05d..0d36978 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -1080,12 +1080,12 @@ int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, target_ulong val) return -1; } -#define EXCP_DUMP(env, fmt, args...) \ -do { \ - fprintf(stderr, fmt , ##args); \ - cpu_dump_state(env, stderr, fprintf, 0); \ - qemu_log(fmt, ##args); \ - log_cpu_state(env, 0); \ +#define EXCP_DUMP(env, fmt, ...) \ +do { \ + fprintf(stderr, fmt , ## __VA_ARGS__); \ + cpu_dump_state(env, stderr, fprintf, 0); \ + qemu_log(fmt, ## __VA_ARGS__); \ + log_cpu_state(env, 0); \ } while (0) void cpu_loop(CPUPPCState *env) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 0bc9902..76f0c95 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2563,7 +2563,7 @@ static abi_long do_ipc(unsigned int call, int first, /* kernel structure types definitions */ #define IFNAMSIZ 16 -#define STRUCT(name, list...) STRUCT_ ## name, +#define STRUCT(name, ...) STRUCT_ ## name, #define STRUCT_SPECIAL(name) STRUCT_ ## name, enum { #include "syscall_types.h" @@ -2571,7 +2571,7 @@ enum { #undef STRUCT #undef STRUCT_SPECIAL -#define STRUCT(name, list...) static const argtype struct_ ## name ## _def[] = { list, TYPE_NULL }; +#define STRUCT(name, ...) static const argtype struct_ ## name ## _def[] = { __VA_ARGS__, TYPE_NULL }; #define STRUCT_SPECIAL(name) #include "syscall_types.h" #undef STRUCT @@ -2592,8 +2592,8 @@ typedef struct IOCTLEntry { #define MAX_STRUCT_SIZE 4096 static IOCTLEntry ioctl_entries[] = { -#define IOCTL(cmd, access, types...) \ - { TARGET_ ## cmd, cmd, #cmd, access, { types } }, +#define IOCTL(cmd, access, ...) \ + { TARGET_ ## cmd, cmd, #cmd, access, { __VA_ARGS__ } }, #include "ioctls.h" { 0, 0, }, }; @@ -3497,7 +3497,7 @@ void syscall_init(void) int size; int i; -#define STRUCT(name, list...) thunk_register_struct(STRUCT_ ## name, #name, struct_ ## name ## _def); +#define STRUCT(name, ...) thunk_register_struct(STRUCT_ ## name, #name, struct_ ## name ## _def); #define STRUCT_SPECIAL(name) thunk_register_struct_direct(STRUCT_ ## name, #name, &struct_ ## name ## _def); #include "syscall_types.h" #undef STRUCT diff --git a/slirp/bootp.c b/slirp/bootp.c index 8a97660..ae71e46 100644 --- a/slirp/bootp.c +++ b/slirp/bootp.c @@ -43,10 +43,10 @@ const char *bootp_filename; static const uint8_t rfc1533_cookie[] = { RFC1533_COOKIE }; #ifdef DEBUG -#define dprintf(fmt, args...) \ -if (slirp_debug & DBG_CALL) { fprintf(dfd, fmt, ## args); fflush(dfd); } +#define dprintf(fmt, ...) \ +if (slirp_debug & DBG_CALL) { fprintf(dfd, fmt, ## __VA_ARGS__); fflush(dfd); } #else -#define dprintf(fmt, args...) +#define dprintf(fmt, ...) #endif static BOOTPClient *get_new_addr(struct in_addr *paddr) diff --git a/target-i386/ops_sse.h b/target-i386/ops_sse.h index 99d483a..35ac211 100644 --- a/target-i386/ops_sse.h +++ b/target-i386/ops_sse.h @@ -20,7 +20,7 @@ */ #if SHIFT == 0 #define Reg MMXReg -#define XMM_ONLY(x...) +#define XMM_ONLY(...) #define B(n) MMX_B(n) #define W(n) MMX_W(n) #define L(n) MMX_L(n) @@ -28,7 +28,7 @@ #define SUFFIX _mmx #else #define Reg XMMReg -#define XMM_ONLY(x...) x +#define XMM_ONLY(...) __VA_ARGS__ #define B(n) XMM_B(n) #define W(n) XMM_W(n) #define L(n) XMM_L(n) diff --git a/target-i386/translate.c b/target-i386/translate.c index 8df3ea4..3933697 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -42,7 +42,7 @@ #ifdef TARGET_X86_64 #define X86_64_ONLY(x) x -#define X86_64_DEF(x...) x +#define X86_64_DEF(...) __VA_ARGS__ #define CODE64(s) ((s)->code64) #define REX_X(s) ((s)->rex_x) #define REX_B(s) ((s)->rex_b) @@ -52,7 +52,7 @@ #endif #else #define X86_64_ONLY(x) NULL -#define X86_64_DEF(x...) +#define X86_64_DEF(...) #define CODE64(s) 0 #define REX_X(s) 0 #define REX_B(s) 0 diff --git a/target-mips/translate.c b/target-mips/translate.c index 7ecc9fd..6f5bea4 100644 --- a/target-mips/translate.c +++ b/target-mips/translate.c @@ -501,13 +501,13 @@ static const char *fregnames[] = "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", }; #ifdef MIPS_DEBUG_DISAS -#define MIPS_DEBUG(fmt, args...) \ +#define MIPS_DEBUG(fmt, ...) \ qemu_log_mask(CPU_LOG_TB_IN_ASM, \ TARGET_FMT_lx ": %08x " fmt "\n", \ - ctx->pc, ctx->opcode , ##args) + ctx->pc, ctx->opcode , ## __VA_ARGS__) #define LOG_DISAS(...) qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__) #else -#define MIPS_DEBUG(fmt, args...) do { } while(0) +#define MIPS_DEBUG(fmt, ...) do { } while(0) #define LOG_DISAS(...) do { } while (0) #endif diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c index 9de74c4..a1f5054 100644 --- a/target-sparc/op_helper.c +++ b/target-sparc/op_helper.c @@ -13,22 +13,22 @@ //#define DEBUG_PCALL #ifdef DEBUG_MMU -#define DPRINTF_MMU(fmt, args...) \ -do { printf("MMU: " fmt , ##args); } while (0) +#define DPRINTF_MMU(fmt, ...) \ + do { printf("MMU: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF_MMU(fmt, args...) do {} while (0) +#define DPRINTF_MMU(fmt, ...) do {} while (0) #endif #ifdef DEBUG_MXCC -#define DPRINTF_MXCC(fmt, args...) \ -do { printf("MXCC: " fmt , ##args); } while (0) +#define DPRINTF_MXCC(fmt, ...) \ + do { printf("MXCC: " fmt , ## __VA_ARGS__); } while (0) #else -#define DPRINTF_MXCC(fmt, args...) do {} while (0) +#define DPRINTF_MXCC(fmt, ...) do {} while (0) #endif #ifdef DEBUG_ASI -#define DPRINTF_ASI(fmt, args...) \ -do { printf("ASI: " fmt , ##args); } while (0) +#define DPRINTF_ASI(fmt, ...) \ + do { printf("ASI: " fmt , ## __VA_ARGS__); } while (0) #endif #ifdef TARGET_SPARC64 diff --git a/tests/linux-test.c b/tests/linux-test.c index 19c0e1a..934b7ee 100644 --- a/tests/linux-test.c +++ b/tests/linux-test.c @@ -65,7 +65,7 @@ int __chk_error(const char *filename, int line, int ret) return ret; } -#define error(fmt, args...) error1(__FILE__, __LINE__, fmt, ##args) +#define error(fmt, ...) error1(__FILE__, __LINE__, fmt, ## __VA_ARGS__) #define chk_error(ret) __chk_error(__FILE__, __LINE__, (ret)) |