[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 16/28] ddb/db_command.c (db_command): use db_addr_t instead of db
From: |
Marin Ramesa |
Subject: |
[PATCH 16/28] ddb/db_command.c (db_command): use db_addr_t instead of db_expr_t |
Date: |
Sun, 8 Dec 2013 12:40:18 +0100 |
In this way there are two casts less.
* ddb/db_command.c (addr): Use db_addr_t as the type.
(addr): Don't cast to db_expr_t.
(db_expression) (addr): Cast to a pointer to db_expr_t.
---
ddb/db_command.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/ddb/db_command.c b/ddb/db_command.c
index e8792d0..cb3e4d7 100644
--- a/ddb/db_command.c
+++ b/ddb/db_command.c
@@ -160,7 +160,8 @@ db_command(last_cmdp, cmd_table)
struct db_command *cmd;
int t;
char modif[TOK_STRING_SIZE];
- db_expr_t addr, count;
+ db_expr_t count;
+ db_addr_t addr;
boolean_t have_addr = FALSE;
int result;
@@ -168,7 +169,7 @@ db_command(last_cmdp, cmd_table)
if (t == tEOL || t == tSEMI_COLON) {
/* empty line repeats last command, at 'next' */
cmd = *last_cmdp;
- addr = (db_expr_t)db_next;
+ addr = db_next;
have_addr = FALSE;
count = 1;
modif[0] = '\0';
@@ -241,13 +242,13 @@ db_command(last_cmdp, cmd_table)
modif[0] = '\0';
}
- if (db_expression(&addr)) {
- db_dot = (db_addr_t) addr;
+ if (db_expression((db_expr_t *)&addr)) {
+ db_dot = addr;
db_last_addr = db_dot;
have_addr = TRUE;
}
else {
- addr = (db_expr_t) db_dot;
+ addr = db_dot;
have_addr = FALSE;
}
t = db_read_token();
--
1.8.1.4
- Re: [PATCH 08/28] ddb/db_aout.c (aout_db_eq_name): remove unnecessary variable, (continued)
- [PATCH 09/28] ddb/db_aout.c (aout_db_is_filename): remove unnecessary check, Marin Ramesa, 2013/12/08
- [PATCH 10/28] ddb/db_aout.c (aout_db_qualified_search): use DB_SYM_NULL as return value, Marin Ramesa, 2013/12/08
- [PATCH 11/28] ddb/db_aout.c (aout_db_lookup): remove forward declaration, Marin Ramesa, 2013/12/08
- [PATCH 12/28] ddb/db_break.c (db_add_thread_breakpoint): fix argument list, Marin Ramesa, 2013/12/08
- [PATCH 13/28] ddb/db_break.c (db_find_thread_breakpoint_here): remove unnecessary cast, Marin Ramesa, 2013/12/08
- [PATCH 14/28] i386/i386at/kd.c: use io_req instead of uio, Marin Ramesa, 2013/12/08
- [PATCH 15/28] ddb/db_command.c: use boolean values, Marin Ramesa, 2013/12/08
- [PATCH 16/28] ddb/db_command.c (db_command): use db_addr_t instead of db_expr_t,
Marin Ramesa <=
- [PATCH 17/28] ddb/db_command.c (db_command): remove forward declaration, Marin Ramesa, 2013/12/08
- [PATCH 18/28] ddb/db_command.c (db_command_list): remove forward declaration, Marin Ramesa, 2013/12/08
- [PATCH 19/28] ddb/db_examine.c (db_examine_cmd): remove forward declaration, Marin Ramesa, 2013/12/08
- [PATCH 20/28] ddb/db_examine.c: trivial stylistic fix for consistency, Marin Ramesa, 2013/12/08
- [PATCH 21/28] ddb/db_expr.c (db_mult_expr): remove unnecessary variable, Marin Ramesa, 2013/12/08
- [PATCH 22/28] ddb/db_expr.c (db_add_expr): remove unnecessary variable, Marin Ramesa, 2013/12/08
- [PATCH 23/28] ddb/db_mp.c: use boolean instead of an int, Marin Ramesa, 2013/12/08