Re: [PATCH v4 02/22] fsck.h: use designed initializers for FSCK_OPTIONS_{DEFAULT,STRICT}

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

 



Ævar Arnfjörð Bjarmason  <avarab@xxxxxxxxx> writes:

> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx>
> ---
>  fsck.h | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/fsck.h b/fsck.h
> index 2274843ba0..40f3cb3f64 100644
> --- a/fsck.h
> +++ b/fsck.h
> @@ -43,8 +43,22 @@ struct fsck_options {
>  	kh_oid_map_t *object_names;
>  };
>  
> -#define FSCK_OPTIONS_DEFAULT { NULL, fsck_error_function, 0, NULL, OIDSET_INIT, NULL }
> -#define FSCK_OPTIONS_STRICT { NULL, fsck_error_function, 1, NULL, OIDSET_INIT, NULL }
> +#define FSCK_OPTIONS_DEFAULT { \
> +	.walk = NULL, \
> +	.error_func = fsck_error_function, \
> +	.strict = 0, \
> +	.msg_type = NULL, \
> +	.skiplist = OIDSET_INIT, \
> +	.object_names = NULL, \
> +}
> +#define FSCK_OPTIONS_STRICT { \
> +	.walk = NULL, \
> +	.error_func = fsck_error_function, \
> +	.strict = 1, \
> +	.msg_type = NULL, \
> +	.skiplist = OIDSET_INIT, \
> +	.object_names = NULL, \
> +}

Being explicit is good, but spelling out zero initialization sounds
more like cluttering than clarifying.  I do not mind .strict = 0 in
the DEFAULT one only because it contrasts well with .strict = 1 on
the STRICT side, but it would be easier to read to omit these zero
initilization of the .walk, .msg_type and .object_names members.

>  /* descend in all linked child objects
>   * the return value is:




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux