X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fargp-parse.c;h=b5d209665bf400435b1359c24ad44a90130d53e4;hb=fc86a0be1b68e4b24d9249d763d33701b3a81623;hp=509f6dea8522303f778f8f524a62dbe7bdad31cb;hpb=3d140c4471e983a16c5836de180ddf11a12eaa39;p=gnulib.git diff --git a/lib/argp-parse.c b/lib/argp-parse.c index 509f6dea8..b5d209665 100644 --- a/lib/argp-parse.c +++ b/lib/argp-parse.c @@ -15,10 +15,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H -#include +# include #endif #include @@ -38,7 +38,7 @@ #else # include "gettext.h" #endif -#define N_(msgid) (msgid) +#define N_(msgid) msgid #include "argp.h" #include "argp-namefrob.h" @@ -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);