[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 07/28] ddb/db_aout.c (aout_db_sym_init): remove unnecessary v
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 07/28] ddb/db_aout.c (aout_db_sym_init): remove unnecessary variable |
Date: |
Mon, 9 Dec 2013 00:47:14 +0900 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Marin Ramesa, le Sun 08 Dec 2013 12:40:09 +0100, a écrit :
> Member n_strx can be used instead of strx.
But that's less readable. A variable here is really not a problem, the
compiler will most probably put it in a register anyway.
> * ddb/db_aout.c (aout_db_sym_init): Remove unnecessary variable.
>
> ---
> ddb/db_aout.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/ddb/db_aout.c b/ddb/db_aout.c
> index 9e1c3d4..5cb3911 100644
> --- a/ddb/db_aout.c
> +++ b/ddb/db_aout.c
> @@ -101,15 +101,13 @@ aout_db_sym_init(symtab, esymtab, name, task_addr)
> #undef round_to_size
>
> for (sp = sym_start; sp < sym_end; sp++) {
> - long strx;
> - strx = sp->n_un.n_strx;
> - if (strx != 0) {
> - if (strx > strlen) {
> - db_printf("Bad string table index (%#x)\n", strx);
> + if (sp->n_un.n_strx != 0) {
> + if (sp->n_un.n_strx > strlen) {
> + db_printf("Bad string table index (%#x)\n",
> sp->n_un.n_strx);
> sp->n_un.n_name = 0;
> continue;
> }
> - sp->n_un.n_name = strtab + strx;
> + sp->n_un.n_name = strtab + sp->n_un.n_strx;
> }
> }
>
> --
> 1.8.1.4
>
>
--
Samuel
<s> je la connaissais pas celle la : "make: Entering an unknown directory"
-+- #ens-mim -+-
- [PATCH 02/28] chips/busses.c: comment out dead code, (continued)
[PATCH 05/28] i386/i386/db_interface.c: remove forward declaration, Marin Ramesa, 2013/12/08
[PATCH 07/28] ddb/db_aout.c (aout_db_sym_init): remove unnecessary variable, Marin Ramesa, 2013/12/08
- Re: [PATCH 07/28] ddb/db_aout.c (aout_db_sym_init): remove unnecessary variable,
Samuel Thibault <=
[PATCH 08/28] ddb/db_aout.c (aout_db_eq_name): remove unnecessary variable, Marin Ramesa, 2013/12/08
[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