blowfish-mktab.c: Remove the eye-candy progress meter.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 1 Jun 2013 19:35:54 +0000 (20:35 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 5 Jun 2013 23:46:09 +0000 (00:46 +0100)
It really makes a mess of parallel builds.

Makefile.am
blowfish-mktab.c

index 98c246a..36580fe 100644 (file)
@@ -512,6 +512,7 @@ BLKCS                       += blowfish
 blowfish.lo: blowfish-tab.h
 CLEANFILES             += blowfish-tab.h
 noinst_PROGRAMS                += blowfish-mktab
+blowfish_mktab_CPPFLAGS         = $(AM_CPPFLAGS) -DQUIET
 blowfish-tab.h: blowfish-mktab$e
        $(AM_V_GEN)./blowfish-mktab >blowfish-tab.h.new && \
                mv blowfish-tab.h.new blowfish-tab.h
index 86c079e..9d6fcb2 100644 (file)
 #define SPIGOT_RADIX (1ul << SPIGOT_BITS)
 #define SPIGOT_BUFLEN (SPIGOT_WORDS * 32)
 
+#ifdef QUIET
+#  define Q(x)
+#else
+#  define Q(x) x
+#endif
+
 static void spigot(uint32 *buf, size_t n)
 {
   uint32 acc = 0;
@@ -66,10 +72,10 @@ static void spigot(uint32 *buf, size_t n)
   uint32 p = 0;
   unsigned f = 0;
   unsigned max = 32 * n;
-  size_t step = n / 60;
+  Q( size_t step = n / 60; )
 
-  fputs("[                                                            ]\r[",
-       stderr);
+  Q( fputs("[                                                         ]\r[",
+          stderr); )
 
 #define EMIT(z) do {                                                   \
   if (b == -1)                                                         \
@@ -84,8 +90,8 @@ static void spigot(uint32 *buf, size_t n)
       n--;                                                             \
       if (!n)                                                          \
        goto done;                                                      \
-      if (n % step == 0)                                               \
-       fputc('.', stderr);                                             \
+      Q( if (n % step == 0)                                            \
+          fputc('.', stderr); )                                        \
     }                                                                  \
   }                                                                    \
 } while (0)
@@ -119,8 +125,8 @@ static void spigot(uint32 *buf, size_t n)
     }
   }
 
-done:
-  fputc('\n', stderr);
+done:;
+  Q( fputc('\n', stderr); )
 
 #undef EMIT
 }