aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-06-08 02:23:00 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-06-08 18:53:19 +0200
commitcab4c232f58e5db594c7aa834d1c6ac0fc622d9a (patch)
treeb74992f4617513b95a08cf2c5f34d7990f0f3ca1
parent4ab7e953b764b51a7e20aa6dfb361fca5d1d9e52 (diff)
downloadsparse-dev-cab4c232f58e5db594c7aa834d1c6ac0fc622d9a.tar.gz
builtin: rename arguments_choose() to args_triadic()
argument_choose() did nothing specific to __builtin_chose_expr(), it simply called eval_args(expr, 3). Since exactly the same may be needed for other builtins, rename it to a more generic name making it clear it can be reused. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--builtin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin.c b/builtin.c
index 9fae8f2c..8df2e2a6 100644
--- a/builtin.c
+++ b/builtin.c
@@ -82,7 +82,7 @@ error:
return 0;
}
-static int arguments_choose(struct expression *expr)
+static int args_triadic(struct expression *expr)
{
return eval_args(expr, 3);
}
@@ -195,8 +195,8 @@ static struct symbol_op expect_op = {
};
static struct symbol_op choose_op = {
+ .args = args_triadic,
.evaluate = evaluate_choose,
- .args = arguments_choose,
};
/* The argument is constant and valid if the cost is zero */