* gettext-tools/src/format-awk.c (struct spec): Remove 'allocated' field.
(format_parse): Use a local variable instead.
* gettext-tools/src/format-boost.c: Likewise.
* gettext-tools/src/format-elisp.c: Likewise.
* gettext-tools/src/format-gcc-internal.c: Likewise.
* gettext-tools/src/format-java-printf.c: Likewise.
* gettext-tools/src/format-javascript.c: Likewise.
* gettext-tools/src/format-kde.c: Likewise.
* gettext-tools/src/format-librep.c: Likewise.
* gettext-tools/src/format-lua.c: Likewise.
* gettext-tools/src/format-perl-brace.c: Likewise.
* gettext-tools/src/format-python.c: Likewise.
* gettext-tools/src/format-sh.c: Likewise.
* gettext-tools/src/format-tcl.c: Likewise.
* gettext-tools/src/format-c-parse.h (struct spec): Remove 'allocated' field.
(format_parse_entrails): Use a local variable instead.
* gettext-tools/src/format-pascal.c (struct spec): Remove 'allocated' field.
(format_parse): Rename a local variable.
* gettext-tools/src/format-perl.c: Likewise.
* gettext-tools/src/format-php.c: Likewise.
* gettext-tools/src/format-gfc-internal.c (format_parse): Rename a local
variable.
/* awk format strings.
- Copyright (C) 2001-2004, 2006-2007, 2009, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2007, 2009, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2002.
This program is free software: you can redistribute it and/or modify
{
unsigned int directives;
unsigned int numbered_arg_count;
- unsigned int allocated;
struct numbered_arg *numbered;
};
{
const char *const format_start = format;
struct spec spec;
+ unsigned int numbered_allocated;
unsigned int unnumbered_arg_count;
struct spec *result;
spec.directives = 0;
spec.numbered_arg_count = 0;
- spec.allocated = 0;
spec.numbered = NULL;
+ numbered_allocated = 0;
unnumbered_arg_count = 0;
for (; *format != '\0';)
goto bad_format;
}
- if (spec.allocated == spec.numbered_arg_count)
+ if (numbered_allocated == spec.numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[spec.numbered_arg_count].number = width_number;
spec.numbered[spec.numbered_arg_count].type = FAT_INTEGER;
goto bad_format;
}
- if (spec.allocated == unnumbered_arg_count)
+ if (numbered_allocated == unnumbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[unnumbered_arg_count].number = unnumbered_arg_count + 1;
spec.numbered[unnumbered_arg_count].type = FAT_INTEGER;
goto bad_format;
}
- if (spec.allocated == spec.numbered_arg_count)
+ if (numbered_allocated == spec.numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[spec.numbered_arg_count].number = precision_number;
spec.numbered[spec.numbered_arg_count].type = FAT_INTEGER;
goto bad_format;
}
- if (spec.allocated == unnumbered_arg_count)
+ if (numbered_allocated == unnumbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[unnumbered_arg_count].number = unnumbered_arg_count + 1;
spec.numbered[unnumbered_arg_count].type = FAT_INTEGER;
goto bad_format;
}
- if (spec.allocated == spec.numbered_arg_count)
+ if (numbered_allocated == spec.numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[spec.numbered_arg_count].number = number;
spec.numbered[spec.numbered_arg_count].type = type;
goto bad_format;
}
- if (spec.allocated == unnumbered_arg_count)
+ if (numbered_allocated == unnumbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[unnumbered_arg_count].number = unnumbered_arg_count + 1;
spec.numbered[unnumbered_arg_count].type = type;
/* Boost format strings.
- Copyright (C) 2001-2004, 2006-2007, 2009, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2007, 2009, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2006.
This program is free software: you can redistribute it and/or modify
{
unsigned int directives;
unsigned int numbered_arg_count;
- unsigned int allocated;
struct numbered_arg *numbered;
};
{
const char *const format_start = format;
struct spec spec;
+ unsigned int numbered_allocated;
unsigned int unnumbered_arg_count;
struct spec *result;
spec.directives = 0;
spec.numbered_arg_count = 0;
- spec.allocated = 0;
spec.numbered = NULL;
+ numbered_allocated = 0;
unnumbered_arg_count = 0;
for (; *format != '\0';)
goto bad_format;
}
- if (spec.allocated == spec.numbered_arg_count)
+ if (numbered_allocated == spec.numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[spec.numbered_arg_count].number = width_number;
spec.numbered[spec.numbered_arg_count].type = FAT_INTEGER;
goto bad_format;
}
- if (spec.allocated == unnumbered_arg_count)
+ if (numbered_allocated == unnumbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[unnumbered_arg_count].number = unnumbered_arg_count + 1;
spec.numbered[unnumbered_arg_count].type = FAT_INTEGER;
goto bad_format;
}
- if (spec.allocated == spec.numbered_arg_count)
+ if (numbered_allocated == spec.numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[spec.numbered_arg_count].number = precision_number;
spec.numbered[spec.numbered_arg_count].type = FAT_INTEGER;
goto bad_format;
}
- if (spec.allocated == unnumbered_arg_count)
+ if (numbered_allocated == unnumbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[unnumbered_arg_count].number = unnumbered_arg_count + 1;
spec.numbered[unnumbered_arg_count].type = FAT_INTEGER;
goto bad_format;
}
- if (spec.allocated == spec.numbered_arg_count)
+ if (numbered_allocated == spec.numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[spec.numbered_arg_count].number = number;
spec.numbered[spec.numbered_arg_count].type = type;
goto bad_format;
}
- if (spec.allocated == unnumbered_arg_count)
+ if (numbered_allocated == unnumbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[unnumbered_arg_count].number = unnumbered_arg_count + 1;
spec.numbered[unnumbered_arg_count].type = type;
/* Parsing C format strings.
- Copyright (C) 2001-2004, 2006-2007, 2009-2010, 2018 Free Software
+ Copyright (C) 2001-2004, 2006-2007, 2009-2010, 2018, 2020 Free Software
Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
{
unsigned int directives;
unsigned int unnumbered_arg_count;
- unsigned int allocated;
struct unnumbered_arg *unnumbered;
bool unlikely_intentional;
unsigned int sysdep_directives_count;
struct spec spec;
unsigned int numbered_arg_count;
struct numbered_arg *numbered;
+ unsigned int allocated;
spec.directives = 0;
- numbered_arg_count = 0;
spec.unnumbered_arg_count = 0;
- spec.allocated = 0;
- numbered = NULL;
spec.unnumbered = NULL;
spec.unlikely_intentional = false;
spec.sysdep_directives_count = 0;
spec.sysdep_directives = NULL;
+ numbered_arg_count = 0;
+ numbered = NULL;
+ allocated = 0;
for (; *format != '\0';)
if (*format++ == '%')
goto bad_format;
}
- if (spec.allocated == numbered_arg_count)
+ if (allocated == numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- numbered = (struct numbered_arg *) xrealloc (numbered, spec.allocated * sizeof (struct numbered_arg));
+ allocated = 2 * allocated + 1;
+ numbered = (struct numbered_arg *) xrealloc (numbered, allocated * sizeof (struct numbered_arg));
IF_OOM (numbered, goto bad_format;)
}
numbered[numbered_arg_count].number = width_number;
goto bad_format;
}
- if (spec.allocated == spec.unnumbered_arg_count)
+ if (allocated == spec.unnumbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.unnumbered = (struct unnumbered_arg *) xrealloc (spec.unnumbered, spec.allocated * sizeof (struct unnumbered_arg));
+ allocated = 2 * allocated + 1;
+ spec.unnumbered = (struct unnumbered_arg *) xrealloc (spec.unnumbered, allocated * sizeof (struct unnumbered_arg));
IF_OOM (spec.unnumbered, goto bad_format;)
}
spec.unnumbered[spec.unnumbered_arg_count].type = FAT_INTEGER;
goto bad_format;
}
- if (spec.allocated == numbered_arg_count)
+ if (allocated == numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- numbered = (struct numbered_arg *) xrealloc (numbered, spec.allocated * sizeof (struct numbered_arg));
+ allocated = 2 * allocated + 1;
+ numbered = (struct numbered_arg *) xrealloc (numbered, allocated * sizeof (struct numbered_arg));
IF_OOM (numbered, goto bad_format;)
}
numbered[numbered_arg_count].number = precision_number;
goto bad_format;
}
- if (spec.allocated == spec.unnumbered_arg_count)
+ if (allocated == spec.unnumbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.unnumbered = (struct unnumbered_arg *) xrealloc (spec.unnumbered, spec.allocated * sizeof (struct unnumbered_arg));
+ allocated = 2 * allocated + 1;
+ spec.unnumbered = (struct unnumbered_arg *) xrealloc (spec.unnumbered, allocated * sizeof (struct unnumbered_arg));
IF_OOM (spec.unnumbered, goto bad_format;)
}
spec.unnumbered[spec.unnumbered_arg_count].type = FAT_INTEGER;
goto bad_format;
}
- if (spec.allocated == numbered_arg_count)
+ if (allocated == numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- numbered = (struct numbered_arg *) xrealloc (numbered, spec.allocated * sizeof (struct numbered_arg));
+ allocated = 2 * allocated + 1;
+ numbered = (struct numbered_arg *) xrealloc (numbered, allocated * sizeof (struct numbered_arg));
IF_OOM (numbered, goto bad_format;)
}
numbered[numbered_arg_count].number = number;
goto bad_format;
}
- if (spec.allocated == spec.unnumbered_arg_count)
+ if (allocated == spec.unnumbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.unnumbered = (struct unnumbered_arg *) xrealloc (spec.unnumbered, spec.allocated * sizeof (struct unnumbered_arg));
+ allocated = 2 * allocated + 1;
+ spec.unnumbered = (struct unnumbered_arg *) xrealloc (spec.unnumbered, allocated * sizeof (struct unnumbered_arg));
IF_OOM (spec.unnumbered, goto bad_format;)
}
spec.unnumbered[spec.unnumbered_arg_count].type = type;
/* So now the numbered arguments array is equivalent to a sequence
of unnumbered arguments. */
spec.unnumbered_arg_count = numbered_arg_count;
- spec.allocated = spec.unnumbered_arg_count;
- spec.unnumbered = XNMALLOC (spec.allocated, struct unnumbered_arg);
+ allocated = spec.unnumbered_arg_count;
+ spec.unnumbered = XNMALLOC (allocated, struct unnumbered_arg);
IF_OOM (spec.unnumbered, goto bad_format;)
for (i = 0; i < spec.unnumbered_arg_count; i++)
spec.unnumbered[i].type = numbered[i].type;
/* Emacs Lisp format strings.
- Copyright (C) 2001-2004, 2006-2007, 2009, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2007, 2009, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2002.
This program is free software: you can redistribute it and/or modify
{
unsigned int directives;
unsigned int numbered_arg_count;
- unsigned int allocated;
struct numbered_arg *numbered;
};
{
const char *const format_start = format;
struct spec spec;
+ unsigned int numbered_allocated;
struct spec *result;
unsigned int number;
spec.directives = 0;
spec.numbered_arg_count = 0;
- spec.allocated = 0;
spec.numbered = NULL;
+ numbered_allocated = 0;
number = 1;
for (; *format != '\0';)
{
format++;
- if (spec.allocated == spec.numbered_arg_count)
+ if (numbered_allocated == spec.numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[spec.numbered_arg_count].number = number;
spec.numbered[spec.numbered_arg_count].type = FAT_INTEGER;
{
format++;
- if (spec.allocated == spec.numbered_arg_count)
+ if (numbered_allocated == spec.numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[spec.numbered_arg_count].number = number;
spec.numbered[spec.numbered_arg_count].type = FAT_INTEGER;
if (type != FAT_NONE)
{
- if (spec.allocated == spec.numbered_arg_count)
+ if (numbered_allocated == spec.numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[spec.numbered_arg_count].number = number;
spec.numbered[spec.numbered_arg_count].type = type;
/* GCC internal format strings.
- Copyright (C) 2003-2009, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2003-2009, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
{
unsigned int directives;
unsigned int numbered_arg_count;
- unsigned int allocated;
struct numbered_arg *numbered;
bool uses_err_no;
};
{
const char *const format_start = format;
struct spec spec;
+ unsigned int numbered_allocated;
unsigned int unnumbered_arg_count;
struct spec *result;
spec.directives = 0;
spec.numbered_arg_count = 0;
- spec.allocated = 0;
spec.numbered = NULL;
spec.uses_err_no = false;
+ numbered_allocated = 0;
unnumbered_arg_count = 0;
for (; *format != '\0';)
goto bad_format;
}
- if (spec.allocated == spec.numbered_arg_count)
+ if (numbered_allocated == spec.numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[spec.numbered_arg_count].number = precision_number;
spec.numbered[spec.numbered_arg_count].type = FAT_INTEGER;
goto bad_format;
}
- if (spec.allocated == unnumbered_arg_count)
+ if (numbered_allocated == unnumbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[unnumbered_arg_count].number = unnumbered_arg_count + 1;
spec.numbered[unnumbered_arg_count].type = FAT_INTEGER;
goto bad_format;
}
- if (spec.allocated == spec.numbered_arg_count)
+ if (numbered_allocated == spec.numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[spec.numbered_arg_count].number = number;
spec.numbered[spec.numbered_arg_count].type = type;
goto bad_format;
}
- if (spec.allocated == unnumbered_arg_count)
+ if (numbered_allocated == unnumbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[unnumbered_arg_count].number = unnumbered_arg_count + 1;
spec.numbered[unnumbered_arg_count].type = type;
/* GFC (GNU Fortran Compiler) internal format strings.
- Copyright (C) 2003-2009, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2003-2009, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2009.
This program is free software: you can redistribute it and/or modify
const char *const format_start = format;
struct spec spec;
unsigned int numbered_arg_count;
- unsigned int allocated;
+ unsigned int numbered_allocated;
struct numbered_arg *numbered;
struct spec *result;
unsigned int number;
spec.directives = 0;
numbered_arg_count = 0;
- allocated = 0;
+ numbered_allocated = 0;
numbered = NULL;
spec.uses_currentloc = false;
number = 1;
}
}
- if (allocated == numbered_arg_count)
+ if (numbered_allocated == numbered_arg_count)
{
- allocated = 2 * allocated + 1;
- numbered = (struct numbered_arg *) xrealloc (numbered, allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ numbered = (struct numbered_arg *) xrealloc (numbered, numbered_allocated * sizeof (struct numbered_arg));
}
numbered[numbered_arg_count].number = number;
numbered[numbered_arg_count].type = type;
/* Java printf format strings.
- Copyright (C) 2001-2004, 2006-2007, 2009-2010, 2018-2019 Free Software
+ Copyright (C) 2001-2004, 2006-2007, 2009-2010, 2018-2020 Free Software
Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
{
unsigned int directives;
unsigned int numbered_arg_count;
- unsigned int allocated;
struct numbered_arg *numbered;
};
{
const char *const format_start = format;
struct spec spec;
+ unsigned int numbered_allocated;
struct spec *result;
unsigned int unnumbered_arg_count;
unsigned int last_arg_number;
spec.directives = 0;
spec.numbered_arg_count = 0;
- spec.allocated = 0;
spec.numbered = NULL;
+ numbered_allocated = 0;
unnumbered_arg_count = 0;
last_arg_number = 0;
if (number == 0)
number = ++unnumbered_arg_count;
- if (spec.allocated == spec.numbered_arg_count)
+ if (numbered_allocated == spec.numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[spec.numbered_arg_count].number = number;
spec.numbered[spec.numbered_arg_count].type = type;
/* JavaScript format strings.
- Copyright (C) 2001-2004, 2006-2010, 2013, 2016, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2010, 2013, 2016, 2019-2020 Free Software Foundation, Inc.
Written by Andreas Stricker <andy@knitter.ch>, 2010.
It's based on python format module from Bruno Haible.
{
unsigned int directives;
unsigned int numbered_arg_count;
- unsigned int allocated;
struct numbered_arg *numbered;
};
{
const char *const format_start = format;
struct spec spec;
+ unsigned int numbered_allocated;
unsigned int unnumbered_arg_count;
struct spec *result;
spec.directives = 0;
spec.numbered_arg_count = 0;
- spec.allocated = 0;
spec.numbered = NULL;
+ numbered_allocated = 0;
unnumbered_arg_count = 0;
for (; *format != '\0';)
goto bad_format;
}
- if (spec.allocated == spec.numbered_arg_count)
+ if (numbered_allocated == spec.numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[spec.numbered_arg_count].number = number;
spec.numbered[spec.numbered_arg_count].type = type;
goto bad_format;
}
- if (spec.allocated == unnumbered_arg_count)
+ if (numbered_allocated == unnumbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[unnumbered_arg_count].number = unnumbered_arg_count + 1;
spec.numbered[unnumbered_arg_count].type = type;
/* KDE format strings.
- Copyright (C) 2003-2004, 2006-2007, 2009, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2003-2004, 2006-2007, 2009, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2007.
This program is free software: you can redistribute it and/or modify
{
unsigned int directives;
unsigned int numbered_arg_count;
- unsigned int allocated;
struct numbered_arg *numbered;
};
{
const char *const format_start = format;
struct spec spec;
+ unsigned int numbered_allocated;
struct spec *result;
spec.directives = 0;
spec.numbered_arg_count = 0;
- spec.allocated = 0;
spec.numbered = NULL;
+ numbered_allocated = 0;
for (; *format != '\0';)
if (*format++ == '%')
format++;
}
- if (spec.allocated == spec.numbered_arg_count)
+ if (numbered_allocated == spec.numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[spec.numbered_arg_count].number = number;
spec.numbered_arg_count++;
/* librep format strings.
- Copyright (C) 2001-2004, 2006-2007, 2009, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2007, 2009, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software: you can redistribute it and/or modify
{
unsigned int directives;
unsigned int numbered_arg_count;
- unsigned int allocated;
struct numbered_arg *numbered;
};
{
const char *const format_start = format;
struct spec spec;
+ unsigned int numbered_allocated;
struct spec *result;
unsigned int number;
spec.directives = 0;
spec.numbered_arg_count = 0;
- spec.allocated = 0;
spec.numbered = NULL;
+ numbered_allocated = 0;
number = 1;
for (; *format != '\0';)
if (type != FAT_NONE)
{
- if (spec.allocated == spec.numbered_arg_count)
+ if (numbered_allocated == spec.numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[spec.numbered_arg_count].number = number;
spec.numbered[spec.numbered_arg_count].type = type;
/* Lua format strings.
- Copyright (C) 2012-2013, 2018-2019 Free Software Foundation, Inc.
+ Copyright (C) 2012-2013, 2018-2020 Free Software Foundation, Inc.
Written by ĽubomÃr Remák <lubomirr@lubomirr.eu>, 2012.
This program is free software: you can redistribute it and/or modify
{
unsigned int directives;
unsigned int format_args_count;
- unsigned int allocated;
enum format_arg_type *format_args;
};
const char *format_start = format;
const char *fatstr = format;
struct spec *result = NULL;
+ unsigned int format_args_allocated;
+
result = XMALLOC (struct spec);
result->directives = 0;
- result->allocated = 0;
result->format_args_count = 0;
result->format_args = NULL;
-
+ format_args_allocated = 0;
for (; *fatstr != '\0';)
{
goto fmt_error;
}
- if (result->format_args_count == result->allocated)
+ if (result->format_args_count == format_args_allocated)
{
- result->allocated = 2 * result->allocated + 10;
+ format_args_allocated = 2 * format_args_allocated + 10;
result->format_args =
xrealloc (result->format_args,
- result->allocated *
+ format_args_allocated *
sizeof (enum format_arg_type));
}
result->format_args[result->format_args_count++] = type;
/* Object Pascal format strings.
- Copyright (C) 2001-2004, 2006-2007, 2009-2010, 2018-2019 Free Software
+ Copyright (C) 2001-2004, 2006-2007, 2009-2010, 2018-2020 Free Software
Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
{
unsigned int directives;
unsigned int numbered_arg_count;
- unsigned int allocated;
struct numbered_arg *numbered;
};
const char *const format_start = format;
unsigned int directives;
unsigned int numbered_arg_count;
- unsigned int allocated;
struct numbered_arg *numbered;
+ unsigned int numbered_allocated;
unsigned int unnumbered_arg_count;
struct spec *result;
directives = 0;
numbered_arg_count = 0;
- allocated = 0;
numbered = NULL;
+ numbered_allocated = 0;
unnumbered_arg_count = 0;
for (; *format != '\0';)
else if (*format == '*')
{
/* Unnumbered argument of type FAT_INTEGER. */
- if (allocated == numbered_arg_count)
+ if (numbered_allocated == numbered_arg_count)
{
- allocated = 2 * allocated + 1;
- numbered = (struct numbered_arg *) xrealloc (numbered, allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ numbered = (struct numbered_arg *) xrealloc (numbered, numbered_allocated * sizeof (struct numbered_arg));
}
numbered[numbered_arg_count].number = unnumbered_arg_count;
numbered[numbered_arg_count].type = FAT_INTEGER;
else if (*format == '*')
{
/* Unnumbered argument of type FAT_INTEGER. */
- if (allocated == unnumbered_arg_count)
+ if (numbered_allocated == unnumbered_arg_count)
{
- allocated = 2 * allocated + 1;
- numbered = (struct numbered_arg *) xrealloc (numbered, allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ numbered = (struct numbered_arg *) xrealloc (numbered, numbered_allocated * sizeof (struct numbered_arg));
}
numbered[numbered_arg_count].number = unnumbered_arg_count;
numbered[numbered_arg_count].type = FAT_INTEGER;
goto bad_format;
}
- if (allocated == numbered_arg_count)
+ if (numbered_allocated == numbered_arg_count)
{
- allocated = 2 * allocated + 1;
- numbered = (struct numbered_arg *) xrealloc (numbered, allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ numbered = (struct numbered_arg *) xrealloc (numbered, numbered_allocated * sizeof (struct numbered_arg));
}
switch (main_arg)
{
result = XMALLOC (struct spec);
result->directives = directives;
result->numbered_arg_count = numbered_arg_count;
- result->allocated = allocated;
result->numbered = numbered;
return result;
/* Perl brace format strings.
- Copyright (C) 2004, 2006-2007, 2009, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2006-2007, 2009, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
{
unsigned int directives;
unsigned int named_arg_count;
- unsigned int allocated;
struct named_arg *named;
};
{
const char *const format_start = format;
struct spec spec;
+ unsigned int named_allocated;
struct spec *result;
spec.directives = 0;
spec.named_arg_count = 0;
- spec.allocated = 0;
spec.named = NULL;
+ named_allocated = 0;
for (; *format != '\0';)
if (*format++ == '{')
spec.directives++;
- if (spec.allocated == spec.named_arg_count)
+ if (named_allocated == spec.named_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.named = (struct named_arg *) xrealloc (spec.named, spec.allocated * sizeof (struct named_arg));
+ named_allocated = 2 * named_allocated + 1;
+ spec.named = (struct named_arg *) xrealloc (spec.named, named_allocated * sizeof (struct named_arg));
}
spec.named[spec.named_arg_count].name = name;
spec.named_arg_count++;
/* Perl format strings.
- Copyright (C) 2004, 2006-2007, 2009, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2006-2007, 2009, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
{
unsigned int directives;
unsigned int numbered_arg_count;
- unsigned int allocated;
struct numbered_arg *numbered;
};
const char *const format_start = format;
unsigned int directives;
unsigned int numbered_arg_count;
- unsigned int allocated;
struct numbered_arg *numbered;
+ unsigned int numbered_allocated;
unsigned int unnumbered_arg_count;
struct spec *result;
directives = 0;
numbered_arg_count = 0;
- unnumbered_arg_count = 0;
- allocated = 0;
numbered = NULL;
+ numbered_allocated = 0;
+ unnumbered_arg_count = 0;
for (; *format != '\0';)
if (*format++ == '%')
vectorize = true;
/* Unnumbered argument. */
- if (allocated == numbered_arg_count)
+ if (numbered_allocated == numbered_arg_count)
{
- allocated = 2 * allocated + 1;
- numbered = (struct numbered_arg *) xrealloc (numbered, allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ numbered = (struct numbered_arg *) xrealloc (numbered, numbered_allocated * sizeof (struct numbered_arg));
}
numbered[numbered_arg_count].number = ++unnumbered_arg_count;
numbered[numbered_arg_count].type = FAT_SCALAR_VECTOR; /* or FAT_STRING? */
/* Numbered argument. */
/* Note: As of perl-5.8.0, this is not correctly
implemented in perl's sv.c. */
- if (allocated == numbered_arg_count)
+ if (numbered_allocated == numbered_arg_count)
{
- allocated = 2 * allocated + 1;
- numbered = (struct numbered_arg *) xrealloc (numbered, allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ numbered = (struct numbered_arg *) xrealloc (numbered, numbered_allocated * sizeof (struct numbered_arg));
}
numbered[numbered_arg_count].number = vector_number;
numbered[numbered_arg_count].type = FAT_SCALAR_VECTOR; /* or FAT_STRING? */
if (vectorize)
{
/* Numbered or unnumbered argument. */
- if (allocated == numbered_arg_count)
+ if (numbered_allocated == numbered_arg_count)
{
- allocated = 2 * allocated + 1;
- numbered = (struct numbered_arg *) xrealloc (numbered, allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ numbered = (struct numbered_arg *) xrealloc (numbered, numbered_allocated * sizeof (struct numbered_arg));
}
numbered[numbered_arg_count].number = (number ? number : ++unnumbered_arg_count);
numbered[numbered_arg_count].type = FAT_SCALAR_VECTOR;
/* Numbered or unnumbered argument. */
/* Note: As of perl-5.8.0, this is not correctly
implemented in perl's sv.c. */
- if (allocated == numbered_arg_count)
+ if (numbered_allocated == numbered_arg_count)
{
- allocated = 2 * allocated + 1;
- numbered = (struct numbered_arg *) xrealloc (numbered, allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ numbered = (struct numbered_arg *) xrealloc (numbered, numbered_allocated * sizeof (struct numbered_arg));
}
numbered[numbered_arg_count].number = (width_number ? width_number : ++unnumbered_arg_count);
numbered[numbered_arg_count].type = FAT_INTEGER;
}
/* Numbered or unnumbered argument. */
- if (allocated == numbered_arg_count)
+ if (numbered_allocated == numbered_arg_count)
{
- allocated = 2 * allocated + 1;
- numbered = (struct numbered_arg *) xrealloc (numbered, allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ numbered = (struct numbered_arg *) xrealloc (numbered, numbered_allocated * sizeof (struct numbered_arg));
}
numbered[numbered_arg_count].number = (precision_number ? precision_number : ++unnumbered_arg_count);
numbered[numbered_arg_count].type = FAT_INTEGER;
if (type != FAT_NONE && !vectorize)
{
/* Numbered or unnumbered argument. */
- if (allocated == numbered_arg_count)
+ if (numbered_allocated == numbered_arg_count)
{
- allocated = 2 * allocated + 1;
- numbered = (struct numbered_arg *) xrealloc (numbered, allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ numbered = (struct numbered_arg *) xrealloc (numbered, numbered_allocated * sizeof (struct numbered_arg));
}
numbered[numbered_arg_count].number = (number ? number : ++unnumbered_arg_count);
numbered[numbered_arg_count].type = type;
result = XMALLOC (struct spec);
result->directives = directives;
result->numbered_arg_count = numbered_arg_count;
- result->allocated = allocated;
result->numbered = numbered;
return result;
/* PHP format strings.
- Copyright (C) 2001-2004, 2006-2007, 2009, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2007, 2009, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This program is free software: you can redistribute it and/or modify
{
unsigned int directives;
unsigned int numbered_arg_count;
- unsigned int allocated;
struct numbered_arg *numbered;
};
const char *const format_start = format;
unsigned int directives;
unsigned int numbered_arg_count;
- unsigned int allocated;
struct numbered_arg *numbered;
+ unsigned int numbered_allocated;
unsigned int unnumbered_arg_count;
struct spec *result;
directives = 0;
numbered_arg_count = 0;
- allocated = 0;
numbered = NULL;
+ numbered_allocated = 0;
unnumbered_arg_count = 0;
for (; *format != '\0';)
goto bad_format;
}
- if (allocated == numbered_arg_count)
+ if (numbered_allocated == numbered_arg_count)
{
- allocated = 2 * allocated + 1;
- numbered = (struct numbered_arg *) xrealloc (numbered, allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ numbered = (struct numbered_arg *) xrealloc (numbered, numbered_allocated * sizeof (struct numbered_arg));
}
numbered[numbered_arg_count].number = number;
numbered[numbered_arg_count].type = type;
result = XMALLOC (struct spec);
result->directives = directives;
result->numbered_arg_count = numbered_arg_count;
- result->allocated = allocated;
result->numbered = numbered;
return result;
/* Python format strings.
- Copyright (C) 2001-2004, 2006-2009, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2009, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software: you can redistribute it and/or modify
unsigned int directives;
unsigned int named_arg_count;
unsigned int unnamed_arg_count;
- unsigned int allocated;
struct named_arg *named;
struct unnamed_arg *unnamed;
};
{
const char *const format_start = format;
struct spec spec;
+ unsigned int allocated;
struct spec *result;
spec.directives = 0;
spec.named_arg_count = 0;
spec.unnamed_arg_count = 0;
- spec.allocated = 0;
spec.named = NULL;
spec.unnamed = NULL;
+ allocated = 0;
for (; *format != '\0';)
if (*format++ == '%')
goto bad_format;
}
- if (spec.allocated == spec.unnamed_arg_count)
+ if (allocated == spec.unnamed_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.unnamed = (struct unnamed_arg *) xrealloc (spec.unnamed, spec.allocated * sizeof (struct unnamed_arg));
+ allocated = 2 * allocated + 1;
+ spec.unnamed = (struct unnamed_arg *) xrealloc (spec.unnamed, allocated * sizeof (struct unnamed_arg));
}
spec.unnamed[spec.unnamed_arg_count].type = FAT_INTEGER;
spec.unnamed_arg_count++;
goto bad_format;
}
- if (spec.allocated == spec.unnamed_arg_count)
+ if (allocated == spec.unnamed_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.unnamed = (struct unnamed_arg *) xrealloc (spec.unnamed, spec.allocated * sizeof (struct unnamed_arg));
+ allocated = 2 * allocated + 1;
+ spec.unnamed = (struct unnamed_arg *) xrealloc (spec.unnamed, allocated * sizeof (struct unnamed_arg));
}
spec.unnamed[spec.unnamed_arg_count].type = FAT_INTEGER;
spec.unnamed_arg_count++;
goto bad_format;
}
- if (spec.allocated == spec.named_arg_count)
+ if (allocated == spec.named_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.named = (struct named_arg *) xrealloc (spec.named, spec.allocated * sizeof (struct named_arg));
+ allocated = 2 * allocated + 1;
+ spec.named = (struct named_arg *) xrealloc (spec.named, allocated * sizeof (struct named_arg));
}
spec.named[spec.named_arg_count].name = name;
spec.named[spec.named_arg_count].type = type;
goto bad_format;
}
- if (spec.allocated == spec.unnamed_arg_count)
+ if (allocated == spec.unnamed_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.unnamed = (struct unnamed_arg *) xrealloc (spec.unnamed, spec.allocated * sizeof (struct unnamed_arg));
+ allocated = 2 * allocated + 1;
+ spec.unnamed = (struct unnamed_arg *) xrealloc (spec.unnamed, allocated * sizeof (struct unnamed_arg));
}
spec.unnamed[spec.unnamed_arg_count].type = type;
spec.unnamed_arg_count++;
/* Shell format strings.
- Copyright (C) 2003-2004, 2006-2007, 2009, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2003-2004, 2006-2007, 2009, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
{
unsigned int directives;
unsigned int named_arg_count;
- unsigned int allocated;
struct named_arg *named;
};
{
const char *const format_start = format;
struct spec spec;
+ unsigned int named_allocated;
struct spec *result;
spec.directives = 0;
spec.named_arg_count = 0;
- spec.allocated = 0;
spec.named = NULL;
+ named_allocated = 0;
for (; *format != '\0';)
if (*format++ == '$')
}
/* Named argument. */
- if (spec.allocated == spec.named_arg_count)
+ if (named_allocated == spec.named_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.named = (struct named_arg *) xrealloc (spec.named, spec.allocated * sizeof (struct named_arg));
+ named_allocated = 2 * named_allocated + 1;
+ spec.named = (struct named_arg *) xrealloc (spec.named, named_allocated * sizeof (struct named_arg));
}
spec.named[spec.named_arg_count].name = name;
spec.named_arg_count++;
/* Tcl format strings.
- Copyright (C) 2001-2004, 2006-2007, 2009, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2007, 2009, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2002.
This program is free software: you can redistribute it and/or modify
{
unsigned int directives;
unsigned int numbered_arg_count;
- unsigned int allocated;
struct numbered_arg *numbered;
};
{
const char *const format_start = format;
struct spec spec;
+ unsigned int numbered_allocated;
struct spec *result;
bool seen_numbered_arg;
bool seen_unnumbered_arg;
spec.directives = 0;
spec.numbered_arg_count = 0;
- spec.allocated = 0;
spec.numbered = NULL;
+ numbered_allocated = 0;
seen_numbered_arg = false;
seen_unnumbered_arg = false;
number = 1;
{
format++;
- if (spec.allocated == spec.numbered_arg_count)
+ if (numbered_allocated == spec.numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[spec.numbered_arg_count].number = number;
spec.numbered[spec.numbered_arg_count].type = FAT_INTEGER;
{
format++;
- if (spec.allocated == spec.numbered_arg_count)
+ if (numbered_allocated == spec.numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[spec.numbered_arg_count].number = number;
spec.numbered[spec.numbered_arg_count].type = FAT_INTEGER;
goto bad_format;
}
- if (spec.allocated == spec.numbered_arg_count)
+ if (numbered_allocated == spec.numbered_arg_count)
{
- spec.allocated = 2 * spec.allocated + 1;
- spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));
+ numbered_allocated = 2 * numbered_allocated + 1;
+ spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, numbered_allocated * sizeof (struct numbered_arg));
}
spec.numbered[spec.numbered_arg_count].number = number;
spec.numbered[spec.numbered_arg_count].type = type;