Error messages: Use correct format string

This commit is contained in:
Shahram Najm 2022-11-02 16:47:21 +00:00
parent 328365e510
commit 2ba6982e8a
7 changed files with 21 additions and 21 deletions

View File

@ -48,7 +48,7 @@ grib_darray* grib_darray_new(grib_context* c, size_t size, size_t incsize)
v = (grib_darray*)grib_context_malloc_clear(c, sizeof(grib_darray)); v = (grib_darray*)grib_context_malloc_clear(c, sizeof(grib_darray));
if (!v) { if (!v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_darray_new unable to allocate %ld bytes\n", sizeof(grib_darray)); "grib_darray_new unable to allocate %lu bytes\n", sizeof(grib_darray));
return NULL; return NULL;
} }
v->size = size; v->size = size;
@ -58,7 +58,7 @@ grib_darray* grib_darray_new(grib_context* c, size_t size, size_t incsize)
v->v = (double*)grib_context_malloc_clear(c, sizeof(double) * size); v->v = (double*)grib_context_malloc_clear(c, sizeof(double) * size);
if (!v->v) { if (!v->v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_darray_new unable to allocate %ld bytes\n", sizeof(double) * size); "grib_darray_new unable to allocate %lu bytes\n", sizeof(double) * size);
return NULL; return NULL;
} }
return v; return v;
@ -75,7 +75,7 @@ static grib_darray* grib_darray_resize(grib_darray* v)
v->size = newsize; v->size = newsize;
if (!v->v) { if (!v->v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_darray_resize unable to allocate %ld bytes\n", sizeof(double) * newsize); "grib_darray_resize unable to allocate %lu bytes\n", sizeof(double) * newsize);
return NULL; return NULL;
} }
return v; return v;

View File

@ -57,7 +57,7 @@ grib_iarray* grib_iarray_new(grib_context* c, size_t size, size_t incsize)
v = (grib_iarray*)grib_context_malloc(c, sizeof(grib_iarray)); v = (grib_iarray*)grib_context_malloc(c, sizeof(grib_iarray));
if (!v) { if (!v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_iarray_new unable to allocate %ld bytes\n", sizeof(grib_iarray)); "grib_iarray_new unable to allocate %lu bytes\n", sizeof(grib_iarray));
return NULL; return NULL;
} }
v->context = c; v->context = c;
@ -68,7 +68,7 @@ grib_iarray* grib_iarray_new(grib_context* c, size_t size, size_t incsize)
v->number_of_pop_front = 0; v->number_of_pop_front = 0;
if (!v->v) { if (!v->v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_iarray_new unable to allocate %ld bytes\n", sizeof(long) * size); "grib_iarray_new unable to allocate %lu bytes\n", sizeof(long) * size);
return NULL; return NULL;
} }
return v; return v;
@ -109,7 +109,7 @@ static grib_iarray* grib_iarray_resize_to(grib_iarray* v, size_t newsize)
newv = (long*)grib_context_malloc_clear(c, newsize * sizeof(long)); newv = (long*)grib_context_malloc_clear(c, newsize * sizeof(long));
if (!newv) { if (!newv) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_iarray_resize unable to allocate %ld bytes\n", sizeof(long) * newsize); "grib_iarray_resize unable to allocate %lu bytes\n", sizeof(long) * newsize);
return NULL; return NULL;
} }

View File

@ -24,7 +24,7 @@ grib_oarray* grib_oarray_new(grib_context* c, size_t size, size_t incsize)
v = (grib_oarray*)grib_context_malloc_clear(c, sizeof(grib_oarray)); v = (grib_oarray*)grib_context_malloc_clear(c, sizeof(grib_oarray));
if (!v) { if (!v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_oarray_new unable to allocate %ld bytes\n", sizeof(grib_oarray)); "grib_oarray_new unable to allocate %lu bytes\n", sizeof(grib_oarray));
return NULL; return NULL;
} }
v->size = size; v->size = size;
@ -34,7 +34,7 @@ grib_oarray* grib_oarray_new(grib_context* c, size_t size, size_t incsize)
v->context = c; v->context = c;
if (!v->v) { if (!v->v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_oarray_new unable to allocate %ld bytes\n", sizeof(char*) * size); "grib_oarray_new unable to allocate %lu bytes\n", sizeof(char*) * size);
return NULL; return NULL;
} }
return v; return v;
@ -51,7 +51,7 @@ static grib_oarray* grib_oarray_resize(grib_oarray* v)
v->size = newsize; v->size = newsize;
if (!v->v) { if (!v->v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_oarray_resize unable to allocate %ld bytes\n", sizeof(char*) * newsize); "grib_oarray_resize unable to allocate %lu bytes\n", sizeof(char*) * newsize);
return NULL; return NULL;
} }
return v; return v;

View File

@ -18,7 +18,7 @@ grib_sarray* grib_sarray_new(grib_context* c, size_t size, size_t incsize)
v = (grib_sarray*)grib_context_malloc_clear(c, sizeof(grib_sarray)); v = (grib_sarray*)grib_context_malloc_clear(c, sizeof(grib_sarray));
if (!v) { if (!v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_sarray_new unable to allocate %ld bytes\n", sizeof(grib_sarray)); "grib_sarray_new unable to allocate %lu bytes\n", sizeof(grib_sarray));
return NULL; return NULL;
} }
v->size = size; v->size = size;
@ -28,7 +28,7 @@ grib_sarray* grib_sarray_new(grib_context* c, size_t size, size_t incsize)
v->v = (char**)grib_context_malloc_clear(c, sizeof(char*) * size); v->v = (char**)grib_context_malloc_clear(c, sizeof(char*) * size);
if (!v->v) { if (!v->v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_sarray_new unable to allocate %ld bytes\n", sizeof(char*) * size); "grib_sarray_new unable to allocate %lu bytes\n", sizeof(char*) * size);
return NULL; return NULL;
} }
return v; return v;
@ -45,7 +45,7 @@ static grib_sarray* grib_sarray_resize(grib_sarray* v)
v->size = newsize; v->size = newsize;
if (!v->v) { if (!v->v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_sarray_resize unable to allocate %ld bytes\n", sizeof(char*) * newsize); "grib_sarray_resize unable to allocate %lu bytes\n", sizeof(char*) * newsize);
return NULL; return NULL;
} }
return v; return v;

View File

@ -38,7 +38,7 @@ grib_vdarray* grib_vdarray_new(grib_context* c, size_t size, size_t incsize)
v = (grib_vdarray*)grib_context_malloc_clear(c, sizeof(grib_vdarray)); v = (grib_vdarray*)grib_context_malloc_clear(c, sizeof(grib_vdarray));
if (!v) { if (!v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_vdarray_new unable to allocate %ld bytes\n", sizeof(grib_vdarray)); "grib_vdarray_new unable to allocate %lu bytes\n", sizeof(grib_vdarray));
return NULL; return NULL;
} }
v->size = size; v->size = size;
@ -48,7 +48,7 @@ grib_vdarray* grib_vdarray_new(grib_context* c, size_t size, size_t incsize)
v->v = (grib_darray**)grib_context_malloc_clear(c, sizeof(grib_darray*) * size); v->v = (grib_darray**)grib_context_malloc_clear(c, sizeof(grib_darray*) * size);
if (!v->v) { if (!v->v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_vdarray_new unable to allocate %ld bytes\n", sizeof(grib_darray*) * size); "grib_vdarray_new unable to allocate %lu bytes\n", sizeof(grib_darray*) * size);
return NULL; return NULL;
} }
return v; return v;
@ -65,7 +65,7 @@ static grib_vdarray* grib_vdarray_resize(grib_vdarray* v)
v->size = newsize; v->size = newsize;
if (!v->v) { if (!v->v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_vdarray_resize unable to allocate %ld bytes\n", sizeof(grib_darray*) * newsize); "grib_vdarray_resize unable to allocate %lu bytes\n", sizeof(grib_darray*) * newsize);
return NULL; return NULL;
} }
return v; return v;

View File

@ -38,7 +38,7 @@ grib_viarray* grib_viarray_new(grib_context* c, size_t size, size_t incsize)
v = (grib_viarray*)grib_context_malloc_clear(c, sizeof(grib_viarray)); v = (grib_viarray*)grib_context_malloc_clear(c, sizeof(grib_viarray));
if (!v) { if (!v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_viarray_new unable to allocate %ld bytes\n", sizeof(grib_viarray)); "grib_viarray_new unable to allocate %lu bytes\n", sizeof(grib_viarray));
return NULL; return NULL;
} }
v->size = size; v->size = size;
@ -48,7 +48,7 @@ grib_viarray* grib_viarray_new(grib_context* c, size_t size, size_t incsize)
v->v = (grib_iarray**)grib_context_malloc_clear(c, sizeof(grib_iarray*) * size); v->v = (grib_iarray**)grib_context_malloc_clear(c, sizeof(grib_iarray*) * size);
if (!v->v) { if (!v->v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_viarray_new unable to allocate %ld bytes\n", sizeof(grib_iarray*) * size); "grib_viarray_new unable to allocate %lu bytes\n", sizeof(grib_iarray*) * size);
return NULL; return NULL;
} }
return v; return v;
@ -65,7 +65,7 @@ static grib_viarray* grib_viarray_resize(grib_viarray* v)
v->size = newsize; v->size = newsize;
if (!v->v) { if (!v->v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_viarray_resize unable to allocate %ld bytes\n", sizeof(grib_iarray*) * newsize); "grib_viarray_resize unable to allocate %lu bytes\n", sizeof(grib_iarray*) * newsize);
return NULL; return NULL;
} }
return v; return v;

View File

@ -24,7 +24,7 @@ grib_vsarray* grib_vsarray_new(grib_context* c, size_t size, size_t incsize)
v = (grib_vsarray*)grib_context_malloc_clear(c, sizeof(grib_vsarray)); v = (grib_vsarray*)grib_context_malloc_clear(c, sizeof(grib_vsarray));
if (!v) { if (!v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_vsarray_new unable to allocate %ld bytes\n", sizeof(grib_vsarray)); "grib_vsarray_new unable to allocate %lu bytes\n", sizeof(grib_vsarray));
return NULL; return NULL;
} }
v->size = size; v->size = size;
@ -34,7 +34,7 @@ grib_vsarray* grib_vsarray_new(grib_context* c, size_t size, size_t incsize)
v->v = (grib_sarray**)grib_context_malloc_clear(c, sizeof(grib_sarray*) * size); v->v = (grib_sarray**)grib_context_malloc_clear(c, sizeof(grib_sarray*) * size);
if (!v->v) { if (!v->v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_vsarray_new unable to allocate %ld bytes\n", sizeof(grib_sarray*) * size); "grib_vsarray_new unable to allocate %lu bytes\n", sizeof(grib_sarray*) * size);
return NULL; return NULL;
} }
return v; return v;
@ -51,7 +51,7 @@ static grib_vsarray* grib_vsarray_resize(grib_vsarray* v)
v->size = newsize; v->size = newsize;
if (!v->v) { if (!v->v) {
grib_context_log(c, GRIB_LOG_ERROR, grib_context_log(c, GRIB_LOG_ERROR,
"grib_vsarray_resize unable to allocate %ld bytes\n", sizeof(grib_sarray*) * newsize); "grib_vsarray_resize unable to allocate %lu bytes\n", sizeof(grib_sarray*) * newsize);
return NULL; return NULL;
} }
return v; return v;