[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/5] ddb/db_sym.c: move assignment outside if
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 2/5] ddb/db_sym.c: move assignment outside if |
Date: |
Sun, 24 Nov 2013 23:00:10 +0100 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Ivan Shmakov, le Sat 23 Nov 2013 09:26:08 +0000, a écrit :
> >>>>> Guillem Jover <guillem@hadrons.org> writes:
> >>>>> On Thu, 2013-11-21 at 13:11:05 +0100, Marin Ramesa wrote:
>
> […]
>
> >> db_sym_t sp;
> >> - if (sp = X_db_lookup(&db_symtabs[i], sym_name)) {
> >> + boolean_t db_lookup;
> >> + db_lookup = (int)(sp = X_db_lookup(&db_symtabs[i], sym_name));
> >> + if (db_lookup) {
> >> if (found_once)
>
> […]
>
> > Regarding readability, this does not seem to me like a big
> > improvement (bar the squashed warning :). Why not assign sp on its
> > own? And does the db_sym_t type require a cast for the conditional?
>
> I’d rather question the necessity of adding a new variable just
> to hold the “boolean.” Why not simply:
That's what Guillem was referring to, yes.
Samuel
[PATCH 3/5] i386/i386at/kd.h: fix implicit declaration of function, Marin Ramesa, 2013/11/21
[PATCH 4/5] i386/i386/db_interface.h: fix implicit declaration of function, Marin Ramesa, 2013/11/21
[PATCH 5/5] i386/i386/db_trace.c: make function void, Marin Ramesa, 2013/11/21
- Re: [PATCH 5/5] i386/i386/db_trace.c: make function void, Samuel Thibault, 2013/11/21
- Re: [PATCH 5/5] i386/i386/db_trace.c: make function void, Marin Ramesa, 2013/11/21
- Re: [PATCH 5/5] i386/i386/db_trace.c: make function void, Samuel Thibault, 2013/11/21
- Re: [PATCH 5/5] i386/i386/db_trace.c: make function void, Marin Ramesa, 2013/11/21
- Re: [PATCH 5/5] i386/i386/db_trace.c: make function void, Samuel Thibault, 2013/11/21
- Re: [PATCH 5/5] i386/i386/db_trace.c: make function void, Marin Ramesa, 2013/11/21
- Re: [PATCH 5/5] i386/i386/db_trace.c: make function void, Samuel Thibault, 2013/11/21