Mercurial > hg > octave-lyh > gnulib-hg
changeset 5555:12b1a84e1247
(parser_init): Omit unnecessary alignments, and comment the alignments.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Fri, 24 Dec 2004 08:07:29 +0000 |
parents | 8ad9fa45dcee |
children | c2d95ab34ea3 |
files | lib/argp-parse.c |
diffstat | 1 files changed, 10 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/argp-parse.c +++ b/lib/argp-parse.c @@ -482,12 +482,18 @@ /* 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 *); + llen = (szs.long_len + 1) * sizeof (struct option); + 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)); - llen = (szs.long_len + 1) * sizeof (struct option); - lsum = alignto (csum + llen, alignof (char)); - slen = szs.short_len + 1; + lsum = csum + llen; ssum = lsum + slen; parser->storage = malloc (ssum);