]> granicus.if.org Git - graphviz/commitdiff
common: squash -Wsign-conversion, -Wconversion warnings
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 21 May 2022 03:35:31 +0000 (20:35 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 23 May 2022 05:00:30 +0000 (22:00 -0700)
`byte` is known in-range in these instances.

lib/common/utils.c

index de3a604dcb446809b37e262ef7399c8da5afa1b0..3a2fb141372af197905704ea56681c040087afde 100644 (file)
@@ -1362,14 +1362,14 @@ htmlEntity (char** s)
                     byte = byte - '0';
                else
                     break;
-               n = (n * 16) + byte;
+               n = (n * 16) + (int)byte;
            }
        }
        else {
            for (i = 1; i < 8; i++) {
                byte = *(str + i);
                if (byte >= '0' && byte <= '9')
-                   n = (n * 10) + (byte - '0');
+                   n = (n * 10) + ((int)byte - '0');
                else
                    break;
            }
@@ -1396,7 +1396,7 @@ htmlEntity (char** s)
                }
                break;
            }
-           *p++ = byte;
+           *p++ = (char)byte;
        }
     }
     *s = (char*)str;