From ceb26469f0251263e37475d9ab6aa76eec41b012 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 29 May 2002 02:42:34 +0000 Subject: 2002-05-28 Roland McGrath * boot_script.c (boot_script_set_variable): Values int -> integer_t. (boot_script_define_function): Likewise. (boot_script_parse_line): Likewise. (struct sym, struct arg): Likewise. (boot_script_exec): Likewise. (builtin_symbols): Likewise. * boot.c (main): Likewise. * boot_script.h: Update decls. --- boot/boot_script.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'boot/boot_script.c') diff --git a/boot/boot_script.c b/boot/boot_script.c index d0317520..cfc19c2b 100644 --- a/boot/boot_script.c +++ b/boot/boot_script.c @@ -19,7 +19,7 @@ struct sym int type; /* Symbol value. */ - int val; + integer_t val; /* For function symbols; type of value returned by function. */ int ret_type; @@ -46,7 +46,7 @@ struct arg int type; /* Argument value. */ - int val; + integer_t val; }; /* List of commands. */ @@ -93,9 +93,10 @@ prompt_resume_task (struct cmd *cmd, int *val) /* List of builtin symbols. */ static struct sym builtin_symbols[] = { - { "task-create", VAL_FUNC, (int) create_task, VAL_TASK, 0 }, - { "task-resume", VAL_FUNC, (int) resume_task, VAL_NONE, 1 }, - { "prompt-task-resume", VAL_FUNC, (int) prompt_resume_task, VAL_NONE, 1 }, + { "task-create", VAL_FUNC, (integer_t) create_task, VAL_TASK, 0 }, + { "task-resume", VAL_FUNC, (integer_t) resume_task, VAL_NONE, 1 }, + { "prompt-task-resume", + VAL_FUNC, (integer_t) prompt_resume_task, VAL_NONE, 1 }, }; #define NUM_BUILTIN (sizeof (builtin_symbols) / sizeof (builtin_symbols[0])) @@ -296,7 +297,8 @@ boot_script_parse_line (void *hook, char *cmdline) for (p += 2;;) { char c; - int i, val, type; + int i, type; + integer_t val; struct sym *s; /* Parse symbol name. */ @@ -351,7 +353,7 @@ boot_script_parse_line (void *hook, char *cmdline) if (! s->run_on_exec) { (error - = ((*((int (*) (struct cmd *, int *)) s->val)) + = ((*((int (*) (struct cmd *, integer_t *)) s->val)) (cmd, &val))); if (error) goto bad; @@ -373,7 +375,7 @@ boot_script_parse_line (void *hook, char *cmdline) else if (s->type == VAL_NONE) { type = VAL_SYM; - val = (int) s; + val = (integer_t) s; } else { @@ -643,7 +645,7 @@ boot_script_exec () for (i = 0; i < cmd->exec_funcs_index; i++) { struct sym *sym = cmd->exec_funcs[i]; - int error = ((*((int (*) (struct cmd *, int *)) sym->val)) + int error = ((*((int (*) (struct cmd *, integer_t *)) sym->val)) (cmd, 0)); if (error) { @@ -660,7 +662,7 @@ boot_script_exec () /* Create an entry for the variable NAME with TYPE and value VAL, in the symbol table. */ int -boot_script_set_variable (const char *name, int type, int val) +boot_script_set_variable (const char *name, int type, integer_t val) { struct sym *sym = sym_enter (name); @@ -676,14 +678,15 @@ boot_script_set_variable (const char *name, int type, int val) /* Define the function NAME, which will return type RET_TYPE. */ int boot_script_define_function (const char *name, int ret_type, - int (*func) (const struct cmd *cmd, int *val)) + int (*func) (const struct cmd *cmd, + integer_t *val)) { struct sym *sym = sym_enter (name); if (sym) { sym->type = VAL_FUNC; - sym->val = (int) func; + sym->val = (integer_t) func; sym->ret_type = ret_type; sym->run_on_exec = ret_type == VAL_NONE; } -- cgit v1.2.3