]> diplodocus.org Git - nmh/blobdiff - sbr/fmt_compile.c
Match `NORETURN' function prototypes by adding it to definition.
[nmh] / sbr / fmt_compile.c
index c8618ed886ab289ed48753faf858d30b284d0ff1..b0ce64626b7a1a7fd721a05d4096ffe03b98ec3e 100644 (file)
@@ -1,6 +1,4 @@
-
-/*
- * fmt_compile.c -- "compile" format strings for fmt_scan
+/* fmt_compile.c -- "compile" format strings for fmt_scan
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -367,7 +365,7 @@ compile_error(char *str, char *cp)
     int i, errpos, errctx;
 
     errpos = cp - format_string;
     int i, errpos, errctx;
 
     errpos = cp - format_string;
-    errctx = errpos > 20 ? 20 : errpos;
+    errctx = min(errpos, 20);
     usr_fstring[errpos] = '\0';
 
     for (i = errpos-errctx; i < errpos; i++) {
     usr_fstring[errpos] = '\0';
 
     for (i = errpos-errctx; i < errpos; i++) {
@@ -375,7 +373,7 @@ compile_error(char *str, char *cp)
            usr_fstring[i] = '_';
     }
 
            usr_fstring[i] = '_';
     }
 
-    advise(NULL, "\"%s\": format compile error - %s",
+    inform("\"%s\": format compile error - %s",
           &usr_fstring[errpos-errctx], str);
     adios (NULL, "%*s", errctx+1, "^");
 }
           &usr_fstring[errpos-errctx], str);
     adios (NULL, "%*s", errctx+1, "^");
 }
@@ -578,7 +576,7 @@ do_name(char *sp, int preprocess)
            ismymbox ((struct mailname *) 0);
            primed++;
        }
            ismymbox ((struct mailname *) 0);
            primed++;
        }
-       /* fall through */
+       /* FALLTHRU */
     case FT_PARSEADDR:
        if (cm->c_type & CT_DATE) {
            CERROR("component used as both date and address");
     case FT_PARSEADDR:
        if (cm->c_type & CT_DATE) {
            CERROR("component used as both date and address");
@@ -740,7 +738,7 @@ do_func(char *sp)
 
     case TF_EXPR_SV:
        LV(FT_SAVESTR, 0);
 
     case TF_EXPR_SV:
        LV(FT_SAVESTR, 0);
-       /* fall through */
+       /* FALLTHRU */
     case TF_EXPR:
        *--cp = c;
        cp = do_expr(cp, t->extra);
     case TF_EXPR:
        *--cp = c;
        cp = do_expr(cp, t->extra);
@@ -799,7 +797,7 @@ do_expr (char *sp, int preprocess)
  *
  * Okay, got some more information on this from John L. Romine!  From an
  * email he sent to the nmh-workers mailing list on December 2, 2010, he
  *
  * Okay, got some more information on this from John L. Romine!  From an
  * email he sent to the nmh-workers mailing list on December 2, 2010, he
- * explains it thusly:
+ * explains it so:
  *
  *    In this case (scan, formatsbr) it has to do with an extension to
  *    the mh-format syntax to allow for looping.
  *
  *    In this case (scan, formatsbr) it has to do with an extension to
  *    the mh-format syntax to allow for looping.
@@ -1000,7 +998,7 @@ fmt_findcasecomp(char *component)
     struct comp *cm;
 
     for (cm = wantcomp[CHASH(component)]; cm; cm = cm->c_next)
     struct comp *cm;
 
     for (cm = wantcomp[CHASH(component)]; cm; cm = cm->c_next)
-       if (strcasecmp(component, cm->c_name ? cm->c_name : "") == 0)
+       if (strcasecmp(component, FENDNULL(cm->c_name)) == 0)
            break;
 
     return cm;
            break;
 
     return cm;
@@ -1052,7 +1050,7 @@ fmt_addcomptext(char *component, char *text)
     char *cp;
 
     while (cptr) {
     char *cp;
 
     while (cptr) {
-       if (strcasecmp(component, cptr->c_name ? cptr->c_name : "") == 0) {
+       if (strcasecmp(component, FENDNULL(cptr->c_name)) == 0) {
            found++;
            if (! cptr->c_text) {
                cptr->c_text = getcpy(text);
            found++;
            if (! cptr->c_text) {
                cptr->c_text = getcpy(text);
@@ -1087,7 +1085,7 @@ fmt_appendcomp(int bucket, char *component, char *text)
 
     if (bucket != -1) {
        for (cptr = wantcomp[bucket]; cptr; cptr = cptr->c_next)
 
     if (bucket != -1) {
        for (cptr = wantcomp[bucket]; cptr; cptr = cptr->c_next)
-           if (strcasecmp(component, cptr->c_name ? cptr->c_name : "") == 0)
+           if (strcasecmp(component, FENDNULL(cptr->c_name)) == 0)
                cptr->c_text = add(text, cptr->c_text);
     }
 }
                cptr->c_text = add(text, cptr->c_text);
     }
 }