[libvirt] [PATCH] build: Fix build failure on mingw32 platform

Osier Yang jyang at redhat.com
Tue Sep 18 01:43:00 UTC 2012


On 2012年09月18日 05:11, Eric Blake wrote:
> On 09/17/2012 08:11 AM, Osier Yang wrote:
>> ---
>> I'm not sure if we prefer indentions inside the block between
>> "#ifdef __linux__" ... "#else" clause. nodeinfo.c uses both
>> (indentions/no indentions).
>
> Adding {} is pointless, unless you are trying to shut up a compiler
> warning about 'goto' crossing a scope.  We are requiring C99, which
> allows declarations after statements.
>
>
>> +++ b/src/nodeinfo.c
>> @@ -971,13 +971,14 @@ cleanup:
>>
>>   int
>>   nodeSetMemoryParameters(virConnectPtr conn ATTRIBUTE_UNUSED,
>> -                        virTypedParameterPtr params,
>> -                        int nparams,
>> +                        virTypedParameterPtr params ATTRIBUTE_UNUSED,
>> +                        int nparams ATTRIBUTE_UNUSED,
>>                           unsigned int flags)
>
> ACK to this part.
>
>>   {
>>       virCheckFlags(0, -1);
>>
>>   #ifdef __linux__
>> +    {
>>       int ret = 0;
>>       int i;
>>
>> @@ -1010,6 +1011,7 @@ nodeSetMemoryParameters(virConnectPtr conn ATTRIBUTE_UNUSED,
>>       }
>>
>>       return ret;
>> +    }
>>   #else
>
> NACK to this part, the {} add nothing, and look stupid unless you
> reindent and make the patch twice as large.
>
>
>>   nodeGetMemoryParameters(virConnectPtr conn ATTRIBUTE_UNUSED,
>> -                        virTypedParameterPtr params,
>> -                        int *nparams,
>> +                        virTypedParameterPtr params ATTRIBUTE_UNUSED,
>> +                        int *nparams ATTRIBUTE_UNUSED,
>>                           unsigned int flags)
>
> ACK to this part.
>
>>   {
>>       virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1);
>>
>>   #ifdef __linux__
>> +    {
>>       unsigned int pages_to_scan;
>>       unsigned int sleep_millisecs;
>>       unsigned long long pages_shared;
>> @@ -1174,6 +1177,7 @@ nodeGetMemoryParameters(virConnectPtr conn ATTRIBUTE_UNUSED,
>>       }
>>
>>       return 0;
>> +    }
>
> NACK to this part.
>

Pushed without {} addition.




More information about the libvir-list mailing list