summaryrefslogtreecommitdiffstats
path: root/gettext-tools
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2007-06-09 11:51:33 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:14:55 +0200
commit27f4050efdf0d27e006ffd332149631f30fb27da (patch)
tree9031ffdba0c52a65518764aa3bed370967ab6a1f /gettext-tools
parentb9c2783da0d6a4a7987f98430f31c6c130ca4fab (diff)
downloadexternal_gettext-27f4050efdf0d27e006ffd332149631f30fb27da.zip
external_gettext-27f4050efdf0d27e006ffd332149631f30fb27da.tar.gz
external_gettext-27f4050efdf0d27e006ffd332149631f30fb27da.tar.bz2
xallocsa was renamed to xmalloca.
Diffstat (limited to 'gettext-tools')
-rw-r--r--gettext-tools/gnulib-lib/.cvsignore5
-rw-r--r--gettext-tools/libgettextpo/.cvsignore5
-rw-r--r--gettext-tools/src/ChangeLog41
-rw-r--r--gettext-tools/src/format-java.c28
-rw-r--r--gettext-tools/src/message.c12
-rw-r--r--gettext-tools/src/msggrep.c10
-rw-r--r--gettext-tools/src/msginit.c6
-rw-r--r--gettext-tools/src/msgl-cat.c6
-rw-r--r--gettext-tools/src/msgl-charset.c6
-rw-r--r--gettext-tools/src/msgl-iconv.c14
-rw-r--r--gettext-tools/src/msgmerge.c10
-rw-r--r--gettext-tools/src/po-charset.c8
-rw-r--r--gettext-tools/src/read-tcl.c6
-rw-r--r--gettext-tools/src/write-java.c14
-rw-r--r--gettext-tools/src/write-mo.c6
-rw-r--r--gettext-tools/src/write-po.c8
-rw-r--r--gettext-tools/src/write-tcl.c8
-rw-r--r--gettext-tools/src/xgettext.c6
-rw-r--r--gettext-tools/tests/Makefile.am2
19 files changed, 116 insertions, 85 deletions
diff --git a/gettext-tools/gnulib-lib/.cvsignore b/gettext-tools/gnulib-lib/.cvsignore
index ee3447e..894c235 100644
--- a/gettext-tools/gnulib-lib/.cvsignore
+++ b/gettext-tools/gnulib-lib/.cvsignore
@@ -2,9 +2,6 @@ Makefile.gnulib
Makefile.in
acl.c
acl.h
-allocsa.c
-allocsa.h
-allocsa.valgrind
argmatch.c
argmatch.h
atexit.c
@@ -191,8 +188,6 @@ wait-process.h
wchar_.h
wctype_.h
wcwidth.h
-xallocsa.c
-xallocsa.h
xasprintf.c
xsetenv.c
xsetenv.h
diff --git a/gettext-tools/libgettextpo/.cvsignore b/gettext-tools/libgettextpo/.cvsignore
index 690714b..fd3ba76 100644
--- a/gettext-tools/libgettextpo/.cvsignore
+++ b/gettext-tools/libgettextpo/.cvsignore
@@ -7,9 +7,6 @@ _libs
*.lo
*.la
alloca_.h
-allocsa.c
-allocsa.h
-allocsa.valgrind
basename.c
basename.h
c-ctype.c
@@ -90,8 +87,6 @@ wchar_.h
wctype_.h
wcwidth.h
xalloc.h
-xallocsa.c
-xallocsa.h
xasprintf.c
xerror.c
xerror.h
diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog
index cc2bb0f..6bfb700 100644
--- a/gettext-tools/src/ChangeLog
+++ b/gettext-tools/src/ChangeLog
@@ -1,3 +1,44 @@
+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.
diff --git a/gettext-tools/src/format-java.c b/gettext-tools/src/format-java.c
index 5135e3a..010a37d 100644
--- a/gettext-tools/src/format-java.c
+++ b/gettext-tools/src/format-java.c
@@ -1,5 +1,5 @@
/* 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
@@ -28,7 +28,7 @@
#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"
@@ -196,7 +196,7 @@ message_format_parse (const char *format, char *fdi, struct spec *spec,
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';
@@ -205,7 +205,7 @@ message_format_parse (const char *format, char *fdi, struct spec *spec,
*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;
@@ -240,7 +240,7 @@ message_format_parse (const char *format, char *fdi, struct spec *spec,
*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;
}
}
@@ -251,7 +251,7 @@ message_format_parse (const char *format, char *fdi, struct spec *spec,
*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;
}
}
@@ -274,7 +274,7 @@ message_format_parse (const char *format, char *fdi, struct spec *spec,
*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;
}
}
@@ -285,7 +285,7 @@ message_format_parse (const char *format, char *fdi, struct spec *spec,
*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;
}
}
@@ -303,7 +303,7 @@ message_format_parse (const char *format, char *fdi, struct spec *spec,
else
{
FDI_SET (format - 1, FMTDIR_ERROR);
- freesa (element_alloced);
+ freea (element_alloced);
return false;
}
}
@@ -314,7 +314,7 @@ message_format_parse (const char *format, char *fdi, struct spec *spec,
*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;
}
}
@@ -323,10 +323,10 @@ message_format_parse (const char *format, char *fdi, struct spec *spec,
*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)
{
@@ -586,7 +586,7 @@ choice_format_parse (const char *format, struct spec *spec,
}
HANDLE_QUOTE;
- msgformat = (char *) xallocsa (strlen (format) + 1);
+ msgformat = (char *) xmalloca (strlen (format) + 1);
mp = msgformat;
while (*format != '\0' && !(!quoting && *format == '|'))
@@ -599,7 +599,7 @@ choice_format_parse (const char *format, struct spec *spec,
msgformat_valid =
message_format_parse (msgformat, NULL, spec, invalid_reason);
- freesa (msgformat);
+ freea (msgformat);
if (!msgformat_valid)
return false;
diff --git a/gettext-tools/src/message.c b/gettext-tools/src/message.c
index 6bacc7f..c608a9b 100644
--- a/gettext-tools/src/message.c
+++ b/gettext-tools/src/message.c
@@ -1,5 +1,5 @@
/* 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>
@@ -30,7 +30,7 @@
#include "fstrcmp.h"
#include "hash.h"
#include "xalloc.h"
-#include "xallocsa.h"
+#include "xmalloca.h"
const char *const format_language[NFORMATS] =
@@ -281,7 +281,7 @@ message_list_hash_insert_entry (hash_table *htable, message_ty *mp)
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);
@@ -297,7 +297,7 @@ message_list_hash_insert_entry (hash_table *htable, message_ty *mp)
found = (hash_insert_entry (htable, key, keylen, mp) == NULL);
if (mp->msgctxt != NULL)
- freesa (alloced_key);
+ freea (alloced_key);
return found;
}
@@ -482,7 +482,7 @@ message_list_search (message_list_ty *mlp,
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);
@@ -500,7 +500,7 @@ message_list_search (message_list_ty *mlp,
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;
diff --git a/gettext-tools/src/msggrep.c b/gettext-tools/src/msggrep.c
index ce07a6c..2405dc1 100644
--- a/gettext-tools/src/msggrep.c
+++ b/gettext-tools/src/msggrep.c
@@ -57,7 +57,7 @@
#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"
@@ -733,7 +733,7 @@ is_message_selected_no_invert (const message_ty *mp)
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++)
@@ -749,7 +749,7 @@ is_message_selected_no_invert (const message_ty *mp)
selected = is_string_selected (3, total_comment, length);
- freesa (total_comment);
+ freea (total_comment);
if (selected)
return true;
@@ -768,7 +768,7 @@ is_message_selected_no_invert (const message_ty *mp)
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++)
@@ -784,7 +784,7 @@ is_message_selected_no_invert (const message_ty *mp)
selected = is_string_selected (4, total_comment, length);
- freesa (total_comment);
+ freea (total_comment);
if (selected)
return true;
diff --git a/gettext-tools/src/msginit.c b/gettext-tools/src/msginit.c
index 8994689..60232cf 100644
--- a/gettext-tools/src/msginit.c
+++ b/gettext-tools/src/msginit.c
@@ -73,7 +73,7 @@
#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"
@@ -1489,7 +1489,7 @@ subst_string (const char *str,
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]);
@@ -1522,7 +1522,7 @@ subst_string (const char *str,
i++;
}
- freesa (substlen);
+ freea (substlen);
}
return str;
diff --git a/gettext-tools/src/msgl-cat.c b/gettext-tools/src/msgl-cat.c
index aa27593..402de70 100644
--- a/gettext-tools/src/msgl-cat.c
+++ b/gettext-tools/src/msgl-cat.c
@@ -40,7 +40,7 @@
#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"
@@ -154,7 +154,7 @@ catenate_msgdomain_list (string_list_ty *file_list,
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';
@@ -179,7 +179,7 @@ present charset \"%s\" is not a portable encoding name"),
charset);
}
- freesa (charset);
+ freea (charset);
if (canon_from_code == NULL)
canon_from_code = canon_charset;
diff --git a/gettext-tools/src/msgl-charset.c b/gettext-tools/src/msgl-charset.c
index 4276458..75ddd00 100644
--- a/gettext-tools/src/msgl-charset.c
+++ b/gettext-tools/src/msgl-charset.c
@@ -34,7 +34,7 @@
#include "error.h"
#include "progname.h"
#include "basename.h"
-#include "xallocsa.h"
+#include "xmalloca.h"
#include "xerror.h"
#include "xvasprintf.h"
#include "message.h"
@@ -78,7 +78,7 @@ compare_po_locale_charsets (const msgdomain_list_ty *mdlp)
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';
@@ -88,7 +88,7 @@ compare_po_locale_charsets (const msgdomain_list_ty *mdlp)
_("\
present charset \"%s\" is not a portable encoding name"),
charset);
- freesa (charset);
+ freea (charset);
if (canon_locale_code != canon_charset)
{
multiline_warning (xasprintf (_("warning: ")),
diff --git a/gettext-tools/src/msgl-iconv.c b/gettext-tools/src/msgl-iconv.c
index 340b826..29d0a43 100644
--- a/gettext-tools/src/msgl-iconv.c
+++ b/gettext-tools/src/msgl-iconv.c
@@ -40,7 +40,7 @@
#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"
@@ -201,7 +201,7 @@ iconv_message_list_internal (message_list_ty *mlp,
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';
@@ -239,7 +239,7 @@ present charset \"%s\" is not a portable encoding name"),
two different charsets \"%s\" and \"%s\" in input file"),
canon_from_code, canon_charset));
}
- freesa (charset);
+ freea (charset);
if (update_header)
{
@@ -503,7 +503,7 @@ is_message_list_iconvable (message_list_ty *mlp,
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';
@@ -519,7 +519,7 @@ is_message_list_iconvable (message_list_ty *mlp,
else
{
/* charset is not a portable encoding name. */
- freesa (charset);
+ freea (charset);
return false;
}
}
@@ -531,11 +531,11 @@ is_message_list_iconvable (message_list_ty *mlp,
else if (canon_from_code != canon_charset)
{
/* Two different charsets in input file. */
- freesa (charset);
+ freea (charset);
return false;
}
}
- freesa (charset);
+ freea (charset);
}
}
}
diff --git a/gettext-tools/src/msgmerge.c b/gettext-tools/src/msgmerge.c
index 986c3ff..6e1894d 100644
--- a/gettext-tools/src/msgmerge.c
+++ b/gettext-tools/src/msgmerge.c
@@ -47,7 +47,7 @@
#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"
@@ -1460,7 +1460,7 @@ merge (const char *fn1, const char *fn2, catalog_input_format_ty input_syntax,
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;
@@ -1498,7 +1498,7 @@ merge (const char *fn1, const char *fn2, catalog_input_format_ty input_syntax,
conversion_done = true;
}
}
- freesa (charset);
+ freea (charset);
}
}
if (!conversion_done)
@@ -1532,7 +1532,7 @@ merge (const char *fn1, const char *fn2, catalog_input_format_ty input_syntax,
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';
@@ -1543,7 +1543,7 @@ merge (const char *fn1, const char *fn2, catalog_input_format_ty input_syntax,
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
diff --git a/gettext-tools/src/po-charset.c b/gettext-tools/src/po-charset.c
index f46cd40..a782512 100644
--- a/gettext-tools/src/po-charset.c
+++ b/gettext-tools/src/po-charset.c
@@ -1,5 +1,5 @@
/* 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
@@ -28,7 +28,7 @@
#include <stdlib.h>
#include <string.h>
-#include "xallocsa.h"
+#include "xmalloca.h"
#include "xvasprintf.h"
#include "po-xerror.h"
#include "basename.h"
@@ -471,7 +471,7 @@ po_lex_charset_set (const char *header_entry, const char *filename)
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';
@@ -629,7 +629,7 @@ would fix this problem.\n");
#endif
}
}
- freesa (charset);
+ freea (charset);
}
else
{
diff --git a/gettext-tools/src/read-tcl.c b/gettext-tools/src/read-tcl.c
index f98a3e0..ee0d223 100644
--- a/gettext-tools/src/read-tcl.c
+++ b/gettext-tools/src/read-tcl.c
@@ -36,7 +36,7 @@
#include "wait-process.h"
#include "read-catalog.h"
#include "read-po.h"
-#include "xallocsa.h"
+#include "xmalloca.h"
#include "error.h"
#include "gettext.h"
@@ -74,7 +74,7 @@ msgdomain_read_tcl (const char *locale_name, const char *directory)
/* 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')
@@ -87,7 +87,7 @@ msgdomain_read_tcl (const char *locale_name, const char *directory)
file_name = concatenated_filename (directory, frobbed_locale_name, ".msg");
- freesa (frobbed_locale_name);
+ freea (frobbed_locale_name);
/* Prepare arguments. */
argv[0] = "tclsh";
diff --git a/gettext-tools/src/write-java.c b/gettext-tools/src/write-java.c
index 9b70a2f..b426bac 100644
--- a/gettext-tools/src/write-java.c
+++ b/gettext-tools/src/write-java.c
@@ -65,7 +65,7 @@
#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"
@@ -146,7 +146,7 @@ compute_hashsize (message_list_ty *mlp, bool *collisionp)
#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;
@@ -263,7 +263,7 @@ compute_hashsize (message_list_ty *mlp, bool *collisionp)
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);
@@ -943,7 +943,7 @@ but the Java ResourceBundle format doesn't support contexts\n")));
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;
@@ -955,11 +955,11 @@ but the Java ResourceBundle format doesn't support contexts\n")));
{
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;
}
@@ -1032,7 +1032,7 @@ compilation of Java class failed, please try --verbose or set $JAVAC"));
for (i = 0; i < ndots; i++)
free (subdirs[i]);
}
- freesa (subdirs);
+ freea (subdirs);
free (class_name);
quit2:
cleanup_temp_dir (tmpdir);
diff --git a/gettext-tools/src/write-mo.c b/gettext-tools/src/write-mo.c
index d16b34a..f14f3b8 100644
--- a/gettext-tools/src/write-mo.c
+++ b/gettext-tools/src/write-mo.c
@@ -45,7 +45,7 @@
#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"
@@ -653,7 +653,7 @@ write_table (FILE *output_file, message_list_ty *mlp)
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;
@@ -684,7 +684,7 @@ write_table (FILE *output_file, message_list_ty *mlp)
+ pre->segmentcount * sizeof (struct segment_pair),
1, output_file);
- freesa (str);
+ freea (str);
}
}
diff --git a/gettext-tools/src/write-po.c b/gettext-tools/src/write-po.c
index 733375e..85bb77e 100644
--- a/gettext-tools/src/write-po.c
+++ b/gettext-tools/src/write-po.c
@@ -1,5 +1,5 @@
/* 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>
@@ -42,7 +42,7 @@
#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
@@ -1453,7 +1453,7 @@ msgdomain_list_print_po (msgdomain_list_ty *mdlp, ostream_t stream,
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;
@@ -1483,7 +1483,7 @@ msgdomain_list_print_po (msgdomain_list_ty *mdlp, ostream_t stream,
}
if (allocated_charset != NULL)
- freesa (allocated_charset);
+ freea (allocated_charset);
}
}
diff --git a/gettext-tools/src/write-tcl.c b/gettext-tools/src/write-tcl.c
index bc16750..1244d41 100644
--- a/gettext-tools/src/write-tcl.c
+++ b/gettext-tools/src/write-tcl.c
@@ -36,7 +36,7 @@
#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"
@@ -194,7 +194,7 @@ but the Tcl message catalog format doesn't support plural handling\n")));
/* 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')
@@ -212,7 +212,7 @@ but the Tcl message catalog format doesn't support plural handling\n")));
{
error (0, errno, _("error while opening \"%s\" for writing"),
file_name);
- freesa (frobbed_locale_name);
+ freea (frobbed_locale_name);
return 1;
}
@@ -223,7 +223,7 @@ but the Tcl message catalog format doesn't support plural handling\n")));
error (EXIT_FAILURE, errno, _("error while writing \"%s\" file"),
file_name);
- freesa (frobbed_locale_name);
+ freea (frobbed_locale_name);
}
return 0;
diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c
index fc0e8dd..6145990 100644
--- a/gettext-tools/src/xgettext.c
+++ b/gettext-tools/src/xgettext.c
@@ -46,7 +46,7 @@
#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"
@@ -1292,7 +1292,7 @@ flag_context_list_table_insert (flag_context_list_table_ty *table,
{
/* 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++)
@@ -1418,7 +1418,7 @@ flag_context_list_table_insert (flag_context_list_table_ty *table,
}
if (allocated_name != NULL)
- freesa (allocated_name);
+ freea (allocated_name);
}
diff --git a/gettext-tools/tests/Makefile.am b/gettext-tools/tests/Makefile.am
index ae9e954..745a88a 100644
--- a/gettext-tools/tests/Makefile.am
+++ b/gettext-tools/tests/Makefile.am
@@ -135,7 +135,7 @@ XGETTEXT = ../src/xgettext
# 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) \