]> granicus.if.org Git - graphviz/commitdiff
sfio sfcvinit: use more appropriate types, squashing -Wconversion warnings
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 7 Oct 2022 03:46:01 +0000 (20:46 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 11 Oct 2022 03:33:01 +0000 (20:33 -0700)
lib/sfio/sftable.c

index 85e4467423940405b941464c9ce82670d9dcba4f..55fb874a73a1796d12db79ea67aeb8e9fccec331 100644 (file)
@@ -383,14 +383,13 @@ static Fmtpos_t *sffmtpos(Sfio_t * f, const char *form, va_list args,
 /* function to initialize conversion tables */
 static int sfcvinit(void)
 {
-    int d, l;
-
-    for (d = 0; d <= UCHAR_MAX; ++d) {
+    for (int d = 0; d <= UCHAR_MAX; ++d) {
        _Sfcv36[d] = SF_RADIX;
        _Sfcv64[d] = SF_RADIX;
     }
 
     /* [0-9] */
+    unsigned char d;
     for (d = 0; d < 10; ++d) {
        _Sfcv36[(uchar) _Sfdigits[d]] = d;
        _Sfcv64[(uchar) _Sfdigits[d]] = d;
@@ -403,7 +402,7 @@ static int sfcvinit(void)
     }
 
     /* [A-Z] */
-    for (l = 10; d < 62; ++l, ++d) {
+    for (unsigned char l = 10; d < 62; ++l, ++d) {
        _Sfcv36[(uchar) _Sfdigits[d]] = l;
        _Sfcv64[(uchar) _Sfdigits[d]] = d;
     }