summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-09-10 11:48:40 +0200
committerJo-Philipp Wich <jo@mein.io>2020-09-10 15:08:54 +0200
commit4631259c83351bb99bfde85fef9cfa6ab233f069 (patch)
tree673fd443d2d22d60c93d084eb198089f43f0bcfb
parent5d1ef3ad2eabd5a78a84b6608a0c5b633b5a3d29 (diff)
eval: rename "main" to "entry"
Fixes the following gcc error: .../eval.c:1435:22: error: 'main' is usually a function [-Werror=main] struct json_object *main, *scope, *args, *rv; ^~~~ cc1: all warnings being treated as errors Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--eval.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/eval.c b/eval.c
index d2099dd..35a70fd 100644
--- a/eval.c
+++ b/eval.c
@@ -1432,7 +1432,7 @@ enum ut_error_type
ut_run(struct ut_state *state)
{
struct ut_op *op = ut_get_op(state, state->main);
- struct json_object *main, *scope, *args, *rv;
+ struct json_object *entry, *scope, *args, *rv;
if (!op || op->type != T_FUNC) {
ut_exception(state, state->main, "Runtime error: Invalid root operation in AST");
@@ -1440,9 +1440,9 @@ ut_run(struct ut_state *state)
return UT_ERROR_EXCEPTION;
}
- main = ut_execute_function(state, state->main);
+ entry = ut_execute_function(state, state->main);
- if (!main)
+ if (!entry)
return UT_ERROR_EXCEPTION;
scope = ut_addscope(state, state->main);
@@ -1456,9 +1456,9 @@ ut_run(struct ut_state *state)
ut_lib_init(state, scope);
args = json_object_new_array();
- rv = ut_invoke(state, state->main, NULL, main, args);
+ rv = ut_invoke(state, state->main, NULL, entry, args);
- json_object_put(main);
+ json_object_put(entry);
json_object_put(args);
json_object_put(rv);