bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 10/19] ddb/db_sym.c: add parentheses around assignment used a


From: Samuel Thibault
Subject: Re: [PATCH 10/19] ddb/db_sym.c: add parentheses around assignment used as truth value
Date: Wed, 20 Nov 2013 21:49:44 +0100
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Guillem Jover, le Wed 20 Nov 2013 21:20:25 +0100, a écrit :
> On Wed, 2013-11-20 at 13:53:52 +0100, Marin Ramesa wrote:
> > diff --git a/ddb/db_sym.c b/ddb/db_sym.c
> > index 98f265e..dad0ead 100644
> > --- a/ddb/db_sym.c
> > +++ b/ddb/db_sym.c
> > @@ -276,7 +276,7 @@ db_name_is_ambiguous(sym_name)
> >  
> >     for (i = 0; i < db_nsymtab; i++) {
> >             db_sym_t sp;
> > -           if (sp = X_db_lookup(&db_symtabs[i], sym_name)) {
> > +           if ((sp = X_db_lookup(&db_symtabs[i], sym_name))) {
> >                     if (found_once)
> >                     {
> >                             db_free_symbol(sp);
> 
> You could also move the assignment outside of the if condition.

Yes, this is much more preferrable, because it properly shows that an
assignment takes place.

Samuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]