Make flags be macros rather than enumerations, to ensure that they're
[u/mdw/catacomb] / rspit.c
diff --git a/rspit.c b/rspit.c
index 4622d90..b9c8e72 100644 (file)
--- a/rspit.c
+++ b/rspit.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: rspit.c,v 1.10 2000/08/11 21:34:59 mdw Exp $
+ * $Id: rspit.c,v 1.13 2000/12/06 20:33:27 mdw Exp $
  *
  * Spit out random numbers
  *
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: rspit.c,v $
+ * Revision 1.13  2000/12/06 20:33:27  mdw
+ * Make flags be macros rather than enumerations, to ensure that they're
+ * unsigned.
+ *
+ * Revision 1.12  2000/10/08 15:49:18  mdw
+ * Remove failed kludge for shutting up a warning.
+ *
+ * Revision 1.11  2000/10/08 12:10:32  mdw
+ * Make table have external linkage to bodge around deficiency in C.  The
+ * problem is that @static gen generators[];@ is considered to be a
+ * `tentative definition', and therefore mustn't have incomplete type,
+ * which it obviously has.
+ *
  * Revision 1.10  2000/08/11 21:34:59  mdw
  * New restartable interface to Maurer testing.
  *
@@ -157,7 +170,7 @@ typedef struct gen {
   const char *help;
 } gen;
 
-static gen generators[];
+extern gen generators[];
 
 #define CIPHERS                                                                \
   E(DES, des)                                                          \
@@ -228,14 +241,12 @@ static char **argv;
 
 static unsigned flags = 0;
 
-enum {
-  f_progress = 1,
-  f_file = 2,
-  f_fips = 4,
-  f_maurer = 8,
-  f_timer = 16,
-  f_discard = 32
-};
+#define f_progress 1u
+#define f_file 2u
+#define f_fips 4u
+#define f_maurer 8u
+#define f_timer 16u
+#define f_discard 32u
 
 /*----- Help options ------------------------------------------------------*/
 
@@ -1069,7 +1080,7 @@ static grand *gen_opts(unsigned i)
 
 /*----- Generators table --------------------------------------------------*/
 
-static gen generators[] = {
+gen generators[] = {
   { "fibonacci",       gen_fib,        0,
     "[-s SEED]" },
   { "lc",              gen_lc,         0,
@@ -1083,12 +1094,12 @@ static gen generators[] = {
   { #pre "-counter",   gen_counter,    CIPHER_##PRE,                   \
     "[-k KEY-PHRASE] [-H HEX-KEY] [-i HEX-IV]" },
   CIPHERS
-#undef E(PRE, pre)
+#undef E
 #define E(PRE, pre)                                                    \
   { #pre "-mgf",       gen_mgf,        HASH_##PRE,                     \
     "[-k KEY-PHRASE] [-H HEX-KEY] [-i INDEX]" },
   HASHES
-#undef E(PRE, pre)
+#undef E
   { "rc4",             gen_rc4,        0,
     "[-k KEY-PHRASE] [-H HEX-KEY]" },
   { "seal",            gen_seal,       0,