From c3a333e8651910a5bc4128827e0db9397523c92e Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 21 Aug 2023 17:47:04 +0100 Subject: [PATCH] Dead code removal: Unused functions --- src/eccodes_prototypes.h | 2 -- src/grib_bufr_descriptors_array.cc | 54 ++++++++++++++---------------- 2 files changed, 26 insertions(+), 30 deletions(-) diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index ac0f6012a..7e551e962 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -192,9 +192,7 @@ bufr_descriptors_array* grib_bufr_descriptors_array_new(grib_context* c, size_t bufr_descriptor* grib_bufr_descriptors_array_pop_front(bufr_descriptors_array* a); bufr_descriptors_array* grib_bufr_descriptors_array_push(bufr_descriptors_array* v, bufr_descriptor* val); bufr_descriptors_array* grib_bufr_descriptors_array_append(bufr_descriptors_array* v, bufr_descriptors_array* ar); -bufr_descriptors_array* grib_bufr_descriptors_array_push_front(bufr_descriptors_array* v, bufr_descriptor* val); bufr_descriptor* grib_bufr_descriptors_array_get(bufr_descriptors_array* a, size_t i); -void grib_bufr_descriptors_array_set(bufr_descriptors_array* a, size_t i, bufr_descriptor* v); void grib_bufr_descriptors_array_delete(bufr_descriptors_array* v); void grib_bufr_descriptors_array_delete_array(bufr_descriptors_array* v); bufr_descriptor** grib_bufr_descriptors_array_get_array(bufr_descriptors_array* v); diff --git a/src/grib_bufr_descriptors_array.cc b/src/grib_bufr_descriptors_array.cc index 49a0db7f9..b221fea75 100644 --- a/src/grib_bufr_descriptors_array.cc +++ b/src/grib_bufr_descriptors_array.cc @@ -135,40 +135,38 @@ bufr_descriptors_array* grib_bufr_descriptors_array_append(bufr_descriptors_arra return v; } -bufr_descriptors_array* grib_bufr_descriptors_array_push_front(bufr_descriptors_array* v, bufr_descriptor* val) -{ - size_t i = 0; - if (!v) { - size_t start_size = DYN_ARRAY_SIZE_INIT; - size_t start_incsize = DYN_ARRAY_SIZE_INCR; - v = grib_bufr_descriptors_array_new(0, start_size, start_incsize); - } - - if (v->number_of_pop_front) { - v->v--; - v->number_of_pop_front--; - } - else { - if (v->n >= v->size) - v = grib_bufr_descriptors_array_resize(v); - for (i = v->n; i > 0; i--) - v[i] = v[i - 1]; - } - v->v[0] = val; - v->n++; - - return v; -} +// bufr_descriptors_array* grib_bufr_descriptors_array_push_front(bufr_descriptors_array* v, bufr_descriptor* val) +// { +// size_t i = 0; +// if (!v) { +// size_t start_size = DYN_ARRAY_SIZE_INIT; +// size_t start_incsize = DYN_ARRAY_SIZE_INCR; +// v = grib_bufr_descriptors_array_new(0, start_size, start_incsize); +// } +// if (v->number_of_pop_front) { +// v->v--; +// v->number_of_pop_front--; +// } +// else { +// if (v->n >= v->size) +// v = grib_bufr_descriptors_array_resize(v); +// for (i = v->n; i > 0; i--) +// v[i] = v[i - 1]; +// } +// v->v[0] = val; +// v->n++; +// return v; +// } bufr_descriptor* grib_bufr_descriptors_array_get(bufr_descriptors_array* a, size_t i) { return a->v[i]; } -void grib_bufr_descriptors_array_set(bufr_descriptors_array* a, size_t i, bufr_descriptor* v) -{ - a->v[i] = v; -} +// void grib_bufr_descriptors_array_set(bufr_descriptors_array* a, size_t i, bufr_descriptor* v) +// { +// a->v[i] = v; +// } void grib_bufr_descriptors_array_delete(bufr_descriptors_array* v) {