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 [email protected] +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
-- libvir-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/libvir-list
