diff --git a/src/action_class_list.c b/src/action_class_list.c index a27464537..cff1af4c7 100644 --- a/src/action_class_list.c +++ b/src/action_class_list.c @@ -109,11 +109,11 @@ static int create_accessor(grib_section* p, grib_action* act, grib_loader* h) long val = 0; if ((ret = grib_expression_evaluate_long(p->h, a->expression, &val)) != GRIB_SUCCESS) { - grib_context_log(p->h->context, GRIB_LOG_DEBUG, " List %s creating %d values unable to evaluate long \n", act->name, val); + grib_context_log(p->h->context, GRIB_LOG_DEBUG, "List %s creating %d values unable to evaluate long", act->name, val); return ret; } - grib_context_log(p->h->context, GRIB_LOG_DEBUG, " List %s creating %d values \n", act->name, val); + grib_context_log(p->h->context, GRIB_LOG_DEBUG, "List %s creating %d values", act->name, val); ga = grib_accessor_factory(p, act, 0, NULL); if (!ga) @@ -167,7 +167,8 @@ static grib_action* reparse(grib_action* a, grib_accessor* acc, int* doit) long val = 0; if ((ret = grib_expression_evaluate_long(grib_handle_of_accessor(acc), self->expression, &val)) != GRIB_SUCCESS) { - grib_context_log(acc->context, GRIB_LOG_ERROR, " List %s creating %d values unable to evaluate long \n", acc->name, val); + grib_context_log(acc->context, GRIB_LOG_ERROR, + "List %s creating %ld values, unable to evaluate long", acc->name, val); } *doit = (val != acc->loop); diff --git a/src/grib_accessor_class.c b/src/grib_accessor_class.c index d00fb0d95..f5911b960 100644 --- a/src/grib_accessor_class.c +++ b/src/grib_accessor_class.c @@ -185,7 +185,7 @@ grib_accessor* grib_accessor_factory(grib_section* p, grib_action* creator, if (!p->h->buffer->growable) { if (!p->h->partial) grib_context_log(p->h->context, GRIB_LOG_ERROR, - "Creating (%s)%s of %s at offset %d-%d over message boundary (%d)", + "Creating (%s)%s of %s at offset %ld-%ld over message boundary (%lu)", p->owner ? p->owner->name : "", a->name, creator->op, a->offset, a->offset + a->length, diff --git a/src/grib_accessor_class_apply_operators.c b/src/grib_accessor_class_apply_operators.c index 9e602a13f..d79b0ea70 100644 --- a/src/grib_accessor_class_apply_operators.c +++ b/src/grib_accessor_class_apply_operators.c @@ -660,7 +660,7 @@ static int unpack_string_array(grib_accessor* a, char** val, size_t* len) if (*len < self->expandedAOSize) { grib_context_log(a->context, GRIB_LOG_ERROR, - " wrong size (%ld) for %s it contains %d values ", *len, a->name, self->expandedAOSize); + "Wrong size (%lu) for %s, it contains %lu values", *len, a->name, self->expandedAOSize); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -726,7 +726,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) if (*len < self->expandedAOSize) { grib_context_log(a->context, GRIB_LOG_ERROR, - " wrong size (%ld) for %s it contains %d values ", *len, a->name, self->expandedAOSize); + "Wrong size (%lu) for %s it contains %lu values", *len, a->name, self->expandedAOSize); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -784,7 +784,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) if (*len < self->expandedAOSize) { grib_context_log(a->context, GRIB_LOG_ERROR, - " wrong size (%ld) for %s it contains %d values ", *len, a->name, self->expandedAOSize); + "Wrong size (%lu) for %s it contains %lu values", *len, a->name, self->expandedAOSize); *len = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_ascii.c b/src/grib_accessor_class_ascii.c index 7680cff74..471e8bc08 100644 --- a/src/grib_accessor_class_ascii.c +++ b/src/grib_accessor_class_ascii.c @@ -169,7 +169,8 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) grib_handle* hand = grib_handle_of_accessor(a); if (len[0] < (a->length + 1)) { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%lu) for %s it contains %ld values", + len[0], a->name, a->length + 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -186,7 +187,8 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) int i = 0; grib_handle* hand = grib_handle_of_accessor(a); if (len[0] > (a->length) + 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "pack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); + grib_context_log(a->context, GRIB_LOG_ERROR, + "pack_string: Wrong size (%lu) for %s it contains %ld values", len[0], a->name, a->length + 1); len[0] = 0; return GRIB_BUFFER_TOO_SMALL; } diff --git a/src/grib_accessor_class_bitmap.c b/src/grib_accessor_class_bitmap.c index e51cbdf11..120770e76 100644 --- a/src/grib_accessor_class_bitmap.c +++ b/src/grib_accessor_class_bitmap.c @@ -224,7 +224,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return err; if (*len < tlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, tlen); + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %ld values", a->name, tlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -249,7 +249,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return err; if (*len < tlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, tlen); + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %ld values", a->name, tlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -282,7 +282,8 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) grib_handle* hand = grib_handle_of_accessor(a); if (len[0] < (a->length)) { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length); + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%lu) for %s it contains %ld values", + len[0], a->name, a->length); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_codetable.c b/src/grib_accessor_class_codetable.c index 77466221e..d5319aa65 100644 --- a/src/grib_accessor_class_codetable.c +++ b/src/grib_accessor_class_codetable.c @@ -804,7 +804,8 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) } if (*len < rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size (%ld) for %s it contains %d values ", *len, a->name, rlen); + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%lu) for %s, it contains %ld values", + *len, a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_concept.c b/src/grib_accessor_class_concept.c index c96b09f15..1c0900244 100644 --- a/src/grib_accessor_class_concept.c +++ b/src/grib_accessor_class_concept.c @@ -640,7 +640,7 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) slen = strlen(p) + 1; if (*len < slen) { grib_context_log(a->context, GRIB_LOG_ERROR, - "Concept unpack_string. Wrong size for %s, value='%s' which requires %d bytes (len=%d)", + "Concept unpack_string. Wrong size for %s, value='%s' which requires %lu bytes (len=%lu)", a->name, p, slen, *len); *len = slen; return GRIB_BUFFER_TOO_SMALL; diff --git a/src/grib_accessor_class_data_complex_packing.c b/src/grib_accessor_class_data_complex_packing.c index d392d4e18..b7390caca 100644 --- a/src/grib_accessor_class_data_complex_packing.c +++ b/src/grib_accessor_class_data_complex_packing.c @@ -668,7 +668,8 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) n_vals = (pen_j + 1) * (pen_j + 2); if (*len != n_vals) { - grib_context_log(a->context, GRIB_LOG_ERROR, "COMPLEX_PACKING : wrong number of values, expected %d - got %d", n_vals, *len); + grib_context_log(a->context, GRIB_LOG_ERROR, "COMPLEX_PACKING: wrong number of values, expected %ld - got %lu", + n_vals, *len); return GRIB_INTERNAL_ERROR; } diff --git a/src/grib_accessor_class_data_g2bifourier_packing.c b/src/grib_accessor_class_data_g2bifourier_packing.c index 831b8c7ac..fa765fe48 100644 --- a/src/grib_accessor_class_data_g2bifourier_packing.c +++ b/src/grib_accessor_class_data_g2bifourier_packing.c @@ -784,7 +784,8 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) self->dirty = 1; if (*len != bt->n_vals_bif) { - grib_context_log(gh->context, GRIB_LOG_ERROR, "BIFOURIER_PACKING : wrong number of values, expected %d - got %d", bt->n_vals_bif, *len); + grib_context_log(gh->context, GRIB_LOG_ERROR, "BIFOURIER_PACKING: wrong number of values, expected %lu - got %lu", + bt->n_vals_bif, *len); ret = GRIB_INTERNAL_ERROR; goto cleanup; } diff --git a/src/grib_accessor_class_data_jpeg2000_packing.c b/src/grib_accessor_class_data_jpeg2000_packing.c index 8f40e396f..491fb508b 100644 --- a/src/grib_accessor_class_data_jpeg2000_packing.c +++ b/src/grib_accessor_class_data_jpeg2000_packing.c @@ -473,7 +473,7 @@ static int pack_double(grib_accessor* a, const double* cval, size_t* len) if (width * height != *len) { grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_accessor_class_data_jpeg2000_packing pack_double: width=%ld height=%ld len=%d." + "grib_accessor_class_data_jpeg2000_packing pack_double: width=%ld height=%ld len=%ld." " width*height should equal len!", (long)width, (long)height, (long)*len); return GRIB_INTERNAL_ERROR; diff --git a/src/grib_accessor_class_data_simple_packing.c b/src/grib_accessor_class_data_simple_packing.c index 3a067de28..68e317b91 100644 --- a/src/grib_accessor_class_data_simple_packing.c +++ b/src/grib_accessor_class_data_simple_packing.c @@ -680,7 +680,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) err = number_of_bits((unsigned long)ceil(fabs(max - min)), &bits_per_value); if (err) { grib_context_log(a->context, GRIB_LOG_ERROR, - "Range of values too large. Try a smaller value for decimal precision (less than %d)", + "Range of values too large. Try a smaller value for decimal precision (less than %ld)", decimal_scale_factor); return err; } diff --git a/src/grib_accessor_class_expanded_descriptors.c b/src/grib_accessor_class_expanded_descriptors.c index a64302d73..c1eebe31c 100644 --- a/src/grib_accessor_class_expanded_descriptors.c +++ b/src/grib_accessor_class_expanded_descriptors.c @@ -762,7 +762,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) expandedSize = BUFR_DESCRIPTORS_ARRAY_USED_SIZE(self->expanded); if (*len < expandedSize) { grib_context_log(a->context, GRIB_LOG_ERROR, - " wrong size (%ld) for %s it contains %d values ", *len, a->name, expandedSize); + "Wrong size (%ld) for %s, it contains %lu values", *len, a->name, expandedSize); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -789,7 +789,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) if (*len < rlen) { grib_context_log(a->context, GRIB_LOG_ERROR, - " wrong size (%ld) for %s it contains %d values ", *len, a->name, rlen); + "Wrong size (%ld) for %s, it contains %lu values", *len, a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_g1area.c b/src/grib_accessor_class_g1area.c index b56c00eb0..d81d0293b 100644 --- a/src/grib_accessor_class_g1area.c +++ b/src/grib_accessor_class_g1area.c @@ -233,7 +233,7 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) if (ret) return ret; if (*len < 60) { - grib_context_log(a->context, GRIB_LOG_ERROR, " Buffer too small for %s (%d) ", a->name, *len); + grib_context_log(a->context, GRIB_LOG_ERROR, "Buffer too small for %s (%lu)", a->name, *len); len = 0; return GRIB_BUFFER_TOO_SMALL; } diff --git a/src/grib_accessor_class_g1bitmap.c b/src/grib_accessor_class_g1bitmap.c index b5cfa37f5..750732d9c 100644 --- a/src/grib_accessor_class_g1bitmap.c +++ b/src/grib_accessor_class_g1bitmap.c @@ -209,7 +209,7 @@ static int unpack_bytes(grib_accessor* a, unsigned char* val, size_t* len) long offset = grib_byte_offset(a); if (*len < (size_t)length) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it is %d bytes long\n", a->name, length); + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it is %ld bytes long\n", a->name, length); *len = length; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_gen.c b/src/grib_accessor_class_gen.c index 565c4612a..ef1393210 100644 --- a/src/grib_accessor_class_gen.c +++ b/src/grib_accessor_class_gen.c @@ -244,7 +244,7 @@ static int unpack_bytes(grib_accessor* a, unsigned char* val, size_t* len) long offset = grib_byte_offset(a); if (*len < length) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it is %d bytes long\n", a->name, length); + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s, it is %ld bytes long", a->name, length); *len = length; return GRIB_ARRAY_TOO_SMALL; } @@ -606,7 +606,7 @@ static int is_missing(grib_accessor* a) if (a->flags & GRIB_ACCESSOR_FLAG_TRANSIENT) { if (a->vvalue == NULL) { - grib_context_log(a->context, GRIB_LOG_ERROR, "%s internal error (flags=0x%X)", a->name, a->flags); + grib_context_log(a->context, GRIB_LOG_ERROR, "%s internal error (flags=0x%lX)", a->name, a->flags); Assert(!"grib_accessor_class_gen::is_missing(): a->vvalue == NULL"); return 0; } diff --git a/src/grib_accessor_class_group.c b/src/grib_accessor_class_group.c index 7d99ed408..1188be30c 100644 --- a/src/grib_accessor_class_group.c +++ b/src/grib_accessor_class_group.c @@ -207,7 +207,8 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) int i = 0; if (len[0] < (a->length + 1)) { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%lu) for %s it contains %ld values", + len[0], a->name, a->length + 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_ibmfloat.c b/src/grib_accessor_class_ibmfloat.c index 671957e71..22ae3216b 100644 --- a/src/grib_accessor_class_ibmfloat.c +++ b/src/grib_accessor_class_ibmfloat.c @@ -167,7 +167,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) rlen = count; if (*len < rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size (%ld) for %s it contains %d values ", *len, a->name, rlen); + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%lu) for %s, it contains %lu values", *len, a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -190,7 +190,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) long off = 0; if (*len < 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size for %s it pack at least 1 values ", a->name, rlen); + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s, it packs at least 1 value", a->name); *len = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_ieeefloat.c b/src/grib_accessor_class_ieeefloat.c index 81074724c..bfb2f4142 100644 --- a/src/grib_accessor_class_ieeefloat.c +++ b/src/grib_accessor_class_ieeefloat.c @@ -168,7 +168,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) long off = 0; if (*len < 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size for %s it pack at least 1 values ", a->name, rlen); + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s, it packs at least 1 value", a->name); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -214,7 +214,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return err; if (*len < rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size (%ld) for %s it contains %d values ", *len, a->name, rlen); + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%lu) for %s, it contains %ld values", *len, a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_ksec1expver.c b/src/grib_accessor_class_ksec1expver.c index 65940e5de..00c96f3aa 100644 --- a/src/grib_accessor_class_ksec1expver.c +++ b/src/grib_accessor_class_ksec1expver.c @@ -194,7 +194,8 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) return GRIB_INVALID_KEY_VALUE; } if (len[0] > (a->length) + 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "pack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); + grib_context_log(a->context, GRIB_LOG_ERROR, "pack_string: Wrong size (%lu) for %s, it contains %ld values", + len[0], a->name, a->length + 1); len[0] = 0; return GRIB_BUFFER_TOO_SMALL; } diff --git a/src/grib_accessor_class_long.c b/src/grib_accessor_class_long.c index adc3659fb..8c12b4a18 100644 --- a/src/grib_accessor_class_long.c +++ b/src/grib_accessor_class_long.c @@ -217,7 +217,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) rlen = count; if (*len < rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size for %s it contains %d values ", a->name, rlen); + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s, it contains %lu values", a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_message.c b/src/grib_accessor_class_message.c index 84f313770..afa1b0f19 100644 --- a/src/grib_accessor_class_message.c +++ b/src/grib_accessor_class_message.c @@ -176,7 +176,8 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) int i = 0; if (len[0] < (a->length + 1)) { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%lu) for %s, it contains %ld values", + len[0], a->name, a->length + 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_non_alpha.c b/src/grib_accessor_class_non_alpha.c index 9fbf0141b..e330a86cc 100644 --- a/src/grib_accessor_class_non_alpha.c +++ b/src/grib_accessor_class_non_alpha.c @@ -181,7 +181,8 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) int i = 0; if (len[0] < (a->length + 1)) { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%lu) for %s it contains %ld values", + len[0], a->name, a->length + 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_sexagesimal2decimal.c b/src/grib_accessor_class_sexagesimal2decimal.c index 70faea5d9..6b89427b1 100644 --- a/src/grib_accessor_class_sexagesimal2decimal.c +++ b/src/grib_accessor_class_sexagesimal2decimal.c @@ -258,7 +258,8 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) length = strlen(buff); if (len[0] < length + 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%lu) for %s, it contains %ld values", + len[0], a->name, a->length + 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_signed.c b/src/grib_accessor_class_signed.c index cdac1fa22..a2df830cd 100644 --- a/src/grib_accessor_class_signed.c +++ b/src/grib_accessor_class_signed.c @@ -186,7 +186,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) rlen = count; if (*len < rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size for %s it contains %d values ", a->name, rlen); + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s, it contains %lu values", a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_signed_bits.c b/src/grib_accessor_class_signed_bits.c index 194850277..da54c9bbd 100644 --- a/src/grib_accessor_class_signed_bits.c +++ b/src/grib_accessor_class_signed_bits.c @@ -197,7 +197,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) if (*len < rlen) { grib_context_log(a->context, GRIB_LOG_ERROR, - " wrong size (%ld) for %s it contains %d values ", *len, a->name, rlen); + "Wrong size (%ld) for %s it contains %ld values", *len, a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_smart_table.c b/src/grib_accessor_class_smart_table.c index fc7fab492..d43f149dc 100644 --- a/src/grib_accessor_class_smart_table.c +++ b/src/grib_accessor_class_smart_table.c @@ -569,7 +569,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) if (*len < self->tableCodesSize) { grib_context_log(a->context, GRIB_LOG_ERROR, - " wrong size (%ld) for %s it contains %d values ", *len, a->name, self->tableCodesSize); + "Wrong size (%lu) for %s it contains %lu values", *len, a->name, self->tableCodesSize); *len = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_spd.c b/src/grib_accessor_class_spd.c index d1ff5e89e..51b894d58 100644 --- a/src/grib_accessor_class_spd.c +++ b/src/grib_accessor_class_spd.c @@ -198,7 +198,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) if (*len < rlen) { grib_context_log(a->context, GRIB_LOG_ERROR, - " wrong size (%ld) for %s it contains %d values ", *len, a->name, rlen); + "Wrong size (%ld) for %s it contains %ld values", *len, a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_spectral_truncation.c b/src/grib_accessor_class_spectral_truncation.c index 9ae52d410..4acf16a31 100644 --- a/src/grib_accessor_class_spectral_truncation.c +++ b/src/grib_accessor_class_spectral_truncation.c @@ -192,7 +192,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->T, &T)) != GRIB_SUCCESS) { if (Tc == -1) grib_context_log(a->context, GRIB_LOG_ERROR, - "%s. Spectral Truncation Type Unknown: %s=%d %s=%d %s=%d \n", + "%s. Spectral Truncation Type Unknown: %s=%ld %s=%ld %s=%ld", a->name, self->J, J, self->K, K, self->M, M); Tc = 0; grib_set_long(grib_handle_of_accessor(a), self->T, Tc); diff --git a/src/grib_accessor_class_time.c b/src/grib_accessor_class_time.c index f9155bdb0..6d1851769 100644 --- a/src/grib_accessor_class_time.c +++ b/src/grib_accessor_class_time.c @@ -172,7 +172,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) /* We ignore the 'seconds' in our time calculation! */ if (second != 0) { grib_context_log(a->context, GRIB_LOG_ERROR, - "Truncating time: non-zero seconds(%d) ignored", second); + "Truncating time: non-zero seconds(%ld) ignored", second); } if (*len < 1) diff --git a/src/grib_accessor_class_to_double.c b/src/grib_accessor_class_to_double.c index 4a55eec5d..9b24ef42a 100644 --- a/src/grib_accessor_class_to_double.c +++ b/src/grib_accessor_class_to_double.c @@ -210,7 +210,8 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) length = string_length(a); if (len[0] < length + 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%lu) for %s, it contains %ld values", + len[0], a->name, a->length + 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_to_integer.c b/src/grib_accessor_class_to_integer.c index 83265a6ae..44a8f472d 100644 --- a/src/grib_accessor_class_to_integer.c +++ b/src/grib_accessor_class_to_integer.c @@ -205,7 +205,8 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) length = string_length(a); if (len[0] < length + 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%lu) for %s, it contains %ld values", + len[0], a->name, a->length + 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_to_string.c b/src/grib_accessor_class_to_string.c index 451ac1882..77ef957f3 100644 --- a/src/grib_accessor_class_to_string.c +++ b/src/grib_accessor_class_to_string.c @@ -205,7 +205,8 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) length = string_length(a); if (len[0] < length + 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%lu) for %s, it contains %ld values", + len[0], a->name, a->length + 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_unsigned.c b/src/grib_accessor_class_unsigned.c index f98f910d3..880053dc2 100644 --- a/src/grib_accessor_class_unsigned.c +++ b/src/grib_accessor_class_unsigned.c @@ -301,7 +301,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) rlen = count; if (*len < rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size (%ld) for %s it contains %d values ", *len, a->name, rlen); + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size (%ld) for %s, it contains %ld values", *len, a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_unsigned_bits.c b/src/grib_accessor_class_unsigned_bits.c index 33580a7a8..7774f67ff 100644 --- a/src/grib_accessor_class_unsigned_bits.c +++ b/src/grib_accessor_class_unsigned_bits.c @@ -193,7 +193,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) if (*len < rlen) { grib_context_log(a->context, GRIB_LOG_ERROR, - " wrong size (%ld) for %s it contains %d values ", *len, a->name, rlen); + "Wrong size (%ld) for %s, it contains %ld values", *len, a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_variable.c b/src/grib_accessor_class_variable.c index 8cadd3289..9b1986f45 100644 --- a/src/grib_accessor_class_variable.c +++ b/src/grib_accessor_class_variable.c @@ -315,7 +315,7 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) slen = strlen(p) + 1; if (*len < slen) { grib_context_log(a->context, GRIB_LOG_ERROR, - "Variable unpack_string. Wrong size for %s, it is %d bytes long (len=%d)", + "Variable unpack_string. Wrong size for %s, it is %ld bytes long (len=%lu)", a->name, slen, *len); *len = slen; return GRIB_BUFFER_TOO_SMALL; diff --git a/src/grib_fieldset.c b/src/grib_fieldset.c index a3c9b51dd..7400f23bd 100644 --- a/src/grib_fieldset.c +++ b/src/grib_fieldset.c @@ -819,7 +819,7 @@ static int grib_fieldset_resize_int_array(grib_int_array* a, size_t newsize) el = (int*)grib_context_realloc(a->context, a->el, newsize); if (!el) { grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_fieldset_resize_int_array : Cannot malloc %d bytes", + "grib_fieldset_resize_int_array: Cannot malloc %lu bytes", newsize); return GRIB_OUT_OF_MEMORY; } @@ -863,7 +863,7 @@ static int grib_fieldset_resize_fields(grib_fieldset* set, size_t newsize) fields = (grib_field**)grib_context_realloc(set->context, set->fields, newsize * sizeof(grib_field*)); if (!fields) { grib_context_log(set->context, GRIB_LOG_ERROR, - "grib_fieldset_resize_fields : Cannot malloc %d bytes", + "grib_fieldset_resize_fields: Cannot malloc %lu bytes", newsize * sizeof(grib_field*)); return GRIB_OUT_OF_MEMORY; } diff --git a/src/grib_index.c b/src/grib_index.c index 8fd4ac51f..bdb348814 100644 --- a/src/grib_index.c +++ b/src/grib_index.c @@ -993,7 +993,7 @@ int grib_index_search_same(grib_index* index, grib_handle* h) grib_index_key* keys; long lval = 0; double dval = 0.0; - grib_context* c; + grib_context* c = NULL; if (!index) return GRIB_NULL_INDEX; @@ -1883,8 +1883,7 @@ grib_handle* codes_new_from_index(grib_index* index, int message_type, int* err) sizeof(grib_field_list)); if (!index->fieldset) { grib_context_log(index->context, GRIB_LOG_ERROR, - "unable to allocate %d bytes", - sizeof(grib_field_list)); + "unable to allocate %lu bytes", sizeof(grib_field_list)); return NULL; } index->current = index->fieldset; diff --git a/src/grib_loader_from_handle.c b/src/grib_loader_from_handle.c index bf15a2fd7..a9242584d 100644 --- a/src/grib_loader_from_handle.c +++ b/src/grib_loader_from_handle.c @@ -248,7 +248,8 @@ int grib_init_accessor_from_handle(grib_loader* loader, grib_accessor* ga, grib_ break; default: - grib_context_log(h->context, GRIB_LOG_ERROR, "Copying %s, cannot establish type %d [%s]", name, grib_accessor_get_native_type(ga), ga->creator->cclass->name); + grib_context_log(h->context, GRIB_LOG_ERROR, + "Copying %s, cannot establish type %ld [%s]", name, grib_accessor_get_native_type(ga), ga->creator->cclass->name); break; } diff --git a/src/grib_value.c b/src/grib_value.c index 61992201e..9c508f68b 100644 --- a/src/grib_value.c +++ b/src/grib_value.c @@ -467,7 +467,7 @@ int grib_set_bytes_internal(grib_handle* h, const char* name, const unsigned cha return grib_dependency_notify_change(a); } - grib_context_log(h->context, GRIB_LOG_ERROR, "unable to set %s=%ld as bytes (%s)", + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to set %s=%s as bytes (%s)", name, val, grib_get_error_message(ret)); return ret; }