diff --git a/tools/bufr_compare.cc b/tools/bufr_compare.cc index 11f0e9dc7..e0447e20b 100644 --- a/tools/bufr_compare.cc +++ b/tools/bufr_compare.cc @@ -1257,10 +1257,9 @@ static int compare_handles(grib_handle* handle1, grib_handle* handle2, grib_runt else { const void *msg1 = NULL, *msg2 = NULL; size_t size1 = 0, size2 = 0; - int memcmp_ret = 0; GRIB_CHECK_NOLINE(grib_get_message(handle1, &msg1, &size1), 0); GRIB_CHECK_NOLINE(grib_get_message(handle2, &msg2, &size2), 0); - if (size1 == size2 && !(memcmp_ret = memcmp(msg1, msg2, size1))) { + if (size1 == size2 && 0 == memcmp(msg1, msg2, size1)) { return 0; } #if defined(BUFR_COMPARE_BYTES) diff --git a/tools/grib_compare.cc b/tools/grib_compare.cc index f9f4d0977..558ff0386 100644 --- a/tools/grib_compare.cc +++ b/tools/grib_compare.cc @@ -1201,8 +1201,9 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option grib_handle *h11, *h22; GRIB_CHECK_NOLINE(grib_get_message_headers(h1, &msg1, &size1), 0); GRIB_CHECK_NOLINE(grib_get_message_headers(h2, &msg2, &size2), 0); - if (size1 == size2 && !memcmp(msg1, msg2, size1)) + if ( size1 == size2 && (0 == memcmp(msg1, msg2, size1)) ) { return 0; + } err = 0; h11 = grib_handle_new_from_partial_message(h1->context, msg1, size1); @@ -1268,8 +1269,9 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option size_t size1 = 0, size2 = 0; GRIB_CHECK_NOLINE(grib_get_message(h1, &msg1, &size1), 0); GRIB_CHECK_NOLINE(grib_get_message(h2, &msg2, &size2), 0); - if (size1 == size2 && !memcmp(msg1, msg2, size1)) + if ( size1 == size2 && (0 == memcmp(msg1, msg2, size1)) ) { return 0; + } iter = grib_keys_iterator_new(h1, GRIB_KEYS_ITERATOR_SKIP_COMPUTED, NULL); if (!iter) { diff --git a/tools/gts_compare.cc b/tools/gts_compare.cc index 2f570c61c..fbfee8b00 100644 --- a/tools/gts_compare.cc +++ b/tools/gts_compare.cc @@ -658,34 +658,13 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option else { const void *msg1 = NULL, *msg2 = NULL; size_t size1 = 0, size2 = 0; - int memcmp_ret = 0; /* int ii=0; */ GRIB_CHECK_NOLINE(grib_get_message(h1, &msg1, &size1), 0); GRIB_CHECK_NOLINE(grib_get_message(h2, &msg2, &size2), 0); - if (size1 == size2 && !(memcmp_ret = memcmp(msg1, msg2, size1))) { + if ( size1 == size2 && (0 == memcmp(msg1, msg2, size1)) ) { return 0; } -// else { -// int lcount=count,ii; -// if (options->current_infile) lcount=options->current_infile->filter_handle_count; -// if (size1 != size2) { -// printf("#%d different size: %d!=%d\n",lcount,(int)size1,(int)size2); -// } -// if (memcmp_ret) { -// unsigned char *m1=(unsigned char*)msg1; -// unsigned char *m2=(unsigned char*)msg2; -// printf("=== list of different bytes for message %d\n",lcount); -// for (ii=0;iicompare_count; i++) { if (blocklisted(name)) diff --git a/tools/metar_compare.cc b/tools/metar_compare.cc index 258a09024..53fa0a5be 100644 --- a/tools/metar_compare.cc +++ b/tools/metar_compare.cc @@ -821,10 +821,9 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option else { const void *msg1 = NULL, *msg2 = NULL; size_t size1 = 0, size2 = 0; - int memcmp_ret = 0; GRIB_CHECK_NOLINE(grib_get_message(h1, &msg1, &size1), 0); GRIB_CHECK_NOLINE(grib_get_message(h2, &msg2, &size2), 0); - if (size1 == size2 && !(memcmp_ret = memcmp(msg1, msg2, size1))) { + if ( size1 == size2 && (0 == memcmp(msg1, msg2, size1)) ) { return 0; }