diff --git a/ChangeLog b/ChangeLog index 31d39e667..afe6ae655 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-07-03 Robert Larice + * src/frontend/evaluate.c , + * src/include/fteparse.h : + ansi style function args for some function pointers + 2010-07-03 Robert Larice * src/ciderlib/support/database.c , * src/ciderlib/support/logfile.c , diff --git a/src/frontend/evaluate.c b/src/frontend/evaluate.c index 9f874c2d9..97e138e2c 100644 --- a/src/frontend/evaluate.c +++ b/src/frontend/evaluate.c @@ -58,13 +58,12 @@ ft_evaluate(struct pnode *node) d = apply_func(node->pn_func, node->pn_left); else if (node->pn_op) { if (node->pn_op->op_arity == 1) - d = (struct dvec *) - ((*node->pn_op->op_func) (node->pn_left)); + d = ((*node->pn_op->op_func.unary) (node->pn_left)); else if (node->pn_op->op_arity == 2) { if(node->pn_op->op_num == TERNARY) d = ft_ternary(node); else - d = (*node->pn_op->op_func) (node->pn_left, node->pn_right); + d = (*node->pn_op->op_func.binary) (node->pn_left, node->pn_right); } } else { fprintf(cp_err, "ft_evaluate: Internal Error: bad node\n"); @@ -96,7 +95,7 @@ ft_ternary(struct pnode *node) struct pnode *arg; int c; - if(!node->pn_right->pn_op || node->pn_right->pn_op->op_func != op_comma) + if(!node->pn_right->pn_op || node->pn_right->pn_op->op_func.binary != op_comma) { fprintf(cp_err, "Error: ft_ternary(), daemons ...\n"); return NULL; diff --git a/src/include/fteparse.h b/src/include/fteparse.h index e95d2928d..756b1e9e1 100644 --- a/src/include/fteparse.h +++ b/src/include/fteparse.h @@ -28,7 +28,10 @@ struct op { int op_num; /* From parser #defines. */ char *op_name; /* Printing name. */ char op_arity; /* One or two. */ - struct dvec *(*op_func)(); /* The function to do the work. */ + union { + struct dvec *(*unary)(struct pnode *); + struct dvec *(*binary)(struct pnode *, struct pnode *); + } op_func; /* The function to do the work. */ } ; /* The functions that are available. */