--- Gnu-Mach/ddb/db_variables.c 2020/09/02 04:36:57 1.1.1.1 +++ Gnu-Mach/ddb/db_variables.c 2020/09/02 04:48:17 1.1.1.4 @@ -1,25 +1,25 @@ -/* +/* * 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. */ @@ -28,14 +28,18 @@ * Date: 7/90 */ -#include "mach_kdb.h" #if MACH_KDB #include +#include +#include +#include #include +#include #include #include +#include extern unsigned long db_maxoff; @@ -43,9 +47,6 @@ extern db_expr_t db_radix; extern db_expr_t db_max_width; extern db_expr_t db_tab_stop_width; extern db_expr_t db_max_line; -extern int db_set_default_thread(); -extern int db_get_task_thread(); -extern int db_arg_variable(); #define DB_NWORK 32 /* number of work variable */ @@ -67,12 +68,12 @@ struct db_variable db_vars[] = { }; struct db_variable *db_evars = db_vars + sizeof(db_vars)/sizeof(db_vars[0]); -char * +const char * db_get_suffix(suffix, suffix_value) - register char *suffix; + const char *suffix; short *suffix_value; { - register value; + int value; for (value = 0; *suffix && *suffix != '.' && *suffix != ':'; suffix++) { if (*suffix < '0' || *suffix > '9') @@ -84,16 +85,17 @@ db_get_suffix(suffix, suffix_value) suffix++; return(suffix); } - + static boolean_t db_cmp_variable_name(vp, name, ap) struct db_variable *vp; char *name; - register db_var_aux_param_t ap; + const db_var_aux_param_t ap; { - register char *var_np, *np; - register level; - + char *var_np; + const char *np; + int level; + for (np = name, var_np = vp->name; *var_np; ) { if (*np++ != *var_np++) return(FALSE); @@ -103,7 +105,7 @@ db_cmp_variable_name(vp, name, ap) return(FALSE); } if ((*np && *np != ':') || level < vp->min_level - || (level > 0 && (ap->suffix[0] < vp->low + || (level > 0 && (ap->suffix[0] < vp->low || (vp->high >= 0 && ap->suffix[0] > vp->high)))) return(FALSE); db_strcpy(ap->modif, (*np)? np+1: ""); @@ -113,9 +115,9 @@ db_cmp_variable_name(vp, name, ap) } int -db_find_variable(varp, ap) - struct db_variable **varp; - db_var_aux_param_t ap; +db_find_variable( + struct db_variable **varp, + db_var_aux_param_t ap) { int t; struct db_variable *vp; @@ -140,12 +142,8 @@ db_find_variable(varp, ap) return (0); } - -void db_read_write_variable(); /* forward */ - int -db_get_variable(valuep) - db_expr_t *valuep; +db_get_variable(db_expr_t *valuep) { struct db_variable *vp; struct db_var_aux_param aux_param; @@ -161,8 +159,7 @@ db_get_variable(valuep) } int -db_set_variable(value) - db_expr_t value; +db_set_variable(db_expr_t value) { struct db_variable *vp; struct db_var_aux_param aux_param; @@ -178,13 +175,13 @@ db_set_variable(value) } void -db_read_write_variable(vp, valuep, rw_flag, ap) - struct db_variable *vp; - db_expr_t *valuep; - int rw_flag; - db_var_aux_param_t ap; +db_read_write_variable( + struct db_variable *vp, + db_expr_t *valuep, + int rw_flag, + db_var_aux_param_t ap) { - int (*func)() = vp->fcn; + void (*func)() = vp->fcn; struct db_var_aux_param aux_param; if (ap == 0) { @@ -203,7 +200,7 @@ db_read_write_variable(vp, valuep, rw_fl } void -db_set_cmd() +db_set_cmd(void) { db_expr_t value; int t; @@ -238,4 +235,4 @@ db_set_cmd() db_read_write_variable(vp, &value, DB_VAR_SET, &aux_param); } -#endif MACH_KDB +#endif /* MACH_KDB */