db_error() does not return.

This commit is contained in:
mycroft 1994-10-09 08:56:23 +00:00
parent 72fa9c8429
commit 4f0f8fdfc4
5 changed files with 26 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: db_input.c,v 1.4 1994/06/29 06:31:08 cgd Exp $ */
/* $NetBSD: db_input.c,v 1.5 1994/10/09 08:56:23 mycroft Exp $ */
/*
* Mach Operating System
@ -227,8 +227,10 @@ db_check_interrupt()
case CTRL('s'):
do {
c = cnmaygetc();
if (c == CTRL('c'))
if (c == CTRL('c')) {
db_error((char *)0);
/*NOTREACHED*/
}
} while (c != CTRL('q'));
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: db_lex.c,v 1.6 1994/10/09 08:30:03 mycroft Exp $ */
/* $NetBSD: db_lex.c,v 1.7 1994/10/09 08:56:25 mycroft Exp $ */
/*
* Mach Operating System
@ -171,8 +171,7 @@ db_lex()
(c == '_'))
{
db_error("Bad character in number\n");
db_flush_lex();
return (tEOF);
/*NOTREACHED*/
}
db_unread_char(c);
return (tNUMBER);
@ -187,8 +186,10 @@ db_lex()
cp = db_tok_string;
if (c == '\\') {
c = db_read_char();
if (c == '\n' || c == -1)
if (c == '\n' || c == -1) {
db_error("Bad escape\n");
/*NOTREACHED*/
}
}
*cp++ = c;
while (1) {
@ -200,14 +201,15 @@ db_lex()
{
if (c == '\\') {
c = db_read_char();
if (c == '\n' || c == -1)
if (c == '\n' || c == -1) {
db_error("Bad escape\n");
/*NOTREACHED*/
}
}
*cp++ = c;
if (cp == db_tok_string+sizeof(db_tok_string)) {
db_error("String too long\n");
db_flush_lex();
return (tEOF);
/*NOTREACHED*/
}
continue;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: db_sym.c,v 1.7 1994/06/29 06:31:18 cgd Exp $ */
/* $NetBSD: db_sym.c,v 1.8 1994/10/09 08:56:27 mycroft Exp $ */
/*
* Mach Operating System
@ -199,6 +199,7 @@ db_lookup(symstr)
*cp = ':';
if (i == MAXNOSYMTABS) {
db_error("invalid symbol table name");
/*NOTREACHED*/
}
symstr = cp+1;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: db_variables.c,v 1.6 1994/06/29 06:31:23 cgd Exp $ */
/* $NetBSD: db_variables.c,v 1.7 1994/10/09 08:56:28 mycroft Exp $ */
/*
* Mach Operating System
@ -73,7 +73,7 @@ db_find_variable(varp)
}
}
db_error("Unknown variable\n");
return (0);
/*NOTREACHED*/
}
int
@ -140,11 +140,11 @@ db_set_cmd()
t = db_read_token();
if (t != tDOLLAR) {
db_error("Unknown variable\n");
return;
/*NOTREACHED*/
}
if (!db_find_variable(&vp)) {
db_error("Unknown variable\n");
return;
/*NOTREACHED*/
}
t = db_read_token();
@ -153,10 +153,11 @@ db_set_cmd()
if (!db_expression(&value)) {
db_error("No value\n");
return;
/*NOTREACHED*/
}
if (db_read_token() != tEOL) {
db_error("?\n");
/*NOTREACHED*/
}
db_write_variable(vp, &value);

View File

@ -1,4 +1,4 @@
/* $NetBSD: db_write_cmd.c,v 1.4 1994/06/29 06:31:28 cgd Exp $ */
/* $NetBSD: db_write_cmd.c,v 1.5 1994/10/09 08:56:30 mycroft Exp $ */
/*
* Mach Operating System
@ -73,7 +73,7 @@ db_write_cmd(address, have_addr, count, modif)
break;
default:
db_error("Unknown size\n");
return;
/*NOTREACHED*/
}
while (db_expression(&new_value)) {
@ -86,8 +86,10 @@ db_write_cmd(address, have_addr, count, modif)
wrote_one = TRUE;
}
if (!wrote_one)
if (!wrote_one) {
db_error("Nothing written.\n");
/*NOTREACHED*/
}
db_next = addr;
db_prev = addr - size;