+2007-06-09 Bruno Haible <bruno@clisp.org>
+
+ * autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Use xmalloca instead of
+ xallocsa.
+ (GNULIB_MODULES_LIBGETTEXTPO): Likewise.
+
2007-06-08 Bruno Haible <bruno@clisp.org>
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add module 'localename'.
vasprintf
wait-process
xalloc
- xallocsa
+ xmalloca
xerror
xsetenv
xstriconv
utf16-ucs4
vasprintf
xalloc
- xallocsa
+ xmalloca
xerror
xstriconv
xvasprintf
Makefile.in
acl.c
acl.h
-allocsa.c
-allocsa.h
-allocsa.valgrind
argmatch.c
argmatch.h
atexit.c
wchar_.h
wctype_.h
wcwidth.h
-xallocsa.c
-xallocsa.h
xasprintf.c
xsetenv.c
xsetenv.h
*.lo
*.la
alloca_.h
-allocsa.c
-allocsa.h
-allocsa.valgrind
basename.c
basename.h
c-ctype.c
wctype_.h
wcwidth.h
xalloc.h
-xallocsa.c
-xallocsa.h
xasprintf.c
xerror.c
xerror.h
+2007-06-09 Bruno Haible <bruno@clisp.org>
+
+ * format-java.c: Include xmalloca.h instead of xallocsa.h.
+ (message_format_parse): Use xmalloca/freea instead of xallocsa/freesa.
+ * message.c: Include xmalloca.h instead of xallocsa.h.
+ (message_list_hash_insert_entry, message_list_search): Use
+ xmalloca/freea instead of xallocsa/freesa.
+ * msggrep.c: Include xmalloca.h instead of xallocsa.h.
+ (is_message_selected_no_invert): Use xmalloca/freea instead of
+ xallocsa/freesa.
+ * msginit.c: Include xmalloca.h instead of xallocsa.h.
+ (subst_string): Use xmalloca/freea instead of xallocsa/freesa.
+ * msgl-cat.c: Include xmalloca.h instead of xallocsa.h.
+ (catenate_msgdomain_list): Use xmalloca/freea instead of
+ xallocsa/freesa.
+ * msgl-charset.c: Include xmalloca.h instead of xallocsa.h.
+ (compare_po_locale_charsets): Use xmalloca/freea instead of
+ xallocsa/freesa.
+ * msgl-iconv.c: Include xmalloca.h instead of xallocsa.h.
+ (iconv_message_list_internal, is_message_list_iconvable): Use
+ xmalloca/freea instead of xallocsa/freesa.
+ * msgmerge.c: Include xmalloca.h instead of xallocsa.h.
+ (merge): Use xmalloca/freea instead of xallocsa/freesa.
+ * po-charset.c: Include xmalloca.h instead of xallocsa.h.
+ (po_lex_charset_set): Use xmalloca/freea instead of xallocsa/freesa.
+ * read-tcl.c: Include xmalloca.h instead of xallocsa.h.
+ (msgdomain_read_tcl): Use xmalloca/freea instead of xallocsa/freesa.
+ * write-java.c: Include xmalloca.h instead of xallocsa.h.
+ (compute_hashsize, msgdomain_write_java): Use xmalloca/freea instead of
+ xallocsa/freesa.
+ * write-mo.c: Include xmalloca.h instead of xallocsa.h.
+ (write_table): Use xmalloca/freea instead of xallocsa/freesa.
+ * write-po.c: Include xmalloca.h instead of xallocsa.h.
+ (msgdomain_list_print_po): Use xmalloca/freea instead of
+ xallocsa/freesa.
+ * write-tcl.c: Include xmalloca.h instead of xallocsa.h.
+ (msgdomain_write_tcl): Use xmalloca/freea instead of xallocsa/freesa.
+ * xgettext.c: Include xmalloca.h instead of xallocsa.h.
+ (flag_context_list_table_insert): Use xmalloca/freea instead of
+ xallocsa/freesa.
+
2007-06-08 Bruno Haible <bruno@clisp.org>
* msgattrib.c (main): Update year in --version output.
/* Java format strings.
- Copyright (C) 2001-2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2007 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
#include "format.h"
#include "c-ctype.h"
#include "xalloc.h"
-#include "xallocsa.h"
+#include "xmalloca.h"
#include "xvasprintf.h"
#include "format-invalid.h"
#include "gettext.h"
element_end = format++;
n = element_end - element_start;
- element = element_alloced = (char *) xallocsa (n + 1);
+ element = element_alloced = (char *) xmalloca (n + 1);
memcpy (element, element_start, n);
element[n] = '\0';
*invalid_reason =
xasprintf (_("In the directive number %u, '{' is not followed by an argument number."), spec->directives);
FDI_SET (format - 1, FMTDIR_ERROR);
- freesa (element_alloced);
+ freea (element_alloced);
return false;
}
number = 0;
*invalid_reason =
xasprintf (_("In the directive number %u, the substring \"%s\" is not a valid date/time style."), spec->directives, element);
FDI_SET (format - 1, FMTDIR_ERROR);
- freesa (element_alloced);
+ freea (element_alloced);
return false;
}
}
*invalid_reason =
xasprintf (_("In the directive number %u, \"%s\" is not followed by a comma."), spec->directives, element);
FDI_SET (format - 1, FMTDIR_ERROR);
- freesa (element_alloced);
+ freea (element_alloced);
return false;
}
}
*invalid_reason =
xasprintf (_("In the directive number %u, the substring \"%s\" is not a valid number style."), spec->directives, element);
FDI_SET (format - 1, FMTDIR_ERROR);
- freesa (element_alloced);
+ freea (element_alloced);
return false;
}
}
*invalid_reason =
xasprintf (_("In the directive number %u, \"%s\" is not followed by a comma."), spec->directives, element);
FDI_SET (format - 1, FMTDIR_ERROR);
- freesa (element_alloced);
+ freea (element_alloced);
return false;
}
}
else
{
FDI_SET (format - 1, FMTDIR_ERROR);
- freesa (element_alloced);
+ freea (element_alloced);
return false;
}
}
*invalid_reason =
xasprintf (_("In the directive number %u, \"%s\" is not followed by a comma."), spec->directives, element);
FDI_SET (format - 1, FMTDIR_ERROR);
- freesa (element_alloced);
+ freea (element_alloced);
return false;
}
}
*invalid_reason =
xasprintf (_("In the directive number %u, the argument number is not followed by a comma and one of \"%s\", \"%s\", \"%s\", \"%s\"."), spec->directives, "time", "date", "number", "choice");
FDI_SET (format - 1, FMTDIR_ERROR);
- freesa (element_alloced);
+ freea (element_alloced);
return false;
}
- freesa (element_alloced);
+ freea (element_alloced);
if (spec->allocated == spec->numbered_arg_count)
{
}
HANDLE_QUOTE;
- msgformat = (char *) xallocsa (strlen (format) + 1);
+ msgformat = (char *) xmalloca (strlen (format) + 1);
mp = msgformat;
while (*format != '\0' && !(!quoting && *format == '|'))
msgformat_valid =
message_format_parse (msgformat, NULL, spec, invalid_reason);
- freesa (msgformat);
+ freea (msgformat);
if (!msgformat_valid)
return false;
/* GNU gettext - internationalization aids
- Copyright (C) 1995-1998, 2000-2006 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2007 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
#include "fstrcmp.h"
#include "hash.h"
#include "xalloc.h"
-#include "xallocsa.h"
+#include "xmalloca.h"
const char *const format_language[NFORMATS] =
size_t msgctxt_len = strlen (mp->msgctxt);
size_t msgid_len = strlen (mp->msgid);
keylen = msgctxt_len + 1 + msgid_len + 1;
- alloced_key = (char *) xallocsa (keylen);
+ alloced_key = (char *) xmalloca (keylen);
memcpy (alloced_key, mp->msgctxt, msgctxt_len);
alloced_key[msgctxt_len] = MSGCTXT_SEPARATOR;
memcpy (alloced_key + msgctxt_len + 1, mp->msgid, msgid_len + 1);
found = (hash_insert_entry (htable, key, keylen, mp) == NULL);
if (mp->msgctxt != NULL)
- freesa (alloced_key);
+ freea (alloced_key);
return found;
}
size_t msgctxt_len = strlen (msgctxt);
size_t msgid_len = strlen (msgid);
keylen = msgctxt_len + 1 + msgid_len + 1;
- alloced_key = (char *) xallocsa (keylen);
+ alloced_key = (char *) xmalloca (keylen);
memcpy (alloced_key, msgctxt, msgctxt_len);
alloced_key[msgctxt_len] = MSGCTXT_SEPARATOR;
memcpy (alloced_key + msgctxt_len + 1, msgid, msgid_len + 1);
int found = !hash_find_entry (&mlp->htable, key, keylen, &htable_value);
if (msgctxt != NULL)
- freesa (alloced_key);
+ freea (alloced_key);
if (found)
return (message_ty *) htable_value;
#include "str-list.h"
#include "msgl-charset.h"
#include "xalloc.h"
-#include "xallocsa.h"
+#include "xmalloca.h"
#include "libgrep.h"
#include "propername.h"
#include "gettext.h"
length = 0;
for (j = 0; j < mp->comment->nitems; j++)
length += strlen (mp->comment->item[j]) + 1;
- total_comment = (char *) xallocsa (length);
+ total_comment = (char *) xmalloca (length);
q = total_comment;
for (j = 0; j < mp->comment->nitems; j++)
selected = is_string_selected (3, total_comment, length);
- freesa (total_comment);
+ freea (total_comment);
if (selected)
return true;
length = 0;
for (j = 0; j < mp->comment_dot->nitems; j++)
length += strlen (mp->comment_dot->item[j]) + 1;
- total_comment = (char *) xallocsa (length);
+ total_comment = (char *) xmalloca (length);
q = total_comment;
for (j = 0; j < mp->comment_dot->nitems; j++)
selected = is_string_selected (4, total_comment, length);
- freesa (total_comment);
+ freea (total_comment);
if (selected)
return true;
#include "plural-table.h"
#include "lang-table.h"
#include "xalloc.h"
-#include "xallocsa.h"
+#include "xmalloca.h"
#include "filename.h"
#include "xerror.h"
#include "xvasprintf.h"
size_t i;
unsigned int j;
- substlen = (size_t *) xallocsa (nsubst * sizeof (size_t));
+ substlen = (size_t *) xmalloca (nsubst * sizeof (size_t));
for (j = 0; j < nsubst; j++)
{
substlen[j] = strlen (subst[j][0]);
i++;
}
- freesa (substlen);
+ freea (substlen);
}
return str;
#include "msgl-equal.h"
#include "msgl-iconv.h"
#include "xalloc.h"
-#include "xallocsa.h"
+#include "xmalloca.h"
#include "c-strstr.h"
#include "basename.h"
#include "gettext.h"
charsetstr += strlen ("charset=");
len = strcspn (charsetstr, " \t\n");
- charset = (char *) xallocsa (len + 1);
+ charset = (char *) xmalloca (len + 1);
memcpy (charset, charsetstr, len);
charset[len] = '\0';
charset);
}
- freesa (charset);
+ freea (charset);
if (canon_from_code == NULL)
canon_from_code = canon_charset;
#include "error.h"
#include "progname.h"
#include "basename.h"
-#include "xallocsa.h"
+#include "xmalloca.h"
#include "xerror.h"
#include "xvasprintf.h"
#include "message.h"
charsetstr += strlen ("charset=");
len = strcspn (charsetstr, " \t\n");
- charset = (char *) xallocsa (len + 1);
+ charset = (char *) xmalloca (len + 1);
memcpy (charset, charsetstr, len);
charset[len] = '\0';
_("\
present charset \"%s\" is not a portable encoding name"),
charset);
- freesa (charset);
+ freea (charset);
if (canon_locale_code != canon_charset)
{
multiline_warning (xasprintf (_("warning: ")),
#include "xstriconv.h"
#include "msgl-ascii.h"
#include "xalloc.h"
-#include "xallocsa.h"
+#include "xmalloca.h"
#include "c-strstr.h"
#include "xvasprintf.h"
#include "po-xerror.h"
charsetstr += strlen ("charset=");
len = strcspn (charsetstr, " \t\n");
- charset = (char *) xallocsa (len + 1);
+ charset = (char *) xmalloca (len + 1);
memcpy (charset, charsetstr, len);
charset[len] = '\0';
two different charsets \"%s\" and \"%s\" in input file"),
canon_from_code, canon_charset));
}
- freesa (charset);
+ freea (charset);
if (update_header)
{
charsetstr += strlen ("charset=");
len = strcspn (charsetstr, " \t\n");
- charset = (char *) xallocsa (len + 1);
+ charset = (char *) xmalloca (len + 1);
memcpy (charset, charsetstr, len);
charset[len] = '\0';
else
{
/* charset is not a portable encoding name. */
- freesa (charset);
+ freea (charset);
return false;
}
}
else if (canon_from_code != canon_charset)
{
/* Two different charsets in input file. */
- freesa (charset);
+ freea (charset);
return false;
}
}
- freesa (charset);
+ freea (charset);
}
}
}
#include "write-stringtable.h"
#include "format.h"
#include "xalloc.h"
-#include "xallocsa.h"
+#include "xmalloca.h"
#include "obstack.h"
#include "c-strstr.h"
#include "c-strcase.h"
charsetstr += strlen ("charset=");
len = strcspn (charsetstr, " \t\n");
- charset = (char *) xallocsa (len + 1);
+ charset = (char *) xmalloca (len + 1);
memcpy (charset, charsetstr, len);
charset[len] = '\0';
break;
conversion_done = true;
}
}
- freesa (charset);
+ freea (charset);
}
}
if (!conversion_done)
charsetstr += strlen ("charset=");
len = strcspn (charsetstr, " \t\n");
- charset = (char *) xallocsa (len + 1);
+ charset = (char *) xmalloca (len + 1);
memcpy (charset, charsetstr, len);
charset[len] = '\0';
if (charset != NULL)
{
canon_charset = po_charset_canonicalize (charset);
- freesa (charset);
+ freea (charset);
}
/* If no charset declaration was found in this file,
or if it is not a valid encoding name, or if it
/* Charset handling while reading PO files.
- Copyright (C) 2001-2006 Free Software Foundation, Inc.
+ Copyright (C) 2001-2007 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
#include <stdlib.h>
#include <string.h>
-#include "xallocsa.h"
+#include "xmalloca.h"
#include "xvasprintf.h"
#include "po-xerror.h"
#include "basename.h"
charsetstr += strlen ("charset=");
len = strcspn (charsetstr, " \t\n");
- charset = (char *) xallocsa (len + 1);
+ charset = (char *) xmalloca (len + 1);
memcpy (charset, charsetstr, len);
charset[len] = '\0';
#endif
}
}
- freesa (charset);
+ freea (charset);
}
else
{
#include "wait-process.h"
#include "read-catalog.h"
#include "read-po.h"
-#include "xallocsa.h"
+#include "xmalloca.h"
#include "error.h"
#include "gettext.h"
/* Convert the locale name to lowercase and remove any encoding. */
len = strlen (locale_name);
- frobbed_locale_name = (char *) xallocsa (len + 1);
+ frobbed_locale_name = (char *) xmalloca (len + 1);
memcpy (frobbed_locale_name, locale_name, len + 1);
for (p = frobbed_locale_name; *p != '\0'; p++)
if (*p >= 'A' && *p <= 'Z')
file_name = concatenated_filename (directory, frobbed_locale_name, ".msg");
- freesa (frobbed_locale_name);
+ freea (frobbed_locale_name);
/* Prepare arguments. */
argv[0] = "tclsh";
#include "plural-exp.h"
#include "po-charset.h"
#include "xalloc.h"
-#include "xallocsa.h"
+#include "xmalloca.h"
#include "filename.h"
#include "fwriteerror.h"
#include "clean-temp.h"
#define XXS 3 /* can be tweaked */
unsigned int n = mlp->nitems;
unsigned int *hashcodes =
- (unsigned int *) xallocsa (n * sizeof (unsigned int));
+ (unsigned int *) xmalloca (n * sizeof (unsigned int));
unsigned int hashsize;
unsigned int best_hashsize;
unsigned int best_score;
if (best_hashsize == 0 || best_score < best_hashsize)
abort ();
- freesa (hashcodes);
+ freea (hashcodes);
/* There are collisions if and only if best_score > best_hashsize. */
*collisionp = (best_score > best_hashsize);
else
class_name = xstrdup (resource_name);
- subdirs = (ndots > 0 ? (char **) xallocsa (ndots * sizeof (char *)) : NULL);
+ subdirs = (ndots > 0 ? (char **) xmalloca (ndots * sizeof (char *)) : NULL);
{
const char *p;
const char *last_dir;
{
const char *q = strchr (p, '.');
size_t n = q - p;
- char *part = (char *) xallocsa (n + 1);
+ char *part = (char *) xmalloca (n + 1);
memcpy (part, p, n);
part[n] = '\0';
subdirs[i] = concatenated_filename (last_dir, part, NULL);
- freesa (part);
+ freea (part);
last_dir = subdirs[i];
p = q + 1;
}
for (i = 0; i < ndots; i++)
free (subdirs[i]);
}
- freesa (subdirs);
+ freea (subdirs);
free (class_name);
quit2:
cleanup_temp_dir (tmpdir);
#include "format.h"
#include "xsize.h"
#include "xalloc.h"
-#include "xallocsa.h"
+#include "xmalloca.h"
#include "binary-io.h"
#include "fwriteerror.h"
#include "gettext.h"
struct pre_sysdep_string *pre = msg->str[m];
struct sysdep_string *str =
(struct sysdep_string *)
- xallocsa (sizeof (struct sysdep_string)
+ xmalloca (sizeof (struct sysdep_string)
+ pre->segmentcount * sizeof (struct segment_pair));
unsigned int i;
+ pre->segmentcount * sizeof (struct segment_pair),
1, output_file);
- freesa (str);
+ freea (str);
}
}
/* GNU gettext - internationalization aids
- Copyright (C) 1995-1998, 2000-2006 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2007 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
#include "msgl-ascii.h"
#include "write-catalog.h"
#include "xalloc.h"
-#include "xallocsa.h"
+#include "xmalloca.h"
#include "c-strstr.h"
#include "ostream.h"
#ifdef GETTEXTDATADIR
charsetstr += strlen ("charset=");
len = strcspn (charsetstr, " \t\n");
- allocated_charset = (char *) xallocsa (len + 1);
+ allocated_charset = (char *) xmalloca (len + 1);
memcpy (allocated_charset, charsetstr, len);
allocated_charset[len] = '\0';
charset = allocated_charset;
}
if (allocated_charset != NULL)
- freesa (allocated_charset);
+ freea (allocated_charset);
}
}
#include "msgl-iconv.h"
#include "po-charset.h"
#include "xalloc.h"
-#include "xallocsa.h"
+#include "xmalloca.h"
#include "filename.h"
#include "fwriteerror.h"
#include "unistr.h"
/* Convert the locale name to lowercase and remove any encoding. */
len = strlen (locale_name);
- frobbed_locale_name = (char *) xallocsa (len + 1);
+ frobbed_locale_name = (char *) xmalloca (len + 1);
memcpy (frobbed_locale_name, locale_name, len + 1);
for (p = frobbed_locale_name; *p != '\0'; p++)
if (*p >= 'A' && *p <= 'Z')
{
error (0, errno, _("error while opening \"%s\" for writing"),
file_name);
- freesa (frobbed_locale_name);
+ freea (frobbed_locale_name);
return 1;
}
error (EXIT_FAILURE, errno, _("error while writing \"%s\" file"),
file_name);
- freesa (frobbed_locale_name);
+ freea (frobbed_locale_name);
}
return 0;
#include "xvasprintf.h"
#include "xsize.h"
#include "xalloc.h"
-#include "xallocsa.h"
+#include "xmalloca.h"
#include "c-strstr.h"
#include "xerror.h"
#include "filename.h"
{
/* Convert NAME to upper case. */
size_t name_len = name_end - name_start;
- char *name = allocated_name = (char *) xallocsa (name_len);
+ char *name = allocated_name = (char *) xmalloca (name_len);
size_t i;
for (i = 0; i < name_len; i++)
}
if (allocated_name != NULL)
- freesa (allocated_name);
+ freea (allocated_name);
}
# For debugging memory leaks and memory allocation bugs.
# You should build with --disable-shared when using valgrind.
CHECKER =
-#CHECKER = valgrind --tool=memcheck --suppressions=$(srcdir)/../gnulib-lib/allocsa.valgrind --num-callers=20 --leak-check=yes --leak-resolution=high --show-reachable=yes
+#CHECKER = valgrind --tool=memcheck --suppressions=$(srcdir)/../gnulib-lib/malloca.valgrind --num-callers=20 --leak-check=yes --leak-resolution=high --show-reachable=yes
#CHECKER = valgrind --tool=massif --format=html --depth=10 --alloc-fn=xmalloc --alloc-fn=xrealloc --stacks=no
TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir) \