[syslinux] [PATCH 03/23] com32/chain: use anonymous and unnamed aggregates

Shao Miller sha0.miller at gmail.com
Wed Nov 7 17:44:08 PST 2012


On 11/5/2012 19:32, Michal Soltys wrote:
> Signed-off-by: Michal Soltys <soltys at ziu.info>
> ---
>   com32/chain/chain.c    |   12 +++----
>   com32/chain/mangle.c   |   12 +++----
>   com32/chain/partiter.c |   84 ++++++++++++++++++++++++------------------------
>   com32/chain/partiter.h |    8 ++---
>   4 files changed, 58 insertions(+), 58 deletions(-)
>
> diff --git a/com32/chain/partiter.h b/com32/chain/partiter.h
> index e03fbbc..bce7814 100644
> --- a/com32/chain/partiter.h
> +++ b/com32/chain/partiter.h
> @@ -69,8 +69,8 @@ struct part_iter {
>       int status;
>       /* internal */
>       int index0;
> -    union _sub {
> -	struct _dos {
> +    union {
> +	struct {
>   	    uint32_t disk_sig;
>   	    uint32_t nebr_lba;
>   	    uint32_t cebr_lba;
> @@ -82,7 +82,7 @@ struct part_iter {
>   	    int bebr_index0;
>   	    int skipcnt;
>   	} dos;
> -	struct _gpt {
> +	struct {
>   	    struct guid disk_guid;
>   	    struct guid part_guid;
>   	    char part_label[PI_GPTLABSIZE/2+1];
> @@ -91,7 +91,7 @@ struct part_iter {
>   	    uint64_t ufirst;
>   	    uint64_t ulast;
>   	} gpt;
> -    } sub;
> +    };
>   };
>
>   extern const struct itertype * const typedos;
>

Personally, I'd rather not, but anonymous members of this sort are in 
C11...  At least it removes the reserved identifier usage. :)

Did you spot anonymous members being used elsewhere in the code-base, or 
will this be the first such usage that you're aware of?

- Shao Miller



More information about the Syslinux mailing list