[libvirt] [PATCH] maint: avoid excess parens in STREQ

Jim Meyering jim at meyering.net
Mon Feb 1 16:25:35 UTC 2010


Daniel Veillard wrote:

> On Mon, Feb 01, 2010 at 05:06:43PM +0100, Jim Meyering wrote:
>> Eric Blake wrote:
>>
>> > According to Eric Blake on 1/27/2010 6:59 AM:
>> >> * src/internal.h (STREQ, STRCASEEQ, STRNEQ, STRCASENEQ, STREQLEN)
>> >> (STRCASEEQLEN, STRNEQLEN, STRCASENEQLEN, STRPREFIX): Avoid
>> >> redundant parenthesis.
>> >> * examples/domain-events/events-c/event-test.c (STREQ): Likewise.
>> >> * src/storage/parthelper.c (STREQ): Likewise.
>> >> ---
>> >> These macros were originally inspired by Jim Meyering, who has since made
>> >> this same cleanup elsewhere.  For example:
>> >> http://lists.gnu.org/archive/html/bug-gnulib/2010-01/msg00293.html
>> >>
>> > ...
>> >> -#define STREQ(a,b) (strcmp((a),(b)) == 0)
>> >> +#define STREQ(a,b) (strcmp(a,b) == 0)
>> >
>> > Ping.
>> >
>> > By the way, should the web pages mention that libvirt-list is an alias for
>> > libvir-list for symmetry reasons, particularly now that we have the
>> > libvirt-user list?
>>
>> Thanks!
>> You know I agree ;-)
>> No one has objected, so I'll push that shortly.
>
>   okay, I though the extra () were just a safety belt in case of
> operator overload use in the caller which might change the emantic of
> the macro. Anyway in those case it looks safe to remove them, but I
> doubt it change anything in practice, right ?

Right.  This is a "no-semantic-change" change.




More information about the libvir-list mailing list