Dead code removal

This commit is contained in:
shahramn 2024-10-12 15:20:11 +01:00
parent 5a40b70e22
commit fee14f899e
4 changed files with 7 additions and 8 deletions

View File

@ -2786,7 +2786,7 @@ int grib_accessor_bufr_data_array_t::process_elements(int flag, long onlySubset,
} }
if (flag != PROCESS_ENCODE) { if (flag != PROCESS_ENCODE) {
numericValues_ = grib_vdarray_new(c, 1000, 1000); numericValues_ = grib_vdarray_new(1000, 1000);
stringValues_ = grib_vsarray_new(c, 10, 10); stringValues_ = grib_vsarray_new(c, 10, 10);
if (elementsDescriptorsIndex_) { if (elementsDescriptorsIndex_) {
@ -2796,7 +2796,7 @@ int grib_accessor_bufr_data_array_t::process_elements(int flag, long onlySubset,
elementsDescriptorsIndex_ = grib_viarray_new(c, 100, 100); elementsDescriptorsIndex_ = grib_viarray_new(c, 100, 100);
} }
if (flag == PROCESS_NEW_DATA) { if (flag == PROCESS_NEW_DATA) {
tempDoubleValues_ = grib_vdarray_new(c, 1000, 1000); tempDoubleValues_ = grib_vdarray_new(1000, 1000);
} }
if (flag != PROCESS_DECODE) { /* Operator 203YYY: key OVERRIDDEN_REFERENCE_VALUES_KEY */ if (flag != PROCESS_DECODE) { /* Operator 203YYY: key OVERRIDDEN_REFERENCE_VALUES_KEY */

View File

@ -162,7 +162,7 @@ size_t grib_iarray_used_size(grib_iarray* v);
/* grib_vdarray.cc */ /* grib_vdarray.cc */
void grib_vdarray_print(const char* title, const grib_vdarray* vdarray); void grib_vdarray_print(const char* title, const grib_vdarray* vdarray);
grib_vdarray* grib_vdarray_new(grib_context* c, size_t size, size_t incsize); grib_vdarray* grib_vdarray_new(size_t size, size_t incsize);
grib_vdarray* grib_vdarray_push(grib_context* c, grib_vdarray* v, grib_darray* val); grib_vdarray* grib_vdarray_push(grib_context* c, grib_vdarray* v, grib_darray* val);
void grib_vdarray_delete(grib_context* c, grib_vdarray* v); void grib_vdarray_delete(grib_context* c, grib_vdarray* v);
void grib_vdarray_delete_content(grib_context* c, grib_vdarray* v); void grib_vdarray_delete_content(grib_context* c, grib_vdarray* v);

View File

@ -24,11 +24,10 @@ void grib_vdarray_print(const char* title, const grib_vdarray* vdarray)
printf("\n"); printf("\n");
} }
grib_vdarray* grib_vdarray_new(grib_context* c, size_t size, size_t incsize) grib_vdarray* grib_vdarray_new(size_t size, size_t incsize)
{ {
grib_vdarray* v = NULL; grib_vdarray* v = NULL;
if (!c) grib_context* c = grib_context_get_default();
c = grib_context_get_default();
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,
@ -70,7 +69,7 @@ grib_vdarray* grib_vdarray_push(grib_context* c, grib_vdarray* v, grib_darray* v
size_t start_size = 100; size_t start_size = 100;
size_t start_incsize = 100; size_t start_incsize = 100;
if (!v) if (!v)
v = grib_vdarray_new(c, start_size, start_incsize); v = grib_vdarray_new(start_size, start_incsize);
if (v->n >= v->size) if (v->n >= v->size)
v = grib_vdarray_resize(v); v = grib_vdarray_resize(v);

View File

@ -646,7 +646,7 @@ void test_darray()
grib_darray_push(b, 8); grib_darray_push(b, 8);
grib_darray_push(b, 12); grib_darray_push(b, 12);
grib_vdarray* va = grib_vdarray_new(c, 1, 1); grib_vdarray* va = grib_vdarray_new(1, 1);
grib_vdarray_push(c, va, a); grib_vdarray_push(c, va, a);
grib_vdarray_push(c, va, b); grib_vdarray_push(c, va, b);
grib_vdarray_print("vdarray", va); grib_vdarray_print("vdarray", va);