Compiler warnings: NVHPC 24.1.0

This commit is contained in:
shahramn 2024-03-17 14:31:55 +00:00
parent 168fccf13e
commit e624ecff0b
4 changed files with 7 additions and 28 deletions

View File

@ -1257,10 +1257,9 @@ static int compare_handles(grib_handle* handle1, grib_handle* handle2, grib_runt
else { else {
const void *msg1 = NULL, *msg2 = NULL; const void *msg1 = NULL, *msg2 = NULL;
size_t size1 = 0, size2 = 0; 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(handle1, &msg1, &size1), 0);
GRIB_CHECK_NOLINE(grib_get_message(handle2, &msg2, &size2), 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; return 0;
} }
#if defined(BUFR_COMPARE_BYTES) #if defined(BUFR_COMPARE_BYTES)

View File

@ -1201,8 +1201,9 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option
grib_handle *h11, *h22; grib_handle *h11, *h22;
GRIB_CHECK_NOLINE(grib_get_message_headers(h1, &msg1, &size1), 0); GRIB_CHECK_NOLINE(grib_get_message_headers(h1, &msg1, &size1), 0);
GRIB_CHECK_NOLINE(grib_get_message_headers(h2, &msg2, &size2), 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; return 0;
}
err = 0; err = 0;
h11 = grib_handle_new_from_partial_message(h1->context, msg1, size1); 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; size_t size1 = 0, size2 = 0;
GRIB_CHECK_NOLINE(grib_get_message(h1, &msg1, &size1), 0); GRIB_CHECK_NOLINE(grib_get_message(h1, &msg1, &size1), 0);
GRIB_CHECK_NOLINE(grib_get_message(h2, &msg2, &size2), 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; return 0;
}
iter = grib_keys_iterator_new(h1, GRIB_KEYS_ITERATOR_SKIP_COMPUTED, NULL); iter = grib_keys_iterator_new(h1, GRIB_KEYS_ITERATOR_SKIP_COMPUTED, NULL);
if (!iter) { if (!iter) {

View File

@ -658,34 +658,13 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option
else { else {
const void *msg1 = NULL, *msg2 = NULL; const void *msg1 = NULL, *msg2 = NULL;
size_t size1 = 0, size2 = 0; size_t size1 = 0, size2 = 0;
int memcmp_ret = 0;
/* int ii=0; */ /* int ii=0; */
GRIB_CHECK_NOLINE(grib_get_message(h1, &msg1, &size1), 0); GRIB_CHECK_NOLINE(grib_get_message(h1, &msg1, &size1), 0);
GRIB_CHECK_NOLINE(grib_get_message(h2, &msg2, &size2), 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; 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;ii<size1;ii++) {
// if (memcmp(m1,m2,1)) {
// printf(" %d 0x%.2X != 0x%.2X\n",ii,*m1,*m2);
// }
// m1++; m2++;
// }
// }
// return err;
// }
if (listFromCommandLine) { if (listFromCommandLine) {
for (i = 0; i < options->compare_count; i++) { for (i = 0; i < options->compare_count; i++) {
if (blocklisted(name)) if (blocklisted(name))

View File

@ -821,10 +821,9 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option
else { else {
const void *msg1 = NULL, *msg2 = NULL; const void *msg1 = NULL, *msg2 = NULL;
size_t size1 = 0, size2 = 0; 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(h1, &msg1, &size1), 0);
GRIB_CHECK_NOLINE(grib_get_message(h2, &msg2, &size2), 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; return 0;
} }