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

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

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]