From 2b0f1ed10968c981d131f5cf4a44d2cf0966b8ba Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 22 May 2014 09:01:51 -0600 Subject: [PATCH] Change all variadic macros to C99 style --- examples/elf/elf_main.c | 8 ++++---- examples/nxflat/nxflat_main.c | 8 ++++---- examples/posix_spawn/spawn_main.c | 8 ++++---- netutils/thttpd/fdwatch.c | 8 ++++---- nshlib/nsh_console.h | 2 +- system/cle/cle.c | 8 ++++---- system/i2c/i2ctool.h | 4 ++-- system/inifile/inifile.c | 8 ++++---- system/vi/vi.c | 8 ++++---- system/zmodem/zm.h | 8 ++++---- 10 files changed, 35 insertions(+), 35 deletions(-) diff --git a/examples/elf/elf_main.c b/examples/elf/elf_main.c index e1bdb4aa5..88c6e804f 100644 --- a/examples/elf/elf_main.c +++ b/examples/elf/elf_main.c @@ -106,11 +106,11 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(format, arg...) dbg(format, ##arg) -# define err(format, arg...) dbg(format, ##arg) +# define message(format, ...) dbg(format, ##__VA_ARGS__) +# define err(format, ...) dbg(format, ##__VA_ARGS__) # else -# define message(format, arg...) printf(format, ##arg) -# define err(format, arg...) fprintf(stderr, format, ##arg) +# define message(format, ...) printf(format, ##__VA_ARGS__) +# define err(format, ...) fprintf(stderr, format, ##__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG diff --git a/examples/nxflat/nxflat_main.c b/examples/nxflat/nxflat_main.c index e3b06addb..b47b76771 100644 --- a/examples/nxflat/nxflat_main.c +++ b/examples/nxflat/nxflat_main.c @@ -102,11 +102,11 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(format, arg...) dbg(format, ##arg) -# define err(format, arg...) dbg(format, ##arg) +# define message(format, ...) dbg(format, ##__VA_ARGS__) +# define err(format, ...) dbg(format, ##__VA_ARGS__) # else -# define message(format, arg...) printf(format, ##arg) -# define err(format, arg...) fprintf(stderr, format, ##arg) +# define message(format, ...) printf(format, ##__VA_ARGS__) +# define err(format, ...) fprintf(stderr, format, ##__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG diff --git a/examples/posix_spawn/spawn_main.c b/examples/posix_spawn/spawn_main.c index efb6c1af1..dff0f7c1e 100644 --- a/examples/posix_spawn/spawn_main.c +++ b/examples/posix_spawn/spawn_main.c @@ -109,11 +109,11 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(format, arg...) dbg(format, ##arg) -# define err(format, arg...) dbg(format, ##arg) +# define message(format, ...) dbg(format, ##__VA_ARGS__) +# define err(format, ...) dbg(format, ##__VA_ARGS__) # else -# define message(format, arg...) printf(format, ##arg) -# define err(format, arg...) fprintf(stderr, format, ##arg) +# define message(format, ...) printf(format, ##__VA_ARGS__) +# define err(format, ...) fprintf(stderr, format, ##__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG diff --git a/netutils/thttpd/fdwatch.c b/netutils/thttpd/fdwatch.c index 8a578b40c..ba955f420 100644 --- a/netutils/thttpd/fdwatch.c +++ b/netutils/thttpd/fdwatch.c @@ -63,10 +63,10 @@ #ifdef CONFIG_THTTPD_FDWATCH_DEBUG # ifdef CONFIG_CPP_HAVE_VARARGS -# define fwdbg(format, arg...) ndbg(format, ##arg) -# define fwlldbg(format, arg...) nlldbg(format, ##arg) -# define fwvdbg(format, arg...) nvdbg(format, ##arg) -# define fwllvdbg(format, arg...) nllvdbg(format, ##arg) +# define fwdbg(format, ...) ndbg(format, ##__VA_ARGS__) +# define fwlldbg(format, ...) nlldbg(format, ##__VA_ARGS__) +# define fwvdbg(format, ...) nvdbg(format, ##__VA_ARGS__) +# define fwllvdbg(format, ...) nllvdbg(format, ##__VA_ARGS__) # else # define fwdbg ndbg # define fwlldbg nlldbg diff --git a/nshlib/nsh_console.h b/nshlib/nsh_console.h index b02c59dc6..8731b6bf1 100644 --- a/nshlib/nsh_console.h +++ b/nshlib/nsh_console.h @@ -63,7 +63,7 @@ #define nsh_exit(v,s) (v)->exit(v,s) #ifdef CONFIG_CPP_HAVE_VARARGS -# define nsh_output(v, fmt...) (v)->output(v, ##fmt) +# define nsh_output(v, ...) (v)->output(v, ##__VA_ARGS__) #else # define nsh_output vtbl->output #endif diff --git a/system/cle/cle.c b/system/cle/cle.c index 02c5efbd6..ca361c90c 100644 --- a/system/cle/cle.c +++ b/system/cle/cle.c @@ -107,15 +107,15 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # if CONFIG_SYSTEM_CLE_DEBUGLEVEL > 0 -# define cledbg(format, arg...) \ - syslog(EXTRA_FMT format EXTRA_ARG, ##arg) +# define cledbg(format, ...) \ + syslog(EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) # else # define cledbg(x...) # endif # if CONFIG_SYSTEM_CLE_DEBUGLEVEL > 1 -# define clevdbg(format, arg...) \ - syslog(EXTRA_FMT format EXTRA_ARG, ##arg) +# define clevdbg(format, ...) \ + syslog(EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) # else # define clevdbg(x...) # endif diff --git a/system/i2c/i2ctool.h b/system/i2c/i2ctool.h index d8cc07203..beaf8c104 100644 --- a/system/i2c/i2ctool.h +++ b/system/i2c/i2ctool.h @@ -124,9 +124,9 @@ /* Output is via printf but can be changed using this macro */ #ifdef CONFIG_CPP_HAVE_VARARGS -# define i2c_output(v, fmt...) printf(v, ##fmt) +# define i2c_output(v, ...) printf(v, ##__VA_ARGS__) #else -# define i2c_output printf +# define i2c_output printf #endif /**************************************************************************** diff --git a/system/inifile/inifile.c b/system/inifile/inifile.c index 9f196e558..d82c4f127 100644 --- a/system/inifile/inifile.c +++ b/system/inifile/inifile.c @@ -62,15 +62,15 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # if CONFIG_SYSTEM_INIFILE_DEBUGLEVEL > 0 -# define inidbg(format, arg...) \ - printf(EXTRA_FMT format EXTRA_ARG, ##arg) +# define inidbg(format, ...) \ + printf(EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) # else # define inidbg(x...) # endif # if CONFIG_SYSTEM_INIFILE_DEBUGLEVEL > 1 -# define inivdbg(format, arg...) \ - printf(EXTRA_FMT format EXTRA_ARG, ##arg) +# define inivdbg(format, ...) \ + printf(EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) # else # define inivdbg(x...) # endif diff --git a/system/vi/vi.c b/system/vi/vi.c index 4fbc643a8..35b2a8610 100644 --- a/system/vi/vi.c +++ b/system/vi/vi.c @@ -149,8 +149,8 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # if CONFIG_SYSTEM_VI_DEBUGLEVEL > 0 -# define vidbg(format, arg...) \ - syslog(EXTRA_FMT format EXTRA_ARG, ##arg) +# define vidbg(format, ...) \ + syslog(EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) # define vvidbg(format, ap) \ vsyslog(format, ap) # else @@ -159,8 +159,8 @@ # endif # if CONFIG_SYSTEM_VI_DEBUGLEVEL > 1 -# define vivdbg(format, arg...) \ - syslog(EXTRA_FMT format EXTRA_ARG, ##arg) +# define vivdbg(format, ...) \ + syslog(EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) # else # define vivdbg(x...) # endif diff --git a/system/zmodem/zm.h b/system/zmodem/zm.h index ec653d796..88c46a269 100644 --- a/system/zmodem/zm.h +++ b/system/zmodem/zm.h @@ -229,16 +229,16 @@ */ #ifdef CONFIG_DEBUG_ZMODEM -# define zmprintf(format, arg...) fprintf(stderr, format, ##arg) -# define zmdbg(format, arg...) fprintf(stderr, EXTRA_FMT format EXTRA_ARG, ##arg) +# define zmprintf(format, ...) fprintf(stderr, format, ##__VA_ARGS__) +# define zmdbg(format, ...) fprintf(stderr, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) #else # undef CONFIG_SYSTEM_ZMODEM_DUMPBUFFER # ifdef CONFIG_CPP_HAVE_VARARGS # define zmprintf(x...) # define zmdbg(x...) # else -# define zmprintf (void) -# define zmdbg (void) +# define zmprintf (void) +# define zmdbg (void) # endif #endif