]> www.infradead.org Git - mtd-utils.git/commitdiff
mtd-utils: new bareverbose() helper
authorMike Frysinger <vapier@gentoo.org>
Sat, 25 Sep 2010 06:05:25 +0000 (02:05 -0400)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Sat, 25 Sep 2010 10:51:51 +0000 (13:51 +0300)
Add a new helper that lets people do simple verbose output without any
implicit strings added around it.  Good for progress bars and such.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
include/common.h

index e87b215336d0c6bbf8c383a07a8af5f1c670d3bf..11b0cf6669bdd09fd563a1b6dbfc990a179ee802 100644 (file)
@@ -38,10 +38,12 @@ extern "C" {
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
 
 /* Verbose messages */
-#define verbose(verbose, fmt, ...) do {                            \
+#define bareverbose(verbose, fmt, ...) do {                        \
        if (verbose)                                               \
-               printf(PROGRAM_NAME ": " fmt "\n", ##__VA_ARGS__); \
+               printf(fmt, ##__VA_ARGS__);                        \
 } while(0)
+#define verbose(verbose, fmt, ...) \
+       bareverbose(verbose, PROGRAM_NAME ": " fmt "\n", ##__VA_ARGS__)
 
 /* Normal messages */
 #define normsg(fmt, ...) do {                              \