From: Paul Eggert Date: Fri, 24 Dec 2004 08:07:29 +0000 (+0000) Subject: (parser_init): Omit unnecessary alignments, and comment the alignments. X-Git-Tag: cvs-readonly~3631 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=04b3acf4692edd57417582e932d915e44ca808ae;p=gnulib.git (parser_init): Omit unnecessary alignments, and comment the alignments. --- diff --git a/lib/argp-parse.c b/lib/argp-parse.c index 509f6dea8..85e6b9033 100644 --- a/lib/argp-parse.c +++ b/lib/argp-parse.c @@ -482,12 +482,18 @@ parser_init (struct parser *parser, const struct argp *argp, /* Lengths of the various bits of storage used by PARSER. */ glen = (szs.num_groups + 1) * sizeof (struct group); - gsum = alignto (glen, alignof (void *)); clen = szs.num_child_inputs * sizeof (void *); - csum = alignto (gsum + clen, alignof (struct option)); llen = (szs.long_len + 1) * sizeof (struct option); - lsum = alignto (csum + llen, alignof (char)); slen = szs.short_len + 1; + + /* Sums of previous lengths, properly aligned. There's no need to + align gsum, since struct group is aligned at least as strictly as + void * (since it contains a void * member). And there's no need + to align lsum, since struct option is aligned at least as + strictly as char. */ + gsum = glen; + csum = alignto (gsum + clen, alignof (struct option)); + lsum = csum + llen; ssum = lsum + slen; parser->storage = malloc (ssum);