From af0976f804bd5e9e45b6d33e6b5798643e5945fa Mon Sep 17 00:00:00 2001 From: ckolivas Date: Wed, 7 Mar 2012 16:01:13 +1100 Subject: [PATCH] Work around rest arguments warnings. --- liblrzip_demo.c | 4 ++-- lrzip_private.h | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/liblrzip_demo.c b/liblrzip_demo.c index 7e2eab5..6ce9b9d 100644 --- a/liblrzip_demo.c +++ b/liblrzip_demo.c @@ -19,8 +19,8 @@ extern int errno; #include #include -#define failure(format, args...) do { \ - fprintf(stderr, format, ##args); \ +#define failure(...) do { \ + fprintf(stderr, __VA_ARGS__); \ exit(1); \ } while (0) diff --git a/lrzip_private.h b/lrzip_private.h index fd9794a..3e51443 100644 --- a/lrzip_private.h +++ b/lrzip_private.h @@ -359,7 +359,7 @@ struct rzip_control { struct stream_info **sinfo_queue; char delete_outfile; FILE *outputfile; - char library_mode : 1; + char library_mode; int log_level; void (*info_cb)(void *data, int pct, int chunk_pct); void *info_data; @@ -429,30 +429,30 @@ static inline void print_err(const rzip_control *control, unsigned int line, con } } -#define print_stuff(level, format, args...) do {\ - print_stuff(control, level, __LINE__, __FILE__, __func__, format, ##args); \ +#define print_stuff(level, ...) do {\ + print_stuff(control, level, __LINE__, __FILE__, __func__, __VA_ARGS__); \ } while (0) -#define print_output(format, args...) do {\ - print_stuff(1, format, ##args); \ +#define print_output(...) do {\ + print_stuff(1, __VA_ARGS__); \ } while (0) -#define print_progress(format, args...) do {\ +#define print_progress(...) do {\ if (SHOW_PROGRESS) \ - print_stuff(2, format, ##args); \ + print_stuff(2, __VA_ARGS__); \ } while (0) -#define print_verbose(format, args...) do {\ +#define print_verbose(...) do {\ if (VERBOSE) \ - print_stuff(3, format, ##args); \ + print_stuff(3, __VA_ARGS__); \ } while (0) -#define print_maxverbose(format, args...) do {\ +#define print_maxverbose(...) do {\ if (MAX_VERBOSE) \ - print_stuff(4, format, ##args); \ + print_stuff(4, __VA_ARGS__); \ } while (0) -#define print_err(format, args...) do {\ - print_err(control, __LINE__, __FILE__, __func__, format, ##args); \ +#define print_err(...) do {\ + print_err(control, __LINE__, __FILE__, __func__, __VA_ARGS__); \ } while (0) #endif