summaryrefslogtreecommitdiff
path: root/sys/ddb/db_write_cmd.c
diff options
context:
space:
mode:
authorsimonb <simonb@NetBSD.org>2002-02-15 07:33:48 +0000
committersimonb <simonb@NetBSD.org>2002-02-15 07:33:48 +0000
commit4eaa4d66a825d3a320df04057b60d4290e726694 (patch)
tree96f4dad8e24388f1ea53a2747c08be1fb1273654 /sys/ddb/db_write_cmd.c
parent4a188395df8e1fe5f0ef08aa49fa7de4a1b6119b (diff)
ANSIfy, KNF.
Make some variables and functions static when not used outside of a module. Make variables in headers extern. Delete the unused db_find_watchpoint() function.
Diffstat (limited to 'sys/ddb/db_write_cmd.c')
-rw-r--r--sys/ddb/db_write_cmd.c52
1 files changed, 24 insertions, 28 deletions
diff --git a/sys/ddb/db_write_cmd.c b/sys/ddb/db_write_cmd.c
index 4e5402b3288..f2d671ffa66 100644
--- a/sys/ddb/db_write_cmd.c
+++ b/sys/ddb/db_write_cmd.c
@@ -1,27 +1,27 @@
-/* $NetBSD: db_write_cmd.c,v 1.15 2001/11/12 22:54:07 lukem Exp $ */
+/* $NetBSD: db_write_cmd.c,v 1.16 2002/02/15 07:33:54 simonb Exp $ */
-/*
+/*
* 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 the
* rights to redistribute these changes.
*
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_write_cmd.c,v 1.15 2001/11/12 22:54:07 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_write_cmd.c,v 1.16 2002/02/15 07:33:54 simonb Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@@ -49,11 +49,8 @@ __KERNEL_RCSID(0, "$NetBSD: db_write_cmd.c,v 1.15 2001/11/12 22:54:07 lukem Exp
*/
/*ARGSUSED*/
void
-db_write_cmd(address, have_addr, count, modif)
- db_expr_t address;
- boolean_t have_addr;
- db_expr_t count;
- char * modif;
+db_write_cmd(db_expr_t address, boolean_t have_addr, db_expr_t count,
+ char *modif)
{
db_addr_t addr;
db_expr_t old_value;
@@ -64,36 +61,36 @@ db_write_cmd(address, have_addr, count, modif)
addr = (db_addr_t) address;
switch (modif[0]) {
- case 'b':
+ case 'b':
size = 1;
break;
- case 'h':
+ case 'h':
size = 2;
break;
- case 'l':
- case '\0':
+ case 'l':
+ case '\0':
size = 4;
break;
- default:
+ default:
size = -1;
db_error("Unknown size\n");
/*NOTREACHED*/
}
while (db_expression(&new_value)) {
- old_value = db_get_value(addr, size, FALSE);
- db_printsym(addr, DB_STGY_ANY, db_printf);
- db_printf("\t\t%s = ", db_num_to_str(old_value));
- db_printf("%s\n", db_num_to_str(new_value));
- db_put_value(addr, size, new_value);
- addr += size;
+ old_value = db_get_value(addr, size, FALSE);
+ db_printsym(addr, DB_STGY_ANY, db_printf);
+ db_printf("\t\t%s = ", db_num_to_str(old_value));
+ db_printf("%s\n", db_num_to_str(new_value));
+ db_put_value(addr, size, new_value);
+ addr += size;
- wrote_one = TRUE;
+ wrote_one = TRUE;
}
if (!wrote_one) {
- db_error("Nothing written.\n");
- /*NOTREACHED*/
+ db_error("Nothing written.\n");
+ /*NOTREACHED*/
}
db_next = addr;
@@ -101,4 +98,3 @@ db_write_cmd(address, have_addr, count, modif)
db_skip_to_eol();
}
-