]> diplodocus.org Git - nmh/blobdiff - uip/ap.c
Ignore the sign mismatch warning when sbr/dtimep.c is built with
[nmh] / uip / ap.c
index 80ce8a3fa43ac7087c2d18971979e48fc8fa13bb..c42d732c858c49ac659b3acf30d8e92eef19c56e 100644 (file)
--- a/uip/ap.c
+++ b/uip/ap.c
 
 #define        FORMAT  "%<{error}%{error}: %{text}%|%(putstr(proper{text}))%>"
 
-static struct swit switches[] = {
-#define        FORMSW  0
-    { "form formatfile", 0 },
-#define        FMTSW   1
-    { "format string", 5 },
-#define        NORMSW  2
-    { "normalize", 0 },
-#define        NNORMSW 3
-    { "nonormalize", 0 },
-#define        WIDTHSW 4
-    { "width columns", 0 },
-#define VERSIONSW 5
-    { "version", 0 },
-#define        HELPSW  6
-    { "help", 0 },
-    { NULL, 0 }
-};
+#define AP_SWITCHES \
+    X("form formatfile", 0, FORMSW) \
+    X("format string", 5, FMTSW) \
+    X("normalize", 0, NORMSW) \
+    X("nonormalize", 0, NNORMSW) \
+    X("width columns", 0, WIDTHSW) \
+    X("version", 0, VERSIONSW) \
+    X("help", 0, HELPSW) \
+
+#define X(sw, minchars, id) id,
+DEFINE_SWITCH_ENUM(AP);
+#undef X
+
+#define X(sw, minchars, id) { sw, minchars, id },
+DEFINE_SWITCH_ARRAY(AP, switches);
+#undef X
 
 static struct format *fmt;
 
@@ -199,7 +198,7 @@ process (char *arg, int length, int norm)
            p->pq_error = NULL;
        }
 
-       fmt_scan (fmt, buffer, sizeof buffer - 1, length, dat);
+       fmt_scan (fmt, buffer, sizeof buffer - 1, length, dat, NULL);
        fputs (buffer, stdout);
 
        if (p->pq_text)