Make flags be macros rather than enumerations, to ensure that they're
[u/mdw/catacomb] / pixie.c
diff --git a/pixie.c b/pixie.c
index 441b732..d4aefdf 100644 (file)
--- a/pixie.c
+++ b/pixie.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: pixie.c,v 1.5 2000/07/29 22:05:22 mdw Exp $
+ * $Id: pixie.c,v 1.7 2000/12/06 20:33:27 mdw Exp $
  *
  * Passphrase pixie for Catacomb
  *
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: pixie.c,v $
+ * Revision 1.7  2000/12/06 20:33:27  mdw
+ * Make flags be macros rather than enumerations, to ensure that they're
+ * unsigned.
+ *
+ * Revision 1.6  2000/10/08 12:06:46  mdw
+ * Change size passed to socket function to be a @size_t@.  Insert missing
+ * type name for flag declaration.
+ *
  * Revision 1.5  2000/07/29 22:05:22  mdw
  * Miscellaneous tidyings:
  *
@@ -124,10 +132,8 @@ static const char *command = 0;
 static lmem lm;
 static unsigned flags = 0;
 
-enum {
-  F_SYSLOG = 1,
-  F_FETCH = 2
-};
+#define F_SYSLOG 1u
+#define F_FETCH 2u
 
 /*----- Event logging -----------------------------------------------------*/
 
@@ -874,7 +880,7 @@ static void pixserv_accept(int fd, unsigned mode, void *p)
 {
   int nfd;
   struct sockaddr_un sun;
-  int sunsz = sizeof(sun);
+  size_t sunsz = sizeof(sun);
 
   if (mode != SEL_READ)
     return;
@@ -1061,7 +1067,7 @@ static void pix_setup(struct sockaddr_un *sun, size_t sz)
 /* --- Variables --- */
 
 static selbuf c_server, c_client;
-static c_flags = 0;
+static unsigned c_flags = 0;
 enum { cf_uclose = 1, cf_sclose = 2 };
 
 /* --- Line handler functions --- */
@@ -1224,13 +1230,11 @@ int main(int argc, char *argv[])
   size_t sz;
   unsigned f = 0;
 
-  enum {
-    f_bogus = 1,
-    f_client = 2,
-    f_stdin = 4,
-    f_daemon = 8,
-    f_syslog = 16
-  };
+#define f_bogus 1u
+#define f_client 2u
+#define f_stdin 4u
+#define f_daemon 8u
+#define f_syslog 16u
 
   /* --- Initialize libraries --- */