--- Gnu-Mach/ddb/db_macro.c 2020/09/02 04:36:57 1.1 +++ Gnu-Mach/ddb/db_macro.c 2020/09/02 04:48:19 1.1.1.4 @@ -1,38 +1,42 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ -#include "mach_kdb.h" + #if MACH_KDB +#include #include #include #include #include #include - +#include +#include +#include +#include /* @@ -55,9 +59,9 @@ db_expr_t db_macro_args[DB_MACRO_LEVEL][ static struct db_user_macro * db_lookup_macro(name) - char *name; + const char *name; { - register struct db_user_macro *mp; + struct db_user_macro *mp; for (mp = db_user_macro; mp < &db_user_macro[DB_NUSER_MACRO]; mp++) { if (mp->m_name[0] == 0) @@ -69,11 +73,11 @@ db_lookup_macro(name) } void -db_def_macro_cmd() +db_def_macro_cmd(void) { - register char *p; - register c; - register struct db_user_macro *mp, *ep; + char *p; + int c; + struct db_user_macro *mp, *ep; if (db_read_token() != tIDENT) { db_printf("Bad macro name \"%s\"\n", db_tok_string); @@ -100,11 +104,11 @@ db_def_macro_cmd() } void -db_del_macro_cmd() +db_del_macro_cmd(void) { - register struct db_user_macro *mp; + struct db_user_macro *mp; - if (db_read_token() != tIDENT + if (db_read_token() != tIDENT || (mp = db_lookup_macro(db_tok_string)) == 0) { db_printf("No such macro \"%s\"\n", db_tok_string); db_error(0); @@ -116,9 +120,9 @@ db_del_macro_cmd() } void -db_show_macro() +db_show_macro(void) { - register struct db_user_macro *mp; + struct db_user_macro *mp; int t; char *name = 0; @@ -134,13 +138,13 @@ db_show_macro() db_printf("%s: %s", mp->m_name, mp->m_lbuf); } } - + int db_exec_macro(name) - char *name; + const char *name; { - register struct db_user_macro *mp; - register n; + struct db_user_macro *mp; + int n; if ((mp = db_lookup_macro(name)) == 0) return(-1); @@ -150,7 +154,7 @@ db_exec_macro(name) /* NOTREACHED */ } for (n = 0; - n < DB_NARGS && + n < DB_NARGS && db_expression(&db_macro_args[db_macro_level+1][n]); n++); while (n < DB_NARGS) @@ -161,13 +165,13 @@ db_exec_macro(name) return(0); } -int +void /* ARGSUSED */ -db_arg_variable(vp, valuep, flag, ap) - struct db_variable *vp; - db_expr_t *valuep; - int flag; - db_var_aux_param_t ap; +db_arg_variable( + struct db_variable *vp, + db_expr_t *valuep, + int flag, + db_var_aux_param_t ap) { if (ap->level != 1 || ap->suffix[0] < 1 || ap->suffix[0] > DB_NARGS) { db_error("Bad $arg variable\n"); @@ -177,7 +181,7 @@ db_arg_variable(vp, valuep, flag, ap) *valuep = db_macro_args[db_macro_level][ap->suffix[0]-1]; else db_macro_args[db_macro_level][ap->suffix[0]-1] = *valuep; - return(0); + return; } -#endif MACH_KDB +#endif /* MACH_KDB */