Skip to content

Commit

Permalink
Expression: unary op name
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed May 3, 2024
1 parent 908a6d3 commit 4f577fe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
11 changes: 9 additions & 2 deletions src/grib_expression_class_unop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
CLASS = expression
IMPLEMENTS = destroy
IMPLEMENTS = native_type
IMPLEMENTS = get_name
IMPLEMENTS = evaluate_long
IMPLEMENTS = evaluate_double
IMPLEMENTS = print
Expand All @@ -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*);
Expand All @@ -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,
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/grib_iterator_class_healpix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
1 change: 0 additions & 1 deletion tools/grib_histogram.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4f577fe

Please sign in to comment.