]> granicus.if.org Git - graphviz/commitdiff
more standard usage of isdigit and friends
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 29 Aug 2021 23:21:59 +0000 (16:21 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 4 Sep 2021 02:26:35 +0000 (19:26 -0700)
cmd/lefty/dot2l/dotlex.c
cmd/tools/colxlate.c
lib/common/emit.c

index a3de2431ffa8086cb429db66fa7f2d79a8c122de..7e1ecfa72976147f47e51b34176657beb16a7ebf 100644 (file)
@@ -194,7 +194,7 @@ static void error_context (void) {
     if (lexptr == NULL)
         return;
     fprintf (stderr, "context: ");
-    for (p = lexptr - 1; (p > lexbuf) && (isspace (*p) == FALSE); p--)
+    for (p = lexptr - 1; (p > lexbuf) && !isspace(*p); p--)
         ;
     for (q = lexbuf; q < p; q++)
         fputc (*q, stderr);
index 597597fab6cf3d6e7da31f0b5fbc6de5382077ab..f1d9fbefdc9fc310eab46c585e4f33c0356c7b62 100644 (file)
 #include <search.h>
 #endif
 #include <ctype.h>
-#ifndef FALSE
-#define FALSE (0)
-#endif
-#ifndef TRUE
-#define TRUE (!FALSE)
-#endif
-#ifndef NOT
-#define NOT(x)                  (!(x))
-#endif
-#ifndef NIL
-#define NIL(type)               ((type)0)
-#endif
 typedef struct hsbcolor_t {
     char *name;
     unsigned char h, s, b;
@@ -41,7 +29,7 @@ static unsigned char *canoncolor(char *orig, unsigned char *out)
     unsigned char c;
     unsigned char *p = out;
     while ((c = *(unsigned char *) orig++)) {
-       if (isalnum(c) == FALSE)
+       if (!isalnum(c))
            continue;
        if (isupper(c))
            c = tolower(c);
@@ -71,7 +59,7 @@ char *colorxlate(char *str, char *buf)
                       sizeof(fake), colorcmpf);
     }
     if (last == NULL) {
-       if (isdigit(canon[0]) == FALSE) {
+       if (!isdigit(canon[0])) {
            fprintf(stderr, "warning: %s is not a known color\n", str);
            strcpy(buf, str);
        } else
index b19b5664edd8dfb45f94b79ac7f687472a2bf9d8..2ac343c7a12ed24b9bddbbc05c908ccc63aa6a0b 100644 (file)
@@ -1014,7 +1014,7 @@ static boolean is_natural_number(char *sstr)
     unsigned char *str = (unsigned char *) sstr;
 
     while (*str)
-       if (NOT(isdigit(*str++)))
+       if (!isdigit(*str++))
            return FALSE;
     return TRUE;
 }
@@ -1999,7 +1999,7 @@ static void emit_attachment(GVJ_t * job, textlabel_t * lp, splines * spl)
     unsigned char *s;
 
     for (s = (unsigned char *) (lp->text); *s; s++) {
-       if (isspace(*s) == FALSE)
+       if (!isspace(*s))
            break;
     }
     if (*s == 0)