From: Alexander Aring <alex.aring@googlemail.com>
To: barebox@lists.infradead.org
Subject: [PATCH] progressbar: use __stringify in format string
Date: Sat, 20 Oct 2012 13:15:04 +0200 [thread overview]
Message-ID: <1350731704-17204-1-git-send-email-alex.aring@gmail.com> (raw)
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
next reply other threads:[~2012-10-20 11:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-20 11:15 Alexander Aring [this message]
2012-10-20 12:13 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-21 20:59 Alexander Aring
2012-10-23 6:25 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1350731704-17204-1-git-send-email-alex.aring@gmail.com \
--to=alex.aring@googlemail.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox