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

Re: [libvirt] [PATCH 03/24] tests: hostdev: Declare count inside CHECK_LIST_COUNT()



On Mon, 2016-03-07 at 13:18 -0500, Laine Stump wrote:
> > +# define CHECK_LIST_COUNT(list, cnt)                                        \
> > +    do {                                                                    \
> > +        int count;                                                          \
> > +        if ((count = virPCIDeviceListCount(list)) != cnt) {                 \
> > +            virReportError(VIR_ERR_INTERNAL_ERROR,                          \
> > +                           "Unexpected count of items in " #list ": %d, "   \
> > +                           "expecting %zu", count, (size_t) cnt);           \
> > +            goto cleanup;                                                   \
> > +        }                                                                   \
> > +    } while (0)
> 
> The only suggestion I would have is to make "count" something less 
> common, so that you're less likely to end up causing a compiler warning 
> later if someone adds a variable called "count" to a function that uses 
> this macro.
> 
> Otherwise ACK.

I changed it to 'actualCount' before pushing, and explained the
reason for the change in the commit message.

Cheers.

-- 
Andrea Bolognani
Software Engineer - Virtualization Team


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