Fix formatting issues in print statements [-Werror=format=]

This commit is contained in:
Shahram Najm 2022-02-07 17:23:23 +00:00
parent 3f48155076
commit 14fc79aae4
39 changed files with 68 additions and 53 deletions

View File

@ -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);

View File

@ -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,

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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)

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}