--- Gnu-Mach/ddb/db_lex.c 2020/09/02 04:36:57 1.1.1.1 +++ Gnu-Mach/ddb/db_lex.c 2020/09/02 04:45:50 1.1.1.3 @@ -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. */ @@ -27,15 +27,19 @@ * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 */ -#include "mach_kdb.h" + #if MACH_KDB /* * Lexical analyzer. */ +#include #include -#include +#include +#include +#include #include +#include char db_line[DB_LEX_LINE_SIZE]; char db_last_line[DB_LEX_LINE_SIZE]; @@ -70,7 +74,7 @@ db_read_line(repeat_last) } void -db_flush_line() +db_flush_line(void) { db_lp = db_line; db_last_lp = db_lp; @@ -111,7 +115,7 @@ db_restore_lex_context(lp) } int -db_read_char() +db_read_char(void) { int c; @@ -121,7 +125,7 @@ db_read_char() } else if (db_lp >= db_endlp) c = -1; - else + else c = *db_lp++; return (c); } @@ -141,7 +145,7 @@ db_unread_token(t) } int -db_read_token() +db_read_token(void) { int t; @@ -163,7 +167,7 @@ char db_tok_string[TOK_STRING_SIZE]; db_expr_t db_radix = 16; void -db_flush_lex() +db_flush_lex(void) { db_flush_line(); db_look_char = 0; @@ -173,11 +177,11 @@ db_flush_lex() #define DB_DISP_SKIP 40 /* number of chars to display skip */ void -db_skip_to_eol() +db_skip_to_eol(void) { - register skip; - register t; - register n; + register int skip; + register int t; + register int n; register char *p; t = db_read_token(); @@ -199,10 +203,10 @@ db_skip_to_eol() } int -db_lex() +db_lex(void) { register char *cp; - register c; + register int c; c = db_read_char(); while (c <= ' ' || c > '~') { @@ -260,7 +264,7 @@ db_lex() (c >= 'a' && c <= 'z') || (c == '_')) { - db_printf("Bad character '%c' after number %s\n", + db_printf("Bad character '%c' after number %s\n", c, db_tok_string); db_error(0); db_flush_lex(); @@ -452,4 +456,4 @@ db_lex() return (tEOF); } -#endif MACH_KDB +#endif /* MACH_KDB */