]> granicus.if.org Git - graphviz/commitdiff
ast chrtoi: squash -Wsign-compare warning
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 24 Jul 2022 16:50:50 +0000 (09:50 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 30 Jul 2022 00:02:13 +0000 (17:02 -0700)
lib/ast/chrtoi.c

index 26c2bf278a288a2d1af323793a0e2d02b1da5568..88a613db64499b9b730e18614543a4cd300a764e 100644 (file)
 
 #include <ast/ast.h>
 #include <limits.h>
+#include <stddef.h>
 
 int chrtoi(const char *s)
 {
     int c;
-    int n;
     int x;
     char *p;
 
     c = 0;
-    for (n = 0; n < sizeof(int) * CHAR_BIT; n += CHAR_BIT) {
+    for (size_t n = 0; n < sizeof(int) * CHAR_BIT; n += CHAR_BIT) {
        switch (x = *((const unsigned char *) s++)) {
        case '\\':
            x = chresc(s - 1, &p);