From de976ac0c2881f5454da5ad385101e530aeec9d7 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 11 Aug 2022 12:23:49 +0100 Subject: [PATCH] Remove unused struct member. Add grib_arguments_get_count --- src/eccodes_prototypes.h | 1 + src/grib_api_internal.h | 1 - src/grib_expression.c | 10 ++++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index eb8b3c6ec..3569a53eb 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -1418,6 +1418,7 @@ const char* grib_arguments_get_string(grib_handle* h, grib_arguments* args, int long grib_arguments_get_long(grib_handle* h, grib_arguments* args, int n); double grib_arguments_get_double(grib_handle* h, grib_arguments* args, int n); grib_expression* grib_arguments_get_expression(grib_handle* h, grib_arguments* args, int n); +int grib_arguments_get_count(grib_arguments* args); /* codes_util.c */ double normalise_longitude_in_degrees(double lon); diff --git a/src/grib_api_internal.h b/src/grib_api_internal.h index 4642198f9..cf8bc3be2 100644 --- a/src/grib_api_internal.h +++ b/src/grib_api_internal.h @@ -1170,7 +1170,6 @@ struct grib_arguments { struct grib_arguments* next; grib_expression* expression; - char value[80]; }; diff --git a/src/grib_expression.c b/src/grib_expression.c index 57801fac8..9a443c67c 100644 --- a/src/grib_expression.c +++ b/src/grib_expression.c @@ -255,3 +255,13 @@ grib_expression* grib_arguments_get_expression(grib_handle* h, grib_arguments* a return args->expression; } + +int grib_arguments_get_count(grib_arguments* args) +{ + int n = 0; + while (args) { + args = args->next; + n++; + } + return n; +}