From 0c2060e58572be8044459ede88891059b8242f92 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 4 Mar 2023 18:51:14 +0000 Subject: [PATCH] Compiler warnings: comparison of integers of different signs [-Wsign-compare] --- tools/gts_compare.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/gts_compare.cc b/tools/gts_compare.cc index 9bb380fc3..e0237af03 100644 --- a/tools/gts_compare.cc +++ b/tools/gts_compare.cc @@ -665,7 +665,7 @@ static int compare_values(grib_runtime_options* options, grib_handle* h1, grib_h save_error(c, name); } if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1 == len2) { - int i; + size_t i; countdiff = 0; for (i = 0; i < len1; i++) if (lval1[i] != lval2[i]) @@ -726,7 +726,7 @@ static int compare_values(grib_runtime_options* options, grib_handle* h1, grib_h if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS) { if (memcmp(uval1, uval2, len1) != 0) { - int i; + size_t i; for (i = 0; i < len1; i++) if (uval1[i] != uval2[i]) { printInfo(h1); @@ -735,7 +735,7 @@ static int compare_values(grib_runtime_options* options, grib_handle* h1, grib_h printf("[%s] byte values are different: [%02x] and [%02x]\n", name, uval1[i], uval2[i]); else - printf("[%s] byte value %d of %ld are different: [%02x] and [%02x]\n", + printf("[%s] byte value %zu of %ld are different: [%02x] and [%02x]\n", name, i, (long)len1, uval1[i], uval2[i]); err1 = GRIB_VALUE_MISMATCH;