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