Expression: unary op name

This commit is contained in:
shahramn 2024-05-03 17:32:10 +01:00
parent 908a6d367c
commit 4f577fea52
3 changed files with 12 additions and 6 deletions

View File

@ -17,6 +17,7 @@
CLASS = expression
IMPLEMENTS = destroy
IMPLEMENTS = native_type
IMPLEMENTS = get_name
IMPLEMENTS = evaluate_long
IMPLEMENTS = evaluate_double
IMPLEMENTS = print
@ -42,6 +43,7 @@ typedef const char* string; /* to keep make_class.pl happy */
static void destroy(grib_context*,grib_expression* e);
static void print(grib_context*,grib_expression*,grib_handle*);
static void add_dependency(grib_expression* e, grib_accessor* observer);
static string get_name(grib_expression* e);
static int native_type(grib_expression*,grib_handle*);
static int evaluate_long(grib_expression*,grib_handle*,long*);
static int evaluate_double(grib_expression*,grib_handle*,double*);
@ -65,7 +67,7 @@ static grib_expression_class _grib_expression_class_unop = {
&print,
&add_dependency,
&native_type,
0,
&get_name,
&evaluate_long,
&evaluate_double,
0,
@ -97,6 +99,12 @@ static int evaluate_double(grib_expression* g, grib_handle* h, double* dres)
return GRIB_SUCCESS;
}
static const char* get_name(grib_expression* g)
{
grib_expression_unop* e = (grib_expression_unop*)g;
return grib_expression_get_name(e->exp);
}
static void print(grib_context* c, grib_expression* g, grib_handle* f)
{
grib_expression_unop* e = (grib_expression_unop*)g;
@ -111,7 +119,6 @@ static void destroy(grib_context* c, grib_expression* g)
grib_expression_free(c, e->exp);
}
static void add_dependency(grib_expression* g, grib_accessor* observer)
{
grib_expression_unop* e = (grib_expression_unop*)g;

View File

@ -83,9 +83,9 @@ grib_iterator_class* grib_iterator_class_healpix = &_grib_iterator_class_healpix
static void init_class(grib_iterator_class* c)
{
c->previous = (*(c->super))->previous;
c->reset = (*(c->super))->reset;
c->has_next = (*(c->super))->has_next;
c->previous = (*(c->super))->previous;
c->reset = (*(c->super))->reset;
c->has_next = (*(c->super))->has_next;
}
/* END_CLASS_IMP */

View File

@ -62,7 +62,6 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h)
size_t last_size = 0;
long missingValuesPresent;
double delta;
int err = 0;
double* values = NULL;
size_t size;