Thread (2 messages) 2 messages, 2 authors, 2012-10-20

[PATCH] progressbar: use __stringify in format string

From: Alexander Aring <hidden>
Date: 2012-10-20 11:13:22
Subsystem: library code, the rest · Maintainers: Andrew Morton, Linus Torvalds

Use stringify in format string for HASH_PER_LINE.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
 lib/show_progress.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/show_progress.c b/lib/show_progress.c
index d958a44..a43b4c9 100644
--- a/lib/show_progress.c
+++ b/lib/show_progress.c
@@ -20,6 +20,7 @@
 #include <common.h>
 #include <progress.h>
 #include <asm-generic/div64.h>
+#include <linux/stringify.h>
 
 #define HASHES_PER_LINE	65
 
@@ -56,7 +57,9 @@ void init_progression_bar(int max)
 	progress_max = max;
 	spin = 0;
 	if (progress_max)
-		printf("\t[%65s]\r\t[", "");
+		printf("\t[%"
+				__stringify(HASHES_PER_LINE)
+				"s]\r\t[", "");
 	else
 		printf("\t");
 }
-- 
1.7.12.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help