chiark / gitweb /
Fix printf field width types
authorRichard Kettlewell <rjk@terraraq.org.uk>
Thu, 21 Feb 2013 19:50:00 +0000 (19:50 +0000)
committerRichard Kettlewell <rjk@terraraq.org.uk>
Thu, 21 Feb 2013 19:50:00 +0000 (19:50 +0000)
vbig.cc

diff --git a/vbig.cc b/vbig.cc
index a71a42dfb5826f2c2277ceda01dae760df167ec4..0e621f3e2f1c93c527c6f364a340fce1136c1209 100644 (file)
--- a/vbig.cc
+++ b/vbig.cc
@@ -239,7 +239,7 @@ static void flushstdout() {
 
 static void clearprogress() {
   if (!progress) return;
-  printf(" %-10s %*s   \r", "", sizeof(long long)*4, "");
+  printf(" %-10s %*s   \r", "", (int)sizeof(long long)*4, "");
   flushstdout();
 }
 
@@ -253,7 +253,7 @@ static void showprogress(long long amount, const char *show) {
   int triples = sizeof(amount);
   char rawbuf[triples*3 + 1];
   char outbuf[triples*4 + 1];
-  snprintf(rawbuf, sizeof(rawbuf), "% *lld", sizeof(rawbuf)-1, amount);
+  snprintf(rawbuf, sizeof(rawbuf), "% *lld", (int)sizeof(rawbuf)-1, amount);
   for (int i=0; i<triples; i++) {
     outbuf[i*4] = ' ';
     memcpy(outbuf + i*4 + 1, rawbuf + i*3, 3);