Re: [PATCH v2 2/4] virnetdev: Introduce virNetDevGetLinkInfo

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

 



On 06/11/2014 03:19 AM, Michal Privoznik wrote:

>>> +{
>>> +    int ret = -1;
>>> +    char *path = NULL;
>>> +    char *buf = NULL;
>>> +    char *tmp;
>>> +    int tmp_state;
>>
>> s/int/virInterfaceState/
>>
> 
> In fact this is intentional. Remember Eric's TypeFromString() patches?
> The problem is, one can't be sure if compiler decides on using unsigned
> or signed integer to represent an enum. If it decides to use an unsigned
> int (IIRC that's the case of older gcc) then comparison a few lines
> below will never be true.

But at the least, you can do:

    int tmp_state /* virInterfaceState */

to make it easier for later readers to know valid values to store in the
int.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]