mirror of https://github.com/ecmwf/eccodes.git
Dead code removal
This commit is contained in:
parent
917f3e655b
commit
8008982df1
|
@ -117,7 +117,7 @@ int grib_accessor_bufr_data_array_t::tableB_override_set_key(grib_handle* h)
|
|||
int err = GRIB_SUCCESS;
|
||||
size_t size = 0;
|
||||
long* refVals = NULL;
|
||||
grib_iarray* refValArray = grib_iarray_new(h->context, 10, 10);
|
||||
grib_iarray* refValArray = grib_iarray_new(10, 10);
|
||||
bufr_tableb_override* p = tableb_override_;
|
||||
while (p) {
|
||||
grib_iarray_push(refValArray, p->new_ref_val);
|
||||
|
@ -2044,7 +2044,7 @@ grib_iarray* grib_accessor_bufr_data_array_t::set_subset_list(
|
|||
grib_context* c,
|
||||
long onlySubset, long startSubset, long endSubset, const long* subsetList, size_t subsetListSize)
|
||||
{
|
||||
grib_iarray* list = grib_iarray_new(c, numberOfSubsets_, 10);
|
||||
grib_iarray* list = grib_iarray_new(numberOfSubsets_, 10);
|
||||
long s = 0;
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -2838,7 +2838,7 @@ int grib_accessor_bufr_data_array_t::process_elements(int flag, long onlySubset,
|
|||
refValIndex_ = 0;
|
||||
|
||||
if (flag != PROCESS_ENCODE) {
|
||||
elementsDescriptorsIndex = grib_iarray_new(c, DYN_ARRAY_SIZE_INIT, DYN_ARRAY_SIZE_INCR);
|
||||
elementsDescriptorsIndex = grib_iarray_new(DYN_ARRAY_SIZE_INIT, DYN_ARRAY_SIZE_INCR);
|
||||
if (!compressedData_) {
|
||||
dval = grib_darray_new(DYN_ARRAY_SIZE_INIT, DYN_ARRAY_SIZE_INCR);
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ int grib_accessor_bufr_extract_area_subsets_t::select_area()
|
|||
ret = grib_get_long(h, numberOfSubsets_, &numberOfSubsets);
|
||||
if (ret) return ret;
|
||||
|
||||
subsets = grib_iarray_new(c, numberOfSubsets, 10);
|
||||
subsets = grib_iarray_new(numberOfSubsets, 10);
|
||||
|
||||
ret = grib_set_long(h, "unpack", 1);
|
||||
if (ret) return ret;
|
||||
|
|
|
@ -144,7 +144,7 @@ int grib_accessor_bufr_extract_datetime_subsets_t::select_datetime()
|
|||
ret = grib_get_long(h, numberOfSubsets_, &numberOfSubsets);
|
||||
if (ret) return ret;
|
||||
|
||||
subsets = grib_iarray_new(c, numberOfSubsets, 10);
|
||||
subsets = grib_iarray_new(numberOfSubsets, 10);
|
||||
|
||||
ret = grib_set_long(h, "unpack", 1);
|
||||
if (ret) return ret;
|
||||
|
|
|
@ -68,7 +68,7 @@ int grib_accessor_bufr_simple_thinning_t::apply_thinning()
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
subsets = grib_iarray_new(c, numberOfSubsets / skip + 1, 10);
|
||||
subsets = grib_iarray_new(numberOfSubsets / skip + 1, 10);
|
||||
for (long i = 0; i < numberOfSubsets; i += skip + 1) {
|
||||
grib_iarray_push(subsets, i + 1);
|
||||
}
|
||||
|
|
|
@ -151,7 +151,7 @@ void* grib_oarray_get(grib_oarray* v, int i);
|
|||
|
||||
/* grib_iarray.cc */
|
||||
void grib_iarray_print(const char* title, const grib_iarray* iarray);
|
||||
grib_iarray* grib_iarray_new(grib_context* c, size_t size, size_t incsize);
|
||||
grib_iarray* grib_iarray_new(size_t size, size_t incsize);
|
||||
long grib_iarray_pop(grib_iarray* a);
|
||||
long grib_iarray_pop_front(grib_iarray* a);
|
||||
grib_iarray* grib_iarray_push(grib_iarray* v, long val);
|
||||
|
|
|
@ -37,12 +37,10 @@ void grib_iarray_print(const char* title, const grib_iarray* iarray)
|
|||
// return v;
|
||||
// }
|
||||
|
||||
grib_iarray* grib_iarray_new(grib_context* c, size_t size, size_t incsize)
|
||||
grib_iarray* grib_iarray_new(size_t size, size_t incsize)
|
||||
{
|
||||
grib_iarray* v = NULL;
|
||||
|
||||
if (!c)
|
||||
c = grib_context_get_default();
|
||||
grib_context* c = grib_context_get_default();
|
||||
|
||||
v = (grib_iarray*)grib_context_malloc(c, sizeof(grib_iarray));
|
||||
if (!v) {
|
||||
|
@ -125,7 +123,7 @@ grib_iarray* grib_iarray_push(grib_iarray* v, long val)
|
|||
size_t start_incsize = 100;
|
||||
|
||||
if (!v)
|
||||
v = grib_iarray_new(0, start_size, start_incsize);
|
||||
v = grib_iarray_new(start_size, start_incsize);
|
||||
|
||||
if (v->n >= v->size - v->number_of_pop_front)
|
||||
v = grib_iarray_resize(v);
|
||||
|
|
|
@ -612,12 +612,12 @@ void test_iarray()
|
|||
{
|
||||
printf("Running %s ...\n", __func__);
|
||||
grib_context* c = grib_context_get_default();
|
||||
grib_iarray* a = grib_iarray_new(c, 10, 10);
|
||||
grib_iarray* a = grib_iarray_new(10, 10);
|
||||
grib_iarray_push(a, 42);
|
||||
grib_iarray_push(a, 10000);
|
||||
grib_iarray_print("iarray", a);
|
||||
|
||||
grib_iarray* b = grib_iarray_new(c, 1, 1);
|
||||
grib_iarray* b = grib_iarray_new(1, 1);
|
||||
grib_iarray_push(b, 0);
|
||||
grib_iarray_push(b, -1);
|
||||
grib_iarray_push(b, +1);
|
||||
|
|
Loading…
Reference in New Issue