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

Eric Blake eblake at redhat.com
Mon Sep 17 21:11:29 UTC 2012


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 at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120917/71b4102c/attachment-0001.sig>


More information about the libvir-list mailing list