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

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

 



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.

-- 
Eric Blake   eblake@xxxxxxxxxx    +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]