/* -*-c-*-
*
- * $Id: crc-mktab.c,v 1.2 2000/10/08 11:07:21 mdw Exp $
+ * $Id: crc-mktab.c,v 1.3 2001/01/20 12:06:01 mdw Exp $
*
* Build CRC tables
*
/*----- Revision history --------------------------------------------------*
*
* $Log: crc-mktab.c,v $
+ * Revision 1.3 2001/01/20 12:06:01 mdw
+ * Define flags with macros, to ensure unsignedness.
+ *
* Revision 1.2 2000/10/08 11:07:21 mdw
* With no arguments, give an error rather than spewing a big table at the
* user.
static const char *inc = 0;
static FILE *fp;
-enum {
- f_bogus = 1,
- f_ctab = 2,
- f_reverse = 4
-};
+#define f_bogus 1u
+#define f_ctab 2u
+#define f_reverse 4u
#define BSCOL 72
/* -*-c-*-
*
- * $Id: dputf.c,v 1.2 2000/08/15 21:26:45 mdw Exp $
+ * $Id: dputf.c,v 1.3 2001/01/20 12:06:01 mdw Exp $
*
* `printf'-style formatting for dynamic strings
*
/*----- Revision history --------------------------------------------------*
*
* $Log: dputf.c,v $
+ * Revision 1.3 2001/01/20 12:06:01 mdw
+ * Define flags with macros, to ensure unsignedness.
+ *
* Revision 1.2 2000/08/15 21:26:45 mdw
* (dstr_vputf): Don't try calling @va_arg@ on things @char@-sized.
*
unsigned f;
int wd, prec;
- enum {
- f_short = 1,
- f_long = 2,
- f_Long = 4,
- f_wd = 8,
- f_prec = 16
- };
+#define f_short 1u
+#define f_long 2u
+#define f_Long 4u
+#define f_wd 8u
+#define f_prec 16u
/* --- Most stuff gets passed on through --- */
if (mx > sz)
sz = mx;
}
- if ((f & f_prec) == 0)
+ if (!(f & f_prec))
prec = 6;
- if ((f & f_prec))
+ else
sz += prec + 16;
if ((f & f_wd) && wd + 1 > sz)
sz = wd + 1;
formatted:
DRESET(&dd);
q = ++p;
+
+#undef f_short
+#undef f_long
+#undef f_Long
+#undef f_wd
+#undef f_prec
}
DPUTM(d, q, p - q);
/* -*-c-*-
*
- * $Id: lbuf.h,v 1.4 2000/06/17 10:38:14 mdw Exp $
+ * $Id: lbuf.h,v 1.5 2001/01/20 12:06:01 mdw Exp $
*
* Block-to-line buffering
*
/*----- Revision history --------------------------------------------------*
*
* $Log: lbuf.h,v $
+ * Revision 1.5 2001/01/20 12:06:01 mdw
+ * Define flags with macros, to ensure unsignedness.
+ *
* Revision 1.4 2000/06/17 10:38:14 mdw
* Add support for variable buffer sizes.
*
char *buf; /* The actual buffer */
} lbuf;
-enum {
- LBUF_CR = 1, /* Read a carriage return */
- LBUF_ENABLE = 2 /* Buffer is currently enabled */
-};
+#define LBUF_CR 1u /* Read a carriage return */
+#define LBUF_ENABLE 2u /* Buffer is currently enabled */
/*----- Functions provided ------------------------------------------------*/
/* -*-c-*-
*
- * $Id: pkbuf.h,v 1.1 2000/06/17 10:39:19 mdw Exp $
+ * $Id: pkbuf.h,v 1.2 2001/01/20 12:06:01 mdw Exp $
*
* Simple packet buffering
*
/*----- Revision history --------------------------------------------------*
*
* $Log: pkbuf.h,v $
+ * Revision 1.2 2001/01/20 12:06:01 mdw
+ * Define flags with macros, to ensure unsignedness.
+ *
* Revision 1.1 2000/06/17 10:39:19 mdw
* Experimental new support for packet buffering.
*
octet *buf; /* Actual buffer space */
} pkbuf;
-enum {
- PKBUF_ENABLE = 1 /* Buffer is currently enabled */
-};
+#define PKBUF_ENABLE 1u /* Buffer is currently enabled */
/*----- Functions provided ------------------------------------------------*/
/* -*-c-*-
*
- * $Id: url.h,v 1.2 1999/12/10 23:42:04 mdw Exp $
+ * $Id: url.h,v 1.3 2001/01/20 12:06:01 mdw Exp $
*
* Parsing and construction of url-encoded name/value pairs
*
/*----- Revision history --------------------------------------------------*
*
* $Log: url.h,v $
+ * Revision 1.3 2001/01/20 12:06:01 mdw
+ * Define flags with macros, to ensure unsignedness.
+ *
* Revision 1.2 1999/12/10 23:42:04 mdw
* Change header file guard names.
*
unsigned f;
} url_ectx;
-enum {
- URLF_SEP = 1
-};
+#define URLF_SEP 1u
typedef struct url_dctx {
const char *p;