* [PATCH] tools: use C99 __VA_ARGS__
@ 2009-07-21 13:01 Christoph Egger
2009-07-21 13:26 ` Ian Jackson
0 siblings, 1 reply; 7+ messages in thread
From: Christoph Egger @ 2009-07-21 13:01 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 412 bytes --]
Hi!
Attached patch switches tools to consistently use C99 __VA_ARGS__.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
[-- Attachment #2: xen_tools_varargs.diff --]
[-- Type: text/x-diff, Size: 37405 bytes --]
diff -r 3341850938ac tools/blktap/drivers/img2qcow.c
--- a/tools/blktap/drivers/img2qcow.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap/drivers/img2qcow.c Tue Jul 21 14:54:31 2009 +0200
@@ -42,9 +42,9 @@
#include "blk.h"
#if 1
-#define DFPRINTF(_f, _a...) fprintf ( stderr, _f , ## _a )
+#define DFPRINTF(_f, ...) fprintf ( stderr, _f , ##__VA_ARGS__)
#else
-#define DFPRINTF(_f, _a...) ((void)0)
+#define DFPRINTF(_f, ...) ((void)0)
#endif
/* *BSD has no O_LARGEFILE */
diff -r 3341850938ac tools/blktap/drivers/qcow-create.c
--- a/tools/blktap/drivers/qcow-create.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap/drivers/qcow-create.c Tue Jul 21 14:54:31 2009 +0200
@@ -41,9 +41,9 @@
#include "tapdisk.h"
#if 1
-#define DFPRINTF(_f, _a...) fprintf ( stderr, _f , ## _a )
+#define DFPRINTF(_f, ...) fprintf ( stderr, _f , ##__VA_ARGS__)
#else
-#define DFPRINTF(_f, _a...) ((void)0)
+#define DFPRINTF(_f, ...) ((void)0)
#endif
#define MAX_NAME_LEN 1000
diff -r 3341850938ac tools/blktap/drivers/qcow2raw.c
--- a/tools/blktap/drivers/qcow2raw.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap/drivers/qcow2raw.c Tue Jul 21 14:54:31 2009 +0200
@@ -43,9 +43,9 @@
#include "blk.h"
#if 1
-#define DFPRINTF(_f, _a...) fprintf ( stderr, _f , ## _a )
+#define DFPRINTF(_f, ...) fprintf ( stderr, _f , ##__VA_ARGS__)
#else
-#define DFPRINTF(_f, _a...) ((void)0)
+#define DFPRINTF(_f, ...) ((void)0)
#endif
diff -r 3341850938ac tools/blktap/drivers/tapdisk.h
--- a/tools/blktap/drivers/tapdisk.h Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap/drivers/tapdisk.h Tue Jul 21 14:54:31 2009 +0200
@@ -63,9 +63,9 @@
/*If enabled, log all debug messages to syslog*/
#if 1
-#define DPRINTF(_f, _a...) syslog( LOG_DEBUG, __FILE__ ":%d: " _f , __LINE__, ## _a )
+#define DPRINTF(_f, ...) syslog( LOG_DEBUG, __FILE__ ":%d: " _f , __LINE__, ##__VA_ARGS__)
#else
-#define DPRINTF(_f, _a...) ((void)0)
+#define DPRINTF(_f, ...) ((void)0)
#endif
/* Things disks need to know about, these should probably be in a higher-level
diff -r 3341850938ac tools/blktap/lib/blkif.c
--- a/tools/blktap/lib/blkif.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap/lib/blkif.c Tue Jul 21 14:54:31 2009 +0200
@@ -39,9 +39,9 @@
#include "blktaplib.h"
#if 0
-#define DPRINTF(_f, _a...) printf ( _f , ## _a )
+#define DPRINTF(_f, ...) printf ( _f , ##__VA_ARGS__)
#else
-#define DPRINTF(_f, _a...) ((void)0)
+#define DPRINTF(_f, ...) ((void)0)
#endif
#define BLKIF_HASHSZ 1024
diff -r 3341850938ac tools/blktap/lib/xenbus.c
--- a/tools/blktap/lib/xenbus.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap/lib/xenbus.c Tue Jul 21 14:54:31 2009 +0200
@@ -54,9 +54,9 @@
#include "xs_api.h"
#if 0
-#define DPRINTF(_f, _a...) printf ( _f , ## _a )
+#define DPRINTF(_f, ...) printf ( _f , ##__VA_ARGS__)
#else
-#define DPRINTF(_f, _a...) ((void)0)
+#define DPRINTF(_f, ...) ((void)0)
#endif
struct backend_info
diff -r 3341850938ac tools/blktap/lib/xs_api.c
--- a/tools/blktap/lib/xs_api.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap/lib/xs_api.c Tue Jul 21 14:54:31 2009 +0200
@@ -48,9 +48,9 @@
#include "xs_api.h"
#if 0
-#define DPRINTF(_f, _a...) printf ( _f , ## _a )
+#define DPRINTF(_f, ...) printf ( _f , ##__VA_ARGS__)
#else
-#define DPRINTF(_f, _a...) ((void)0)
+#define DPRINTF(_f, ...) ((void)0)
#endif
static LIST_HEAD(watches);
diff -r 3341850938ac tools/blktap2/drivers/block-cache.c
--- a/tools/blktap2/drivers/block-cache.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/drivers/block-cache.c Tue Jul 21 14:54:31 2009 +0200
@@ -38,12 +38,12 @@
#include "tapdisk-interface.h"
#ifdef DEBUG
-#define DBG(_f, _a...) tlog_write(TLOG_DBG, _f, ##_a)
+#define DBG(_f, ...) tlog_write(TLOG_DBG, _f, ##__VA_ARGS__)
#else
-#define DBG(_f, _a...) ((void)0)
+#define DBG(_f, ...) ((void)0)
#endif
-#define WARN(_f, _a...) tlog_write(TLOG_WARN, _f, ##_a)
+#define WARN(_f, ...) tlog_write(TLOG_WARN, _f, ##__VA_ARGS__)
#define RADIX_TREE_PAGE_SHIFT 12 /* 4K pages */
#define RADIX_TREE_PAGE_SIZE (1 << RADIX_TREE_PAGE_SHIFT)
diff -r 3341850938ac tools/blktap2/drivers/block-log.c
--- a/tools/blktap2/drivers/block-log.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/drivers/block-log.c Tue Jul 21 14:54:31 2009 +0200
@@ -78,9 +78,9 @@ struct tdlog_state {
log_back_ring_t bring;
};
-#define BDPRINTF(_f, _a...) syslog (LOG_DEBUG, "log: " _f "\n", ## _a)
+#define BDPRINTF(_f, ...) syslog (LOG_DEBUG, "log: " _f "\n", ##__VA_ARGS__)
-#define BWPRINTF(_f, _a...) syslog (LOG_WARNING, "log: " _f "\n", ## _a)
+#define BWPRINTF(_f, ...) syslog (LOG_WARNING, "log: " _f "\n", ##__VA_ARGS__)
static void ctl_accept(event_id_t, char, void *);
static void ctl_request(event_id_t, char, void *);
diff -r 3341850938ac tools/blktap2/drivers/block-vhd.c
--- a/tools/blktap2/drivers/block-vhd.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/drivers/block-vhd.c Tue Jul 21 14:54:31 2009 +0200
@@ -88,17 +88,17 @@ unsigned int SPB;
}
#if (DEBUGGING == 1)
- #define DBG(level, _f, _a...) DPRINTF(_f, ##_a)
- #define ERR(err, _f, _a...) DPRINTF("ERROR: %d: " _f, err, ##_a)
- #define TRACE(s) ((void)0)
+ #define DBG(level, _f, ...) DPRINTF(_f, ##__VA_ARGS__)
+ #define ERR(err, _f, ...) DPRINTF("ERROR: %d: " _f, err, ##__VA_ARGS__)
+ #define TRACE(s) ((void)0)
#elif (DEBUGGING == 2)
- #define DBG(level, _f, _a...) tlog_write(level, _f, ##_a)
- #define ERR(err, _f, _a...) tlog_error(err, _f, ##_a)
- #define TRACE(s) __TRACE(s)
+ #define DBG(level, _f, ...) tlog_write(level, _f, ##__VA_ARGS__)
+ #define ERR(err, _f, ...) tlog_error(err, _f, ##__VA_ARGS__)
+ #define TRACE(s) __TRACE(s)
#else
- #define DBG(level, _f, _a...) ((void)0)
- #define ERR(err, _f, _a...) ((void)0)
- #define TRACE(s) ((void)0)
+ #define DBG(level, _f, ...) ((void)0)
+ #define ERR(err, _f, ...) ((void)0)
+ #define TRACE(s) ((void)0)
#endif
#if (ASSERTING == 1)
diff -r 3341850938ac tools/blktap2/drivers/img2qcow.c
--- a/tools/blktap2/drivers/img2qcow.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/drivers/img2qcow.c Tue Jul 21 14:54:31 2009 +0200
@@ -54,9 +54,9 @@
#if 1
-#define DFPRINTF(_f, _a...) fprintf ( stderr, _f , ## _a )
+#define DFPRINTF(_f, ...) fprintf ( stderr, _f , ##__VA_ARGS__)
#else
-#define DFPRINTF(_f, _a...) ((void)0)
+#define DFPRINTF(_f, ...) ((void)0)
#endif
/* *BSD has no O_LARGEFILE */
diff -r 3341850938ac tools/blktap2/drivers/io-optimize.c
--- a/tools/blktap2/drivers/io-optimize.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/drivers/io-optimize.c Tue Jul 21 14:54:31 2009 +0200
@@ -37,11 +37,11 @@
#include "tapdisk-log.h"
#if (!defined(TEST) && defined(DEBUG))
-#define DBG(ctx, f, a...) tlog_write(TLOG_DBG, f, ##a)
+#define DBG(ctx, f, ...) tlog_write(TLOG_DBG, f, ##__VA_ARGS__)
#elif defined(TEST)
-#define DBG(ctx, f, a...) printf(f, ##a)
+#define DBG(ctx, f, ...) printf(f, ##__VA_ARGS__)
#else
-#define DBG(ctx, f, a...) ((void)0)
+#define DBG(ctx, f, ...) ((void)0)
#endif
static void print_merged_iocbs(struct opioctx *ctx,
diff -r 3341850938ac tools/blktap2/drivers/lock.c
--- a/tools/blktap2/drivers/lock.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/drivers/lock.c Tue Jul 21 14:54:31 2009 +0200
@@ -52,9 +52,9 @@
#define RETRY_MAX 16
#if defined(LOGS)
-#define LOG(format, args...) printf("%d: ", __LINE__); printf(format, ## args)
+#define LOG(format, ...) printf("%d: ", __LINE__); printf(format, ##__VA_ARGS__)
#else
-#define LOG(format, args...)
+#define LOG(format, ...)
#endif
/* random wait - up to .5 seconds */
diff -r 3341850938ac tools/blktap2/drivers/qcow-create.c
--- a/tools/blktap2/drivers/qcow-create.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/drivers/qcow-create.c Tue Jul 21 14:54:31 2009 +0200
@@ -42,9 +42,9 @@
#include "qcow.h"
#if 1
-#define DFPRINTF(_f, _a...) fprintf ( stderr, _f , ## _a )
+#define DFPRINTF(_f, ...) fprintf ( stderr, _f , ##__VA_ARGS__)
#else
-#define DFPRINTF(_f, _a...) ((void)0)
+#define DFPRINTF(_f, ...) ((void)0)
#endif
#define MAX_NAME_LEN 1000
diff -r 3341850938ac tools/blktap2/drivers/qcow2raw.c
--- a/tools/blktap2/drivers/qcow2raw.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/drivers/qcow2raw.c Tue Jul 21 14:54:31 2009 +0200
@@ -50,9 +50,9 @@
#include "qcow.h"
#if 1
-#define DFPRINTF(_f, _a...) fprintf ( stderr, _f , ## _a )
+#define DFPRINTF(_f, ...) fprintf ( stderr, _f , ##__VA_ARGS__)
#else
-#define DFPRINTF(_f, _a...) ((void)0)
+#define DFPRINTF(_f, ...) ((void)0)
#endif
diff -r 3341850938ac tools/blktap2/drivers/scheduler.c
--- a/tools/blktap2/drivers/scheduler.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/drivers/scheduler.c Tue Jul 21 14:54:31 2009 +0200
@@ -34,7 +34,7 @@
#include "scheduler.h"
#include "tapdisk-log.h"
-#define DBG(_f, _a...) tlog_write(TLOG_DBG, _f, ##_a)
+#define DBG(_f, ...) tlog_write(TLOG_DBG, _f, ##__VA_ARGS__)
#define SCHEDULER_MAX_TIMEOUT 600
#define SCHEDULER_POLL_FD (SCHEDULER_POLL_READ_FD | \
diff -r 3341850938ac tools/blktap2/drivers/tapdisk-client.c
--- a/tools/blktap2/drivers/tapdisk-client.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/drivers/tapdisk-client.c Tue Jul 21 14:54:31 2009 +0200
@@ -42,9 +42,9 @@
#include "log.h"
-#define BDPRINTF(_f, _a...) fprintf (stderr, "log: " _f "\n", ## _a)
+#define BDPRINTF(_f, ...) fprintf (stderr, "log: " _f "\n", ##__VA_ARGS__)
-#define BWPRINTF(_f, _a...) fprintf (stderr, "log: " _f "\n", ## _a)
+#define BWPRINTF(_f, ...) fprintf (stderr, "log: " _f "\n", ##__VA_ARGS__)
struct writelog {
char* shmpath;
diff -r 3341850938ac tools/blktap2/drivers/tapdisk-filter.c
--- a/tools/blktap2/drivers/tapdisk-filter.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/drivers/tapdisk-filter.c Tue Jul 21 14:54:31 2009 +0200
@@ -42,7 +42,7 @@
#define WRITE_INTEGRITY "buffer integrity failure after write"
#define READ_INTEGRITY "disk integrity failure after read"
-#define DBG(f, a...) tlog_write(TLOG_WARN, f, ##a)
+#define DBG(f, ...) tlog_write(TLOG_WARN, f, ##__VA_ARGS__)
/*
* simulate IO errors by knocking request size to zero before
diff -r 3341850938ac tools/blktap2/drivers/tapdisk-image.c
--- a/tools/blktap2/drivers/tapdisk-image.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/drivers/tapdisk-image.c Tue Jul 21 14:54:31 2009 +0200
@@ -33,7 +33,7 @@
#include "tapdisk-driver.h"
#include "tapdisk-server.h"
-#define ERR(_err, _f, _a...) tlog_error(_err, _f, ##_a)
+#define ERR(_err, _f, ...) tlog_error(_err, _f, ##__VA_ARGS__)
td_image_t *
tapdisk_image_allocate(char *file, int type, int storage,
diff -r 3341850938ac tools/blktap2/drivers/tapdisk-log.h
--- a/tools/blktap2/drivers/tapdisk-log.h Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/drivers/tapdisk-log.h Tue Jul 21 14:54:31 2009 +0200
@@ -42,10 +42,10 @@ void __tlog_write(int level, const char
void __tlog_error(int err, const char *func, const char *fmt, ...)
__attribute__((format(printf, 3, 4)));
-#define tlog_write(_level, _f, _a...) \
- __tlog_write(_level, __func__, _f, ##_a)
+#define tlog_write(_level, _f, ...) \
+ __tlog_write(_level, __func__, _f, ##__VA_ARGS__)
-#define tlog_error(_err, _f, _a...) \
- __tlog_error(_err, __func__, _f, ##_a)
+#define tlog_error(_err, _f, ...) \
+ __tlog_error(_err, __func__, _f, ##__VA_ARGS__)
#endif
diff -r 3341850938ac tools/blktap2/drivers/tapdisk-queue.c
--- a/tools/blktap2/drivers/tapdisk-queue.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/drivers/tapdisk-queue.c Tue Jul 21 14:54:31 2009 +0200
@@ -37,9 +37,9 @@
#include "tapdisk-filter.h"
#include "atomicio.h"
-#define WARN(_f, _a...) tlog_write(TLOG_WARN, _f, ##_a)
-#define DBG(_f, _a...) tlog_write(TLOG_DBG, _f, ##_a)
-#define ERR(_err, _f, _a...) tlog_error(_err, _f, ##_a)
+#define WARN(_f, ...) tlog_write(TLOG_WARN, _f, ##__VA_ARGS__)
+#define DBG(_f, ...) tlog_write(TLOG_DBG, _f, ##__VA_ARGS__)
+#define ERR(_err, _f, ...) tlog_error(_err, _f, ##__VA_ARGS__)
/*
* We used a kernel patch to return an fd associated with the AIO context
diff -r 3341850938ac tools/blktap2/drivers/tapdisk-server.c
--- a/tools/blktap2/drivers/tapdisk-server.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/drivers/tapdisk-server.c Tue Jul 21 14:54:31 2009 +0200
@@ -39,8 +39,8 @@
#include "tapdisk-driver.h"
#include "tapdisk-interface.h"
-#define DBG(_level, _f, _a...) tlog_write(_level, _f, ##_a)
-#define ERR(_err, _f, _a...) tlog_error(_err, _f, ##_a)
+#define DBG(_level, _f, ...) tlog_write(_level, _f, ##__VA_ARGS__)
+#define ERR(_err, _f, ...) tlog_error(_err, _f, ##__VA_ARGS__)
tapdisk_server_t server;
diff -r 3341850938ac tools/blktap2/drivers/tapdisk-vbd.c
--- a/tools/blktap2/drivers/tapdisk-vbd.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/drivers/tapdisk-vbd.c Tue Jul 21 14:54:31 2009 +0200
@@ -43,8 +43,8 @@
#include "tapdisk-vbd.h"
#include "blktap2.h"
-#define DBG(_level, _f, _a...) tlog_write(_level, _f, ##_a)
-#define ERR(_err, _f, _a...) tlog_error(_err, _f, ##_a)
+#define DBG(_level, _f, ...) tlog_write(_level, _f, ##__VA_ARGS__)
+#define ERR(_err, _f, ...) tlog_error(_err, _f, ##__VA_ARGS__)
#if 1
#define ASSERT(p) \
diff -r 3341850938ac tools/blktap2/drivers/tapdisk2.c
--- a/tools/blktap2/drivers/tapdisk2.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/drivers/tapdisk2.c Tue Jul 21 14:54:31 2009 +0200
@@ -43,18 +43,18 @@
#define TAPDISK2_VBD 0
-#define cprintf(_err, _f, _a...) \
+#define cprintf(_err, _f, ...) \
do { \
if (child_out) { \
- fprintf(child_out, "%d: " _f, _err, ##_a); \
+ fprintf(child_out, "%d: " _f, _err, ##__VA_ARGS__); \
fflush(child_out); \
} \
} while (0)
-#define CHILD_ERR(_err, _f, _a...) \
+#define CHILD_ERR(_err, _f, ...) \
do { \
- EPRINTF(_f, ##_a); \
- cprintf(_err, _f, ##_a); \
+ EPRINTF(_f, ##__VA_ARGS__); \
+ cprintf(_err, _f, ##__VA_ARGS__); \
} while (0)
static int channel[2];
diff -r 3341850938ac tools/blktap2/drivers/td.c
--- a/tools/blktap2/drivers/td.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/drivers/td.c Tue Jul 21 14:54:31 2009 +0200
@@ -41,9 +41,9 @@
#include "tapdisk-utils.h"
#if 1
-#define DFPRINTF(_f, _a...) fprintf ( stdout, _f , ## _a )
+#define DFPRINTF(_f, ...) fprintf ( stdout, _f , ##__VA_ARGS__)
#else
-#define DFPRINTF(_f, _a...) ((void)0)
+#define DFPRINTF(_f, ...) ((void)0)
#endif
typedef enum {
diff -r 3341850938ac tools/blktap2/include/blktaplib.h
--- a/tools/blktap2/include/blktaplib.h Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/include/blktaplib.h Tue Jul 21 14:54:31 2009 +0200
@@ -37,12 +37,12 @@
#include <xen/io/blkif.h>
#if 1
-#define DPRINTF(_f, _a...) syslog(LOG_INFO, _f, ##_a)
+#define DPRINTF(_f, ...) syslog(LOG_INFO, _f, ##__VA_ARGS__)
#else
-#define DPRINTF(_f, _a...) ((void)0)
+#define DPRINTF(_f, ...) ((void)0)
#endif
-#define EPRINTF(_f, _a...) syslog(LOG_ERR, "tap-err:%s: " _f, __func__, ##_a)
+#define EPRINTF(_f, ...) syslog(LOG_ERR, "tap-err:%s: " _f, __func__, ##__VA_ARGS__)
#define BLK_RING_SIZE __RING_SIZE((blkif_sring_t *)0, XC_PAGE_SIZE)
diff -r 3341850938ac tools/blktap2/include/relative-path.h
--- a/tools/blktap2/include/relative-path.h Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/include/relative-path.h Tue Jul 21 14:54:31 2009 +0200
@@ -32,7 +32,7 @@
#define DELIMITER '/'
#define MAX_NAME_LEN 1000
-#define EPRINTF(_f, _a...) syslog(LOG_ERR, "tap-err:%s: " _f, __func__, ##_a)
+#define EPRINTF(_f, ...) syslog(LOG_ERR, "tap-err:%s: " _f, __func__, ##__VA_ARGS__)
/*
* returns a relative path from @src to @dest
diff -r 3341850938ac tools/blktap2/vhd/lib/libvhd.c
--- a/tools/blktap2/vhd/lib/libvhd.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/vhd/lib/libvhd.c Tue Jul 21 14:54:31 2009 +0200
@@ -49,11 +49,11 @@ libvhd_set_log_level(int level)
libvhd_dbg = 1;
}
-#define VHDLOG(_f, _a...) \
+#define VHDLOG(_f, ...) \
do { \
if (libvhd_dbg) \
syslog(LOG_INFO, "libvhd::%s: "_f, \
- __func__, ##_a); \
+ __func__, ##__VA_ARGS__); \
} while (0)
#define BIT_MASK 0x80
diff -r 3341850938ac tools/blktap2/vhd/lib/vhd-util-resize.c
--- a/tools/blktap2/vhd/lib/vhd-util-resize.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/vhd/lib/vhd-util-resize.c Tue Jul 21 14:54:31 2009 +0200
@@ -37,15 +37,15 @@
#include "libvhd-journal.h"
#if 1
-#define DFPRINTF(_f, _a...) fprintf(stdout, _f, ##_a)
+#define DFPRINTF(_f, ...) fprintf(stdout, _f, ##__VA_ARGS__)
#else
-#define DFPRINTF(_f, _a...) ((void)0)
+#define DFPRINTF(_f, ...) ((void)0)
#endif
-#define EPRINTF(_f, _a...) \
+#define EPRINTF(_f, ...) \
do { \
- syslog(LOG_INFO, "%s: " _f, __func__, ##_a); \
- DFPRINTF(_f, _a); \
+ syslog(LOG_INFO, "%s: " _f, __func__, ##__VA_ARGS__); \
+ DFPRINTF(_f, __VA_ARGS__); \
} while (0)
typedef struct vhd_block {
diff -r 3341850938ac tools/blktap2/vhd/vhd-util.c
--- a/tools/blktap2/vhd/vhd-util.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/blktap2/vhd/vhd-util.c Tue Jul 21 14:54:31 2009 +0200
@@ -33,9 +33,9 @@
#include "vhd-util.h"
#if 1
-#define DFPRINTF(_f, _a...) fprintf(stdout, _f , ##_a)
+#define DFPRINTF(_f, ...) fprintf(stdout, _f , ##__VA_ARGS__)
#else
-#define DFPRINTF(_f, _a...) ((void)0)
+#define DFPRINTF(_f, ...) ((void)0)
#endif
typedef int (*vhd_util_func_t) (int, char **);
diff -r 3341850938ac tools/firmware/rombios/32bit/32bitbios.c
--- a/tools/firmware/rombios/32bit/32bitbios.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/firmware/rombios/32bit/32bitbios.c Tue Jul 21 14:54:31 2009 +0200
@@ -28,7 +28,7 @@ asm (
" jmp *jumptable(,%eax,4) \n"
" .data \n"
"jumptable: \n"
-#define X(idx, ret, fn, args...) " .long "#fn"\n"
+#define X(idx, ret, fn, ...) " .long "#fn"\n"
#include "32bitprotos.h"
#undef X
);
diff -r 3341850938ac tools/firmware/rombios/32bit/pmm.c
--- a/tools/firmware/rombios/32bit/pmm.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/firmware/rombios/32bit/pmm.c Tue Jul 21 14:54:31 2009 +0200
@@ -82,9 +82,9 @@
} else
#if DEBUG_PMM
-# define PMM_DEBUG(format, p...) printf("PMM " format, ##p)
+# define PMM_DEBUG(format, ...) printf("PMM " format, ##__VA_ARGS__)
#else
-# define PMM_DEBUG(format, p...)
+# define PMM_DEBUG(format, ...)
#endif
struct pmmAllocArgs {
diff -r 3341850938ac tools/firmware/rombios/32bit/rombios_compat.h
--- a/tools/firmware/rombios/32bit/rombios_compat.h Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/firmware/rombios/32bit/rombios_compat.h Tue Jul 21 14:54:31 2009 +0200
@@ -89,7 +89,7 @@ static inline void write_byte(Bit16u seg
*addr = val;
}
-#define X(idx, ret, fn, args...) ret fn (args);
+#define X(idx, ret, fn, ...) ret fn (__VA_ARGS__);
#include "32bitprotos.h"
#undef X
diff -r 3341850938ac tools/firmware/rombios/32bitgateway.c
--- a/tools/firmware/rombios/32bitgateway.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/firmware/rombios/32bitgateway.c Tue Jul 21 14:54:31 2009 +0200
@@ -172,6 +172,6 @@ MACRO DoUpcall
jmp Upcall
MEND
-#define X(idx, ret, fn, args...) _ ## fn: DoUpcall(idx)
+#define X(idx, ret, fn, ...) _ ## fn: DoUpcall(idx)
#include "32bitprotos.h"
#undef X
diff -r 3341850938ac tools/firmware/rombios/rombios.c
--- a/tools/firmware/rombios/rombios.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/firmware/rombios/rombios.c Tue Jul 21 14:54:31 2009 +0200
@@ -728,7 +728,7 @@ typedef struct {
} cdemu_t;
#endif // BX_ELTORITO_BOOT
-#define X(idx, ret, fn, arg...) ret fn ();
+#define X(idx, ret, fn, ...) ret fn ();
#include "32bitprotos.h"
#undef X
@@ -969,49 +969,49 @@ static char bios_cvs_version_string[] =
#define BIOS_COPYRIGHT_STRING "(c) 2002 MandrakeSoft S.A. Written by Kevin Lawton & the Bochs team."
#if DEBUG_ATA
-# define BX_DEBUG_ATA(a...) BX_DEBUG(a)
-#else
-# define BX_DEBUG_ATA(a...)
+# define BX_DEBUG_ATA(...) BX_DEBUG(__VA_ARGS__)
+#else
+# define BX_DEBUG_ATA(...)
#endif
#if DEBUG_INT13_HD
-# define BX_DEBUG_INT13_HD(a...) BX_DEBUG(a)
-#else
-# define BX_DEBUG_INT13_HD(a...)
+# define BX_DEBUG_INT13_HD(...) BX_DEBUG(__VA_ARGS__)
+#else
+# define BX_DEBUG_INT13_HD(...)
#endif
#if DEBUG_INT13_CD
-# define BX_DEBUG_INT13_CD(a...) BX_DEBUG(a)
-#else
-# define BX_DEBUG_INT13_CD(a...)
+# define BX_DEBUG_INT13_CD(...) BX_DEBUG(__VA_ARGS__)
+#else
+# define BX_DEBUG_INT13_CD(...)
#endif
#if DEBUG_INT13_ET
-# define BX_DEBUG_INT13_ET(a...) BX_DEBUG(a)
-#else
-# define BX_DEBUG_INT13_ET(a...)
+# define BX_DEBUG_INT13_ET(...) BX_DEBUG(__VA_ARGS__)
+#else
+# define BX_DEBUG_INT13_ET(...)
#endif
#if DEBUG_INT13_FL
-# define BX_DEBUG_INT13_FL(a...) BX_DEBUG(a)
-#else
-# define BX_DEBUG_INT13_FL(a...)
+# define BX_DEBUG_INT13_FL(...) BX_DEBUG(__VA_ARGS__)
+#else
+# define BX_DEBUG_INT13_FL(...)
#endif
#if DEBUG_INT15
-# define BX_DEBUG_INT15(a...) BX_DEBUG(a)
-#else
-# define BX_DEBUG_INT15(a...)
+# define BX_DEBUG_INT15(...) BX_DEBUG(__VA_ARGS__)
+#else
+# define BX_DEBUG_INT15(...)
#endif
#if DEBUG_INT16
-# define BX_DEBUG_INT16(a...) BX_DEBUG(a)
-#else
-# define BX_DEBUG_INT16(a...)
+# define BX_DEBUG_INT16(...) BX_DEBUG(__VA_ARGS__)
+#else
+# define BX_DEBUG_INT16(...)
#endif
#if DEBUG_INT1A
-# define BX_DEBUG_INT1A(a...) BX_DEBUG(a)
-#else
-# define BX_DEBUG_INT1A(a...)
+# define BX_DEBUG_INT1A(...) BX_DEBUG(__VA_ARGS__)
+#else
+# define BX_DEBUG_INT1A(...)
#endif
#if DEBUG_INT74
-# define BX_DEBUG_INT74(a...) BX_DEBUG(a)
-#else
-# define BX_DEBUG_INT74(a...)
+# define BX_DEBUG_INT74(...) BX_DEBUG(__VA_ARGS__)
+#else
+# define BX_DEBUG_INT74(...)
#endif
#define SET_AL(val8) AX = ((AX & 0xff00) | (val8))
diff -r 3341850938ac tools/firmware/rombios/rombios.h
--- a/tools/firmware/rombios/rombios.h Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/firmware/rombios/rombios.h Tue Jul 21 14:54:31 2009 +0200
@@ -41,18 +41,18 @@
#define BIOS_PRINTF_ALL (BIOS_PRINTF_SCREEN | BIOS_PRINTF_INFO)
#define BIOS_PRINTF_DEBHALT (BIOS_PRINTF_SCREEN | BIOS_PRINTF_INFO | BIOS_PRINTF_HALT)
-#define printf(format, p...) bios_printf(BIOS_PRINTF_SCREEN, format, ##p)
+#define printf(format, ...) bios_printf(BIOS_PRINTF_SCREEN, format, ##__VA_ARGS__)
// Defines the output macros.
// BX_DEBUG goes to INFO port until we can easily choose debug info on a
// per-device basis. Debug info are sent only in debug mode
#if DEBUG_ROMBIOS
-# define BX_DEBUG(format, p...) bios_printf(BIOS_PRINTF_INFO, format, ##p)
+# define BX_DEBUG(format, ...) bios_printf(BIOS_PRINTF_INFO, format, ##__VA_ARGS__)
#else
-# define BX_DEBUG(format, p...)
+# define BX_DEBUG(format, ...)
#endif
-#define BX_INFO(format, p...) bios_printf(BIOS_PRINTF_INFO, format, ##p)
-#define BX_PANIC(format, p...) bios_printf(BIOS_PRINTF_DEBHALT, format, ##p)
+#define BX_INFO(format, ...) bios_printf(BIOS_PRINTF_INFO, format, ##__VA_ARGS__)
+#define BX_PANIC(format, ...) bios_printf(BIOS_PRINTF_DEBHALT, format, ##__VA_ARGS__)
#define ACPI_DATA_SIZE 0x00010000L
#define PM_IO_BASE 0xb000
diff -r 3341850938ac tools/libaio/src/syscall-alpha.h
--- a/tools/libaio/src/syscall-alpha.h Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/libaio/src/syscall-alpha.h Tue Jul 21 14:54:31 2009 +0200
@@ -11,7 +11,7 @@
"$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", \
"$22", "$23", "$24", "$25", "$27", "$28", "memory"
-#define inline_syscall0(name, args...) \
+#define inline_syscall0(name, ...) \
{ \
register long _sc_0 inline_syscall_r0_asm; \
register long _sc_19 __asm__("$19"); \
@@ -166,10 +166,10 @@
_sc_ret = _sc_0, _sc_err = _sc_19; \
}
-#define INLINE_SYSCALL1(name, nr, args...) \
+#define INLINE_SYSCALL1(name, nr, ...) \
({ \
long _sc_ret, _sc_err; \
- inline_syscall##nr(__NR_##name, args); \
+ inline_syscall##nr(__NR_##name, __VA_ARGS__); \
if (_sc_err != 0) \
{ \
_sc_ret = -(_sc_ret); \
diff -r 3341850938ac tools/libaio/src/syscall-ppc.h
--- a/tools/libaio/src/syscall-ppc.h Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/libaio/src/syscall-ppc.h Tue Jul 21 14:54:31 2009 +0200
@@ -13,7 +13,7 @@
* an error return status).
*/
#ifndef __syscall_nr
-#define __syscall_nr(nr, type, name, args...) \
+#define __syscall_nr(nr, type, name, ...) \
unsigned long __sc_ret, __sc_err; \
{ \
register unsigned long __sc_0 __asm__ ("r0"); \
@@ -24,7 +24,7 @@
register unsigned long __sc_7 __asm__ ("r7"); \
register unsigned long __sc_8 __asm__ ("r8"); \
\
- __sc_loadargs_##nr(name, args); \
+ __sc_loadargs_##nr(name, __VA_ARGS__); \
__asm__ __volatile__ \
("sc \n\t" \
"mfcr %0 " \
@@ -42,7 +42,7 @@
return (type) __sc_ret
#endif
-#define __sc_loadargs_0(name, dummy...) \
+#define __sc_loadargs_0(name, ...) \
__sc_0 = __NR_##name
#define __sc_loadargs_1(name, arg1) \
__sc_loadargs_0(name); \
diff -r 3341850938ac tools/libxc/xc_dom.h
--- a/tools/libxc/xc_dom.h Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/libxc/xc_dom.h Tue Jul 21 14:54:31 2009 +0200
@@ -190,8 +190,8 @@ int xc_dom_printf(const char *fmt, ...)
int xc_dom_panic_func(const char *file, int line, xc_error_code err,
const char *fmt, ...)
__attribute__ ((format(printf, 4, 5)));
-#define xc_dom_panic(err, fmt, args...) \
- xc_dom_panic_func(__FILE__, __LINE__, err, fmt, ## args)
+#define xc_dom_panic(err, fmt, ...) \
+ xc_dom_panic_func(__FILE__, __LINE__, err, fmt, ##__VA_ARGS__)
#define xc_dom_trace(mark) \
xc_dom_printf("%s:%d: trace %s\n", __FILE__, __LINE__, mark)
diff -r 3341850938ac tools/libxc/xc_private.h
--- a/tools/libxc/xc_private.h Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/libxc/xc_private.h Tue Jul 21 14:54:31 2009 +0200
@@ -54,29 +54,29 @@
#define MAX_PAGECACHE_USAGE (4*1024)
#if INFO
-#define IPRINTF(_f, _a...) printf(_f , ## _a)
+#define IPRINTF(_f, ...) printf(_f , ##__VA_ARGS__)
#else
-#define IPRINTF(_f, _a...) ((void)0)
+#define IPRINTF(_f, ...) ((void)0)
#endif
#if DEBUG
-#define DPRINTF(_f, _a...) fprintf(stderr, _f , ## _a)
+#define DPRINTF(_f, ...) fprintf(stderr, _f , ##__VA_ARGS__)
#else
-#define DPRINTF(_f, _a...) ((void)0)
+#define DPRINTF(_f, ...) ((void)0)
#endif
#if PROGRESS
-#define PPRINTF(_f, _a...) fprintf(stderr, _f , ## _a)
+#define PPRINTF(_f, ...) fprintf(stderr, _f , ##__VA_ARGS__)
#else
-#define PPRINTF(_f, _a...)
+#define PPRINTF(_f, ...)
#endif
char *safe_strerror(int errcode);
void xc_set_error(int code, const char *fmt, ...);
-#define ERROR(_m, _a...) xc_set_error(XC_INTERNAL_ERROR, _m , ## _a )
-#define PERROR(_m, _a...) xc_set_error(XC_INTERNAL_ERROR, _m " (%d = %s)", \
- ## _a , errno, safe_strerror(errno))
+#define ERROR(_m, ...) xc_set_error(XC_INTERNAL_ERROR, _m , ##__VA_ARGS__ )
+#define PERROR(_m, ...) xc_set_error(XC_INTERNAL_ERROR, _m " (%d = %s)", \
+ ##__VA_ARGS__ , errno, safe_strerror(errno))
int lock_pages(void *addr, size_t len);
void unlock_pages(void *addr, size_t len);
diff -r 3341850938ac tools/python/xen/lowlevel/acm/acm.c
--- a/tools/python/xen/lowlevel/acm/acm.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/python/xen/lowlevel/acm/acm.c Tue Jul 21 14:54:31 2009 +0200
@@ -33,8 +33,8 @@
#include <xen/xsm/acm.h>
#include <xen/xsm/acm_ops.h>
-#define PERROR(_m, _a...) \
-fprintf(stderr, "ERROR: " _m " (%d = %s)\n" , ## _a , \
+#define PERROR(_m, ...) \
+fprintf(stderr, "ERROR: " _m " (%d = %s)\n" , ##__VA_ARGS__, \
errno, strerror(errno))
static PyObject *acm_error_obj;
diff -r 3341850938ac tools/security/secpol_tool.c
--- a/tools/security/secpol_tool.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/security/secpol_tool.c Tue Jul 21 14:54:31 2009 +0200
@@ -39,8 +39,8 @@
#include <xenctrl.h>
-#define PERROR(_m, _a...) \
-fprintf(stderr, "ERROR: " _m " (%d = %s)\n" , ## _a , \
+#define PERROR(_m, ...) \
+fprintf(stderr, "ERROR: " _m " (%d = %s)\n" , ##__VA_ARGS__, \
errno, strerror(errno))
void usage(char *progname)
diff -r 3341850938ac tools/vnet/libxutil/debug.h
--- a/tools/vnet/libxutil/debug.h Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/vnet/libxutil/debug.h Tue Jul 21 14:54:31 2009 +0200
@@ -28,17 +28,17 @@
#ifdef DEBUG
-#define dprintf(fmt, args...) printk(KERN_DEBUG "[DBG] " MODULE_NAME ">%s" fmt, __FUNCTION__, ##args)
-#define wprintf(fmt, args...) printk(KERN_WARNING "[WRN] " MODULE_NAME ">%s" fmt, __FUNCTION__, ##args)
-#define iprintf(fmt, args...) printk(KERN_INFO "[INF] " MODULE_NAME ">%s" fmt, __FUNCTION__, ##args)
-#define eprintf(fmt, args...) printk(KERN_ERR "[ERR] " MODULE_NAME ">%s" fmt, __FUNCTION__, ##args)
+#define dprintf(fmt, ...) printk(KERN_DEBUG "[DBG] " MODULE_NAME ">%s" fmt, __FUNCTION__, ##__VA_ARGS__)
+#define wprintf(fmt, ...) printk(KERN_WARNING "[WRN] " MODULE_NAME ">%s" fmt, __FUNCTION__, ##__VA_ARGS__)
+#define iprintf(fmt, ...) printk(KERN_INFO "[INF] " MODULE_NAME ">%s" fmt, __FUNCTION__, ##__VA_ARGS__)
+#define eprintf(fmt, ...) printk(KERN_ERR "[ERR] " MODULE_NAME ">%s" fmt, __FUNCTION__, ##__VA_ARGS__)
#else
-#define dprintf(fmt, args...) do {} while(0)
-#define wprintf(fmt, args...) printk(KERN_WARNING "[WRN] " MODULE_NAME fmt, ##args)
-#define iprintf(fmt, args...) printk(KERN_INFO "[INF] " MODULE_NAME fmt, ##args)
-#define eprintf(fmt, args...) printk(KERN_ERR "[ERR] " MODULE_NAME fmt, ##args)
+#define dprintf(fmt, ...) do {} while(0)
+#define wprintf(fmt, ...) printk(KERN_WARNING "[WRN] " MODULE_NAME fmt, ##__VA_ARGS__)
+#define iprintf(fmt, ...) printk(KERN_INFO "[INF] " MODULE_NAME fmt, ##__VA_ARGS__)
+#define eprintf(fmt, ...) printk(KERN_ERR "[ERR] " MODULE_NAME fmt, ##__VA_ARGS__)
#endif
@@ -48,17 +48,17 @@
#ifdef DEBUG
-#define dprintf(fmt, args...) fprintf(stdout, "%d [DBG] " MODULE_NAME ">%s" fmt, getpid(), __FUNCTION__, ##args)
-#define wprintf(fmt, args...) fprintf(stderr, "%d [WRN] " MODULE_NAME ">%s" fmt, getpid(), __FUNCTION__, ##args)
-#define iprintf(fmt, args...) fprintf(stderr, "%d [INF] " MODULE_NAME ">%s" fmt, getpid(), __FUNCTION__, ##args)
-#define eprintf(fmt, args...) fprintf(stderr, "%d [ERR] " MODULE_NAME ">%s" fmt, getpid(), __FUNCTION__, ##args)
+#define dprintf(fmt, ...) fprintf(stdout, "%d [DBG] " MODULE_NAME ">%s" fmt, getpid(), __FUNCTION__, ##__VA_ARGS__)
+#define wprintf(fmt, ...) fprintf(stderr, "%d [WRN] " MODULE_NAME ">%s" fmt, getpid(), __FUNCTION__, ##__VA_ARGS__)
+#define iprintf(fmt, ...) fprintf(stderr, "%d [INF] " MODULE_NAME ">%s" fmt, getpid(), __FUNCTION__, ##__VA_ARGS__)
+#define eprintf(fmt, ...) fprintf(stderr, "%d [ERR] " MODULE_NAME ">%s" fmt, getpid(), __FUNCTION__, ##__VA_ARGS__)
#else
-#define dprintf(fmt, args...) do {} while(0)
-#define wprintf(fmt, args...) fprintf(stderr, "%d [WRN] " MODULE_NAME fmt, getpid(), ##args)
-#define iprintf(fmt, args...) fprintf(stderr, "%d [INF] " MODULE_NAME fmt, getpid(), ##args)
-#define eprintf(fmt, args...) fprintf(stderr, "%d [ERR] " MODULE_NAME fmt, getpid(), ##args)
+#define dprintf(fmt, ...) do {} while(0)
+#define wprintf(fmt, ...) fprintf(stderr, "%d [WRN] " MODULE_NAME fmt, getpid(), ##__VA_ARGS__)
+#define iprintf(fmt, ...) fprintf(stderr, "%d [INF] " MODULE_NAME fmt, getpid(), ##__VA_ARGS__)
+#define eprintf(fmt, ...) fprintf(stderr, "%d [ERR] " MODULE_NAME fmt, getpid(), ##__VA_ARGS__)
#endif
diff -r 3341850938ac tools/vnet/libxutil/sxpr_parser.c
--- a/tools/vnet/libxutil/sxpr_parser.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/vnet/libxutil/sxpr_parser.c Tue Jul 21 14:54:31 2009 +0200
@@ -45,13 +45,13 @@
*/
#ifdef DEBUG
-#define dprintf(fmt, args...) IOStream_print(iostdout, "[DEBUG] %s" fmt, __FUNCTION__, ##args)
+#define dprintf(fmt, ...) IOStream_print(iostdout, "[DEBUG] %s" fmt, __FUNCTION__, ##__VA_ARGS__)
#else
-#define dprintf(fmt, args...) do{ }while(0)
+#define dprintf(fmt, ...) do{ }while(0)
#endif
#undef printf
-#define printf(fmt, args...) IOStream_print(iostdout, fmt, ##args)
+#define printf(fmt, ...) IOStream_print(iostdout, fmt, ##__VA_ARGS__)
static int state_start(Parser *p, char c);
static int begin_start(Parser *p, char c);
diff -r 3341850938ac tools/vtpm_manager/manager/vtpm_manager_handler.c
--- a/tools/vtpm_manager/manager/vtpm_manager_handler.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/vtpm_manager/manager/vtpm_manager_handler.c Tue Jul 21 14:54:31 2009 +0200
@@ -51,9 +51,9 @@
#include "log.h"
#include "buffer.h"
-#define vtpmhandlerloginfo(module,fmt,args...) vtpmloginfo (module, "[%s]: " fmt, thread_name, ##args );
-#define vtpmhandlerloginfomore(module,fmt,args...) vtpmloginfomore (module, fmt, ##args );
-#define vtpmhandlerlogerror(module,fmt,args...) vtpmlogerror (module, "[%s]: " fmt, thread_name, ##args );
+#define vtpmhandlerloginfo(module,fmt,...) vtpmloginfo (module, "[%s]: " fmt, thread_name, ##__VA_ARGS__);
+#define vtpmhandlerloginfomore(module,fmt,...) vtpmloginfomore (module, fmt, ##__VA_ARGS__);
+#define vtpmhandlerlogerror(module,fmt,...) vtpmlogerror (module, "[%s]: " fmt, thread_name, ##__VA_ARGS__);
// ---------------------- Prototypes -------------------
TPM_RESULT vtpm_manager_handle_vtpm_cmd(VTPM_DMI_RESOURCE *dmi_res,
diff -r 3341850938ac tools/vtpm_manager/util/log.h
--- a/tools/vtpm_manager/util/log.h Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/vtpm_manager/util/log.h Tue Jul 21 14:54:31 2009 +0200
@@ -73,18 +73,18 @@ static char *module_names[] = { "",
#define SETBIT(num,idx) (num) |= BITMASK(idx)
#define CLEARBIT(num,idx) (num) &= ( ~ BITMASK(idx) )
-#define vtpmloginfo(module, fmt, args...) \
+#define vtpmloginfo(module, fmt, ...) \
if (GETBIT (LOGGING_MODULES, module) == 1) { \
- fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##args); \
+ fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##__VA_ARGS__); \
}
-#define vtpmloginfomore(module, fmt, args...) \
+#define vtpmloginfomore(module, fmt, ...) \
if (GETBIT (LOGGING_MODULES, module) == 1) { \
- fprintf (stdout, fmt,##args); \
+ fprintf (stdout, fmt, ##__VA_ARGS__); \
}
-#define vtpmlogerror(module, fmt, args...) \
- fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##args);
+#define vtpmlogerror(module, fmt, ...) \
+ fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##__VA_ARGS__);
//typedef UINT32 tpm_size_t;
diff -r 3341850938ac tools/xenmon/xenbaked.c
--- a/tools/xenmon/xenbaked.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/xenmon/xenbaked.c Tue Jul 21 14:54:31 2009 +0200
@@ -44,10 +44,10 @@
#include <sys/select.h>
#include <getopt.h>
-#define PERROR(_m, _a...) \
+#define PERROR(_m, ...) \
do { \
int __saved_errno = errno; \
- fprintf(stderr, "ERROR: " _m " (%d = %s)\n" , ## _a , \
+ fprintf(stderr, "ERROR: " _m " (%d = %s)\n" , ##__VA_ARGS__, \
__saved_errno, strerror(__saved_errno)); \
errno = __saved_errno; \
} while (0)
diff -r 3341850938ac tools/xenstore/utils.h
--- a/tools/xenstore/utils.h Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/xenstore/utils.h Tue Jul 21 14:54:31 2009 +0200
@@ -26,7 +26,7 @@ void barf_perror(const char *fmt, ...) _
void (*xprintf)(const char *fmt, ...);
-#define eprintf(_fmt, _args...) xprintf("[ERR] %s" _fmt, __FUNCTION__, ##_args)
+#define eprintf(_fmt, ...) xprintf("[ERR] %s" _fmt, __FUNCTION__, ##__VA_ARGS__)
/*
* Mux errno values onto returned pointers.
diff -r 3341850938ac tools/xentrace/xentrace.c
--- a/tools/xentrace/xentrace.c Mon Jul 20 15:51:14 2009 +0100
+++ b/tools/xentrace/xentrace.c Tue Jul 21 14:54:31 2009 +0200
@@ -31,10 +31,10 @@
#include <xenctrl.h>
-#define PERROR(_m, _a...) \
+#define PERROR(_m, ...) \
do { \
int __saved_errno = errno; \
- fprintf(stderr, "ERROR: " _m " (%d = %s)\n" , ## _a , \
+ fprintf(stderr, "ERROR: " _m " (%d = %s)\n" , ##__VA_ARGS__, \
__saved_errno, strerror(__saved_errno)); \
errno = __saved_errno; \
} while (0)
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] tools: use C99 __VA_ARGS__
2009-07-21 13:01 [PATCH] tools: use C99 __VA_ARGS__ Christoph Egger
@ 2009-07-21 13:26 ` Ian Jackson
2009-07-21 13:47 ` Christoph Egger
0 siblings, 1 reply; 7+ messages in thread
From: Ian Jackson @ 2009-07-21 13:26 UTC (permalink / raw)
To: Christoph Egger; +Cc: xen-devel
Christoph Egger writes ("[Xen-devel] [PATCH] tools: use C99 __VA_ARGS__"):
> Attached patch switches tools to consistently use C99 __VA_ARGS__.
What is the benefit of this ? Xen requires GCC and the GCC variable
argument list extension has been around forever, so it doesn't seem to
aid portability.
The GCC syntax is considerably prettier than the C99 one.
Ian.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] tools: use C99 __VA_ARGS__
2009-07-21 13:26 ` Ian Jackson
@ 2009-07-21 13:47 ` Christoph Egger
2009-07-21 13:50 ` Ian Jackson
2009-07-21 14:24 ` Keir Fraser
0 siblings, 2 replies; 7+ messages in thread
From: Christoph Egger @ 2009-07-21 13:47 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
On Tuesday 21 July 2009 15:26:14 Ian Jackson wrote:
> Christoph Egger writes ("[Xen-devel] [PATCH] tools: use C99 __VA_ARGS__"):
> > Attached patch switches tools to consistently use C99 __VA_ARGS__.
>
> What is the benefit of this ?
Consistency in the whole tree in combination with two other patches
(xen-kernel and minios) which I have not yet submitted.
> Xen requires GCC and the GCC variable
> argument list extension has been around forever,
That's not a reason to stick on old things.
> so it doesn't seem to aid portability.
No, not in this case.
But the other patch for the xen-kernel touches
the public headers.
AFAIK the public headers should follow the standard.
> The GCC syntax is considerably prettier than the C99 one.
This is subjective.
Christoph
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] tools: use C99 __VA_ARGS__
2009-07-21 13:47 ` Christoph Egger
@ 2009-07-21 13:50 ` Ian Jackson
2009-07-21 14:26 ` Christoph Egger
2009-07-21 14:24 ` Keir Fraser
1 sibling, 1 reply; 7+ messages in thread
From: Ian Jackson @ 2009-07-21 13:50 UTC (permalink / raw)
To: Christoph Egger; +Cc: xen-devel@lists.xensource.com
Christoph Egger writes ("Re: [Xen-devel] [PATCH] tools: use C99 __VA_ARGS__"):
> On Tuesday 21 July 2009 15:26:14 Ian Jackson wrote:
> > Christoph Egger writes ("[Xen-devel] [PATCH] tools: use C99 __VA_ARGS__"):
> > > Attached patch switches tools to consistently use C99 __VA_ARGS__.
> >
> > What is the benefit of this ?
>
> Consistency in the whole tree in combination with two other patches
> (xen-kernel and minios) which I have not yet submitted.
Umm, so what's the benefit of the whole patchset ?
> > Xen requires GCC and the GCC variable
> > argument list extension has been around forever,
>
> That's not a reason to stick on old things.
Neither is there apparently any reason to change.
> > so it doesn't seem to aid portability.
>
> No, not in this case.
>
> But the other patch for the xen-kernel touches
> the public headers.
> AFAIK the public headers should follow the standard.
Do the public headers currently work with other compilers ? There is
an argument for using the standard syntax there to make it easier for
kernels compiled with non-GCC compilers to provide Xen guest support.
> > The GCC syntax is considerably prettier than the C99 one.
>
> This is subjective.
Nevertheless it is true.
Ian.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] tools: use C99 __VA_ARGS__
2009-07-21 13:47 ` Christoph Egger
2009-07-21 13:50 ` Ian Jackson
@ 2009-07-21 14:24 ` Keir Fraser
1 sibling, 0 replies; 7+ messages in thread
From: Keir Fraser @ 2009-07-21 14:24 UTC (permalink / raw)
To: Christoph Egger, xen-devel@lists.xensource.com; +Cc: Ian Jackson
On 21/07/2009 14:47, "Christoph Egger" <Christoph.Egger@amd.com> wrote:
> On Tuesday 21 July 2009 15:26:14 Ian Jackson wrote:
>> Christoph Egger writes ("[Xen-devel] [PATCH] tools: use C99 __VA_ARGS__"):
>>> Attached patch switches tools to consistently use C99 __VA_ARGS__.
>>
>> What is the benefit of this ?
>
> Consistency in the whole tree in combination with two other patches
> (xen-kernel and minios) which I have not yet submitted.
We aren't going to change this to C99 style.
-- Keir
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] tools: use C99 __VA_ARGS__
2009-07-21 13:50 ` Ian Jackson
@ 2009-07-21 14:26 ` Christoph Egger
2009-07-21 14:35 ` Keir Fraser
0 siblings, 1 reply; 7+ messages in thread
From: Christoph Egger @ 2009-07-21 14:26 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel@lists.xensource.com
[-- Attachment #1: Type: text/plain, Size: 1757 bytes --]
On Tuesday 21 July 2009 15:50:56 Ian Jackson wrote:
> Christoph Egger writes ("Re: [Xen-devel] [PATCH] tools: use C99
__VA_ARGS__"):
> > On Tuesday 21 July 2009 15:26:14 Ian Jackson wrote:
> > > Christoph Egger writes ("[Xen-devel] [PATCH] tools: use C99
__VA_ARGS__"):
> > > > Attached patch switches tools to consistently use C99 __VA_ARGS__.
> > >
> > > What is the benefit of this ?
> >
> > Consistency in the whole tree in combination with two other patches
> > (xen-kernel and minios) which I have not yet submitted.
>
> Umm, so what's the benefit of the whole patchset ?
Consistency. :)
> > > Xen requires GCC and the GCC variable
> > > argument list extension has been around forever,
> >
> > That's not a reason to stick on old things.
>
> Neither is there apparently any reason to change.
>
> > > so it doesn't seem to aid portability.
> >
> > No, not in this case.
> >
> > But the other patch for the xen-kernel touches
> > the public headers.
> > AFAIK the public headers should follow the standard.
>
> Do the public headers currently work with other compilers ?
Yes, Sun compiler.
> There is an argument for using the standard syntax there to make it easier
> for kernels compiled with non-GCC compilers to provide Xen guest support.
I have attached the part of the xen-kernel patch which touches the public
headers only. I suppose, Sun didn't use acm or they would have noticed it.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Christoph
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
[-- Attachment #2: xen_public_varargs.diff --]
[-- Type: text/x-diff, Size: 485 bytes --]
diff -r 534d3716bbbe xen/include/public/xsm/acm.h
--- a/xen/include/public/xsm/acm.h Tue Jul 21 12:06:52 2009 +0100
+++ b/xen/include/public/xsm/acm.h Tue Jul 21 16:21:34 2009 +0200
@@ -35,9 +35,9 @@
/* #define ACM_DEBUG */
#ifdef ACM_DEBUG
-# define printkd(fmt, args...) printk(fmt,## args)
+# define printkd(fmt, ...) printk(fmt, ##__VA_ARGS__)
#else
-# define printkd(fmt, args...)
+# define printkd(fmt, ...)
#endif
/* default ssid reference value if not supplied */
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] tools: use C99 __VA_ARGS__
2009-07-21 14:26 ` Christoph Egger
@ 2009-07-21 14:35 ` Keir Fraser
0 siblings, 0 replies; 7+ messages in thread
From: Keir Fraser @ 2009-07-21 14:35 UTC (permalink / raw)
To: Christoph Egger, Ian Jackson; +Cc: xen-devel@lists.xensource.com
On 21/07/2009 15:26, "Christoph Egger" <Christoph.Egger@amd.com> wrote:
> I have attached the part of the xen-kernel patch which touches the public
> headers only. I suppose, Sun didn't use acm or they would have noticed it.
I'll take this one.
-- Keir
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-07-21 14:35 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-21 13:01 [PATCH] tools: use C99 __VA_ARGS__ Christoph Egger
2009-07-21 13:26 ` Ian Jackson
2009-07-21 13:47 ` Christoph Egger
2009-07-21 13:50 ` Ian Jackson
2009-07-21 14:26 ` Christoph Egger
2009-07-21 14:35 ` Keir Fraser
2009-07-21 14:24 ` Keir Fraser
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.