]> granicus.if.org Git - graphviz/commitdiff
get_int_msb_first: use a more appropriate type to squash -Wsign-compare warning
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 11 Nov 2021 01:27:25 +0000 (17:27 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 17 Nov 2021 01:01:22 +0000 (17:01 -0800)
lib/gvc/gvusershape.c

index 0a78c13411352c48170d32d92bc976853f707239..b8f5dbde2563c9e619153756f75a69f1586c85b8 100644 (file)
@@ -127,12 +127,11 @@ static boolean get_int_lsb_first(FILE *f, size_t sz, unsigned int *val) {
     return TRUE;
 }
        
-static boolean get_int_msb_first (FILE *f, unsigned int sz, unsigned int *val)
-{
-    int ch, i;
+static boolean get_int_msb_first(FILE *f, size_t sz, unsigned int *val) {
+    int ch;
 
     *val = 0;
-    for (i = 0; i < sz; i++) {
+    for (size_t i = 0; i < sz; i++) {
        ch = fgetc(f);
        if (feof(f))
            return FALSE;