Expressions: Fix the print function

This commit is contained in:
shahramn 2024-04-05 17:32:34 +01:00
parent c63a9f621b
commit aee114c9bd
2 changed files with 2 additions and 8 deletions

View File

@ -82,7 +82,6 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres)
int ret;
grib_expression_logical_and* e = (grib_expression_logical_and*)g;
switch (grib_expression_native_type(h, e->left)) {
case GRIB_TYPE_LONG:
ret = grib_expression_evaluate_long(h, e->left, &v1);
@ -129,11 +128,8 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres)
static int evaluate_double(grib_expression* g, grib_handle* h, double* dres)
{
long lres = 0;
int ret = 0;
ret = evaluate_long(g, h, &lres);
int ret = evaluate_long(g, h, &lres);
*dres = (double)lres;
return ret;
}

View File

@ -129,10 +129,8 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres)
static int evaluate_double(grib_expression* g, grib_handle* h, double* dres)
{
long lres = 0;
int ret = evaluate_long(g, h, &lres);
*dres = (double)lres;
return ret;
}
@ -141,7 +139,7 @@ static void print(grib_context* c, grib_expression* g, grib_handle* f)
grib_expression_logical_or* e = (grib_expression_logical_or*)g;
printf("(");
grib_expression_print(c, e->left, f);
printf(" && ");
printf(" || ");
grib_expression_print(c, e->right, f);
printf(")");
}