From aadecc23d25b6001026be3059eeaecb6a0140e2b Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 6 Oct 2022 20:46:01 -0700 Subject: [PATCH] sfio sfcvinit: use more appropriate types, squashing -Wconversion warnings --- lib/sfio/sftable.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/sfio/sftable.c b/lib/sfio/sftable.c index 85e446742..55fb874a7 100644 --- a/lib/sfio/sftable.c +++ b/lib/sfio/sftable.c @@ -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; } -- 2.50.1