1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-08 17:22:05 +03:00

Update after allocsa -> malloca renaming.

This commit is contained in:
Bruno Haible
2007-06-09 11:11:14 +00:00
parent 8b420b1847
commit 90988ede07
28 changed files with 125 additions and 125 deletions

View File

@@ -1,5 +1,5 @@
/* c-strcasestr.c -- case insensitive substring search in C locale /* c-strcasestr.c -- case insensitive substring search in C locale
Copyright (C) 2005-2006 Free Software Foundation, Inc. Copyright (C) 2005-2007 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2005. Written by Bruno Haible <bruno@clisp.org>, 2005.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
@@ -25,7 +25,7 @@
#include <stddef.h> #include <stddef.h>
#include <string.h> #include <string.h>
#include "allocsa.h" #include "malloca.h"
#include "c-ctype.h" #include "c-ctype.h"
/* Knuth-Morris-Pratt algorithm. /* Knuth-Morris-Pratt algorithm.
@@ -38,7 +38,7 @@ knuth_morris_pratt (const char *haystack, const char *needle,
size_t m = strlen (needle); size_t m = strlen (needle);
/* Allocate the table. */ /* Allocate the table. */
size_t *table = (size_t *) allocsa (m * sizeof (size_t)); size_t *table = (size_t *) malloca (m * sizeof (size_t));
if (table == NULL) if (table == NULL)
return false; return false;
/* Fill the table. /* Fill the table.
@@ -113,7 +113,7 @@ knuth_morris_pratt (const char *haystack, const char *needle,
} }
} }
freesa (table); freea (table);
return true; return true;
} }

View File

@@ -25,7 +25,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "allocsa.h" #include "malloca.h"
/* Knuth-Morris-Pratt algorithm. /* Knuth-Morris-Pratt algorithm.
See http://en.wikipedia.org/wiki/Knuth-Morris-Pratt_algorithm See http://en.wikipedia.org/wiki/Knuth-Morris-Pratt_algorithm
@@ -37,7 +37,7 @@ knuth_morris_pratt (const char *haystack, const char *needle,
size_t m = strlen (needle); size_t m = strlen (needle);
/* Allocate the table. */ /* Allocate the table. */
size_t *table = (size_t *) allocsa (m * sizeof (size_t)); size_t *table = (size_t *) malloca (m * sizeof (size_t));
if (table == NULL) if (table == NULL)
return false; return false;
/* Fill the table. /* Fill the table.
@@ -111,7 +111,7 @@ knuth_morris_pratt (const char *haystack, const char *needle,
} }
} }
freesa (table); freea (table);
return true; return true;
} }

View File

@@ -1,5 +1,5 @@
/* Return the canonical absolute name of a given file. /* Return the canonical absolute name of a given file.
Copyright (C) 1996-2003, 2005-2006 Free Software Foundation, Inc. Copyright (C) 1996-2003, 2005-2007 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
@@ -66,7 +66,7 @@
# define __canonicalize_file_name canonicalize_file_name # define __canonicalize_file_name canonicalize_file_name
# define __realpath rpl_realpath # define __realpath rpl_realpath
# include "pathmax.h" # include "pathmax.h"
# include "allocsa.h" # include "malloca.h"
# if HAVE_GETCWD # if HAVE_GETCWD
# ifdef VMS # ifdef VMS
/* We want the directory in Unix syntax, not in VMS syntax. */ /* We want the directory in Unix syntax, not in VMS syntax. */
@@ -244,7 +244,7 @@ __realpath (const char *name, char *resolved)
goto error; goto error;
} }
buf = allocsa (path_max); buf = malloca (path_max);
if (!buf) if (!buf)
{ {
errno = ENOMEM; errno = ENOMEM;
@@ -255,7 +255,7 @@ __realpath (const char *name, char *resolved)
if (n < 0) if (n < 0)
{ {
int saved_errno = errno; int saved_errno = errno;
freesa (buf); freea (buf);
errno = saved_errno; errno = saved_errno;
goto error; goto error;
} }
@@ -263,10 +263,10 @@ __realpath (const char *name, char *resolved)
if (!extra_buf) if (!extra_buf)
{ {
extra_buf = allocsa (path_max); extra_buf = malloca (path_max);
if (!extra_buf) if (!extra_buf)
{ {
freesa (buf); freea (buf);
errno = ENOMEM; errno = ENOMEM;
goto error; goto error;
} }
@@ -275,7 +275,7 @@ __realpath (const char *name, char *resolved)
len = strlen (end); len = strlen (end);
if ((long int) (n + len) >= path_max) if ((long int) (n + len) >= path_max)
{ {
freesa (buf); freea (buf);
__set_errno (ENAMETOOLONG); __set_errno (ENAMETOOLONG);
goto error; goto error;
} }
@@ -299,7 +299,7 @@ __realpath (const char *name, char *resolved)
*dest = '\0'; *dest = '\0';
if (extra_buf) if (extra_buf)
freesa (extra_buf); freea (extra_buf);
return resolved ? memcpy (resolved, rpath, dest - rpath + 1) : rpath; return resolved ? memcpy (resolved, rpath, dest - rpath + 1) : rpath;
@@ -307,7 +307,7 @@ error:
{ {
int saved_errno = errno; int saved_errno = errno;
if (extra_buf) if (extra_buf)
freesa (extra_buf); freea (extra_buf);
if (resolved) if (resolved)
strcpy (resolved, rpath); strcpy (resolved, rpath);
else else

View File

@@ -40,7 +40,7 @@
#include "pathmax.h" #include "pathmax.h"
#include "tmpdir.h" #include "tmpdir.h"
#include "xalloc.h" #include "xalloc.h"
#include "xallocsa.h" #include "xmalloca.h"
#include "gl_linkedhash_list.h" #include "gl_linkedhash_list.h"
#include "gettext.h" #include "gettext.h"
#if GNULIB_FWRITEERROR #if GNULIB_FWRITEERROR
@@ -327,7 +327,7 @@ create_temp_dir (const char *prefix, const char *parentdir,
false); false);
/* Create the temporary directory. */ /* Create the temporary directory. */
xtemplate = (char *) xallocsa (PATH_MAX); xtemplate = (char *) xmalloca (PATH_MAX);
if (path_search (xtemplate, PATH_MAX, parentdir, prefix, parentdir == NULL)) if (path_search (xtemplate, PATH_MAX, parentdir, prefix, parentdir == NULL))
{ {
error (0, errno, error (0, errno,
@@ -354,11 +354,11 @@ create_temp_dir (const char *prefix, const char *parentdir,
block because then the cleanup handler would not remove the directory block because then the cleanup handler would not remove the directory
if xstrdup fails. */ if xstrdup fails. */
tmpdir->dirname = xstrdup (tmpdirname); tmpdir->dirname = xstrdup (tmpdirname);
freesa (xtemplate); freea (xtemplate);
return (struct temp_dir *) tmpdir; return (struct temp_dir *) tmpdir;
quit: quit:
freesa (xtemplate); freea (xtemplate);
return NULL; return NULL;
} }
@@ -665,14 +665,14 @@ fopen_temp (const char *file_name, const char *mode)
if (supports_delete_on_close ()) if (supports_delete_on_close ())
{ {
size_t mode_len = strlen (mode); size_t mode_len = strlen (mode);
char *augmented_mode = (char *) xallocsa (mode_len + 2); char *augmented_mode = (char *) xmalloca (mode_len + 2);
memcpy (augmented_mode, mode, mode_len); memcpy (augmented_mode, mode, mode_len);
memcpy (augmented_mode + mode_len, "D", 2); memcpy (augmented_mode + mode_len, "D", 2);
fp = fopen (file_name, augmented_mode); fp = fopen (file_name, augmented_mode);
saved_errno = errno; saved_errno = errno;
freesa (augmented_mode); freea (augmented_mode);
} }
else else
#endif #endif

View File

@@ -1,5 +1,5 @@
/* Compile a C# program. /* Compile a C# program.
Copyright (C) 2003-2006 Free Software Foundation, Inc. Copyright (C) 2003-2007 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003. Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
@@ -33,7 +33,7 @@
#include "getline.h" #include "getline.h"
#include "sh-quote.h" #include "sh-quote.h"
#include "safe-read.h" #include "safe-read.h"
#include "xallocsa.h" #include "xmalloca.h"
#include "error.h" #include "error.h"
#include "gettext.h" #include "gettext.h"
@@ -102,7 +102,7 @@ compile_csharp_using_pnet (const char * const *sources,
1 + (output_is_library ? 1 : 0) + 2 + 2 * libdirs_count 1 + (output_is_library ? 1 : 0) + 2 + 2 * libdirs_count
+ 2 * libraries_count + (optimize ? 1 : 0) + (debug ? 1 : 0) + 2 * libraries_count + (optimize ? 1 : 0) + (debug ? 1 : 0)
+ sources_count; + sources_count;
argv = (char **) xallocsa ((argc + 1) * sizeof (char *)); argv = (char **) xmalloca ((argc + 1) * sizeof (char *));
argp = argv; argp = argv;
*argp++ = "cscc"; *argp++ = "cscc";
@@ -131,7 +131,7 @@ compile_csharp_using_pnet (const char * const *sources,
&& memcmp (source_file + strlen (source_file) - 10, ".resources", && memcmp (source_file + strlen (source_file) - 10, ".resources",
10) == 0) 10) == 0)
{ {
char *option = (char *) xallocsa (12 + strlen (source_file) + 1); char *option = (char *) xmalloca (12 + strlen (source_file) + 1);
memcpy (option, "-fresources=", 12); memcpy (option, "-fresources=", 12);
strcpy (option + 12, source_file); strcpy (option + 12, source_file);
@@ -157,8 +157,8 @@ compile_csharp_using_pnet (const char * const *sources,
for (i = 0; i < sources_count; i++) for (i = 0; i < sources_count; i++)
if (argv[argc - sources_count + i] != sources[i]) if (argv[argc - sources_count + i] != sources[i])
freesa (argv[argc - sources_count + i]); freea (argv[argc - sources_count + i]);
freesa (argv); freea (argv);
return (exitstatus != 0); return (exitstatus != 0);
} }
@@ -214,28 +214,28 @@ compile_csharp_using_mono (const char * const *sources,
argc = argc =
1 + (output_is_library ? 1 : 0) + 1 + libdirs_count + libraries_count 1 + (output_is_library ? 1 : 0) + 1 + libdirs_count + libraries_count
+ (debug ? 1 : 0) + sources_count; + (debug ? 1 : 0) + sources_count;
argv = (char **) xallocsa ((argc + 1) * sizeof (char *)); argv = (char **) xmalloca ((argc + 1) * sizeof (char *));
argp = argv; argp = argv;
*argp++ = "mcs"; *argp++ = "mcs";
if (output_is_library) if (output_is_library)
*argp++ = "-target:library"; *argp++ = "-target:library";
{ {
char *option = (char *) xallocsa (5 + strlen (output_file) + 1); char *option = (char *) xmalloca (5 + strlen (output_file) + 1);
memcpy (option, "-out:", 5); memcpy (option, "-out:", 5);
strcpy (option + 5, output_file); strcpy (option + 5, output_file);
*argp++ = option; *argp++ = option;
} }
for (i = 0; i < libdirs_count; i++) for (i = 0; i < libdirs_count; i++)
{ {
char *option = (char *) xallocsa (5 + strlen (libdirs[i]) + 1); char *option = (char *) xmalloca (5 + strlen (libdirs[i]) + 1);
memcpy (option, "-lib:", 5); memcpy (option, "-lib:", 5);
strcpy (option + 5, libdirs[i]); strcpy (option + 5, libdirs[i]);
*argp++ = option; *argp++ = option;
} }
for (i = 0; i < libraries_count; i++) for (i = 0; i < libraries_count; i++)
{ {
char *option = (char *) xallocsa (11 + strlen (libraries[i]) + 4 + 1); char *option = (char *) xmalloca (11 + strlen (libraries[i]) + 4 + 1);
memcpy (option, "-reference:", 11); memcpy (option, "-reference:", 11);
memcpy (option + 11, libraries[i], strlen (libraries[i])); memcpy (option + 11, libraries[i], strlen (libraries[i]));
strcpy (option + 11 + strlen (libraries[i]), ".dll"); strcpy (option + 11 + strlen (libraries[i]), ".dll");
@@ -250,7 +250,7 @@ compile_csharp_using_mono (const char * const *sources,
&& memcmp (source_file + strlen (source_file) - 10, ".resources", && memcmp (source_file + strlen (source_file) - 10, ".resources",
10) == 0) 10) == 0)
{ {
char *option = (char *) xallocsa (10 + strlen (source_file) + 1); char *option = (char *) xmalloca (10 + strlen (source_file) + 1);
memcpy (option, "-resource:", 10); memcpy (option, "-resource:", 10);
strcpy (option + 10, source_file); strcpy (option + 10, source_file);
@@ -308,11 +308,11 @@ compile_csharp_using_mono (const char * const *sources,
i < 1 + (output_is_library ? 1 : 0) i < 1 + (output_is_library ? 1 : 0)
+ 1 + libdirs_count + libraries_count; + 1 + libdirs_count + libraries_count;
i++) i++)
freesa (argv[i]); freea (argv[i]);
for (i = 0; i < sources_count; i++) for (i = 0; i < sources_count; i++)
if (argv[argc - sources_count + i] != sources[i]) if (argv[argc - sources_count + i] != sources[i])
freesa (argv[argc - sources_count + i]); freea (argv[argc - sources_count + i]);
freesa (argv); freea (argv);
return (exitstatus != 0); return (exitstatus != 0);
} }
@@ -396,28 +396,28 @@ compile_csharp_using_sscli (const char * const *sources,
argc = argc =
1 + 1 + 1 + libdirs_count + libraries_count 1 + 1 + 1 + libdirs_count + libraries_count
+ (optimize ? 1 : 0) + (debug ? 1 : 0) + sources_count; + (optimize ? 1 : 0) + (debug ? 1 : 0) + sources_count;
argv = (char **) xallocsa ((argc + 1) * sizeof (char *)); argv = (char **) xmalloca ((argc + 1) * sizeof (char *));
argp = argv; argp = argv;
*argp++ = "csc"; *argp++ = "csc";
*argp++ = *argp++ =
(char *) (output_is_library ? "-target:library" : "-target:exe"); (char *) (output_is_library ? "-target:library" : "-target:exe");
{ {
char *option = (char *) xallocsa (5 + strlen (output_file) + 1); char *option = (char *) xmalloca (5 + strlen (output_file) + 1);
memcpy (option, "-out:", 5); memcpy (option, "-out:", 5);
strcpy (option + 5, output_file); strcpy (option + 5, output_file);
*argp++ = option; *argp++ = option;
} }
for (i = 0; i < libdirs_count; i++) for (i = 0; i < libdirs_count; i++)
{ {
char *option = (char *) xallocsa (5 + strlen (libdirs[i]) + 1); char *option = (char *) xmalloca (5 + strlen (libdirs[i]) + 1);
memcpy (option, "-lib:", 5); memcpy (option, "-lib:", 5);
strcpy (option + 5, libdirs[i]); strcpy (option + 5, libdirs[i]);
*argp++ = option; *argp++ = option;
} }
for (i = 0; i < libraries_count; i++) for (i = 0; i < libraries_count; i++)
{ {
char *option = (char *) xallocsa (11 + strlen (libraries[i]) + 4 + 1); char *option = (char *) xmalloca (11 + strlen (libraries[i]) + 4 + 1);
memcpy (option, "-reference:", 11); memcpy (option, "-reference:", 11);
memcpy (option + 11, libraries[i], strlen (libraries[i])); memcpy (option + 11, libraries[i], strlen (libraries[i]));
strcpy (option + 11 + strlen (libraries[i]), ".dll"); strcpy (option + 11 + strlen (libraries[i]), ".dll");
@@ -434,7 +434,7 @@ compile_csharp_using_sscli (const char * const *sources,
&& memcmp (source_file + strlen (source_file) - 10, ".resources", && memcmp (source_file + strlen (source_file) - 10, ".resources",
10) == 0) 10) == 0)
{ {
char *option = (char *) xallocsa (10 + strlen (source_file) + 1); char *option = (char *) xmalloca (10 + strlen (source_file) + 1);
memcpy (option, "-resource:", 10); memcpy (option, "-resource:", 10);
strcpy (option + 10, source_file); strcpy (option + 10, source_file);
@@ -459,11 +459,11 @@ compile_csharp_using_sscli (const char * const *sources,
true, true); true, true);
for (i = 2; i < 3 + libdirs_count + libraries_count; i++) for (i = 2; i < 3 + libdirs_count + libraries_count; i++)
freesa (argv[i]); freea (argv[i]);
for (i = 0; i < sources_count; i++) for (i = 0; i < sources_count; i++)
if (argv[argc - sources_count + i] != sources[i]) if (argv[argc - sources_count + i] != sources[i])
freesa (argv[argc - sources_count + i]); freea (argv[argc - sources_count + i]);
freesa (argv); freea (argv);
return (exitstatus != 0); return (exitstatus != 0);
} }

View File

@@ -1,5 +1,5 @@
/* Execute a C# program. /* Execute a C# program.
Copyright (C) 2003-2006 Free Software Foundation, Inc. Copyright (C) 2003-2007 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003. Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
@@ -27,7 +27,7 @@
#include "execute.h" #include "execute.h"
#include "sh-quote.h" #include "sh-quote.h"
#include "xallocsa.h" #include "xmalloca.h"
#include "error.h" #include "error.h"
#include "gettext.h" #include "gettext.h"
@@ -124,7 +124,7 @@ execute_csharp_using_pnet (const char *assembly_path,
bool err; bool err;
argc = 1 + 2 * libdirs_count + 1 + nargs; argc = 1 + 2 * libdirs_count + 1 + nargs;
argv = (char **) xallocsa ((argc + 1) * sizeof (char *)); argv = (char **) xmalloca ((argc + 1) * sizeof (char *));
argp = argv; argp = argv;
*argp++ = "ilrun"; *argp++ = "ilrun";
@@ -150,7 +150,7 @@ execute_csharp_using_pnet (const char *assembly_path,
err = executer ("ilrun", "ilrun", argv, private_data); err = executer ("ilrun", "ilrun", argv, private_data);
freesa (argv); freea (argv);
return err; return err;
} }
@@ -188,7 +188,7 @@ execute_csharp_using_mono (const char *assembly_path,
if (mono_present) if (mono_present)
{ {
char *old_monopath; char *old_monopath;
char **argv = (char **) xallocsa ((2 + nargs + 1) * sizeof (char *)); char **argv = (char **) xmalloca ((2 + nargs + 1) * sizeof (char *));
unsigned int i; unsigned int i;
bool err; bool err;
@@ -212,7 +212,7 @@ execute_csharp_using_mono (const char *assembly_path,
/* Reset MONO_PATH. */ /* Reset MONO_PATH. */
reset_monopath (old_monopath); reset_monopath (old_monopath);
freesa (argv); freea (argv);
return err; return err;
} }
@@ -249,7 +249,7 @@ execute_csharp_using_sscli (const char *assembly_path,
if (clix_present) if (clix_present)
{ {
char *old_clixpath; char *old_clixpath;
char **argv = (char **) xallocsa ((2 + nargs + 1) * sizeof (char *)); char **argv = (char **) xmalloca ((2 + nargs + 1) * sizeof (char *));
unsigned int i; unsigned int i;
bool err; bool err;
@@ -273,7 +273,7 @@ execute_csharp_using_sscli (const char *assembly_path,
/* Reset clix' PATH variable. */ /* Reset clix' PATH variable. */
reset_clixpath (old_clixpath); reset_clixpath (old_clixpath);
freesa (argv); freea (argv);
return err; return err;
} }

View File

@@ -41,7 +41,7 @@
#include "binary-io.h" #include "binary-io.h"
#include "safe-read.h" #include "safe-read.h"
#include "xalloc.h" #include "xalloc.h"
#include "xallocsa.h" #include "xmalloca.h"
#include "getline.h" #include "getline.h"
#include "filename.h" #include "filename.h"
#include "fwriteerror.h" #include "fwriteerror.h"
@@ -230,7 +230,7 @@ compile_using_envjavac (const char *javac,
command_length += 1 + shell_quote_length (java_sources[i]); command_length += 1 + shell_quote_length (java_sources[i]);
command_length += 1; command_length += 1;
command = (char *) xallocsa (command_length); command = (char *) xmalloca (command_length);
p = command; p = command;
/* Don't shell_quote $JAVAC, because it may consist of a command /* Don't shell_quote $JAVAC, because it may consist of a command
and options. */ and options. */
@@ -273,7 +273,7 @@ compile_using_envjavac (const char *javac,
null_stderr, true, true); null_stderr, true, true);
err = (exitstatus != 0); err = (exitstatus != 0);
freesa (command); freea (command);
return err; return err;
} }
@@ -303,7 +303,7 @@ compile_using_gcj (const char * const *java_sources,
2 + (no_assert_option ? 1 : 0) + (fsource_option ? 1 : 0) 2 + (no_assert_option ? 1 : 0) + (fsource_option ? 1 : 0)
+ (ftarget_option ? 1 : 0) + (optimize ? 1 : 0) + (debug ? 1 : 0) + (ftarget_option ? 1 : 0) + (optimize ? 1 : 0) + (debug ? 1 : 0)
+ (directory != NULL ? 2 : 0) + java_sources_count; + (directory != NULL ? 2 : 0) + java_sources_count;
argv = (char **) xallocsa ((argc + 1) * sizeof (char *)); argv = (char **) xmalloca ((argc + 1) * sizeof (char *));
argp = argv; argp = argv;
*argp++ = "gcj"; *argp++ = "gcj";
@@ -312,7 +312,7 @@ compile_using_gcj (const char * const *java_sources,
*argp++ = "-fno-assert"; *argp++ = "-fno-assert";
if (fsource_option) if (fsource_option)
{ {
fsource_arg = (char *) xallocsa (9 + strlen (source_version) + 1); fsource_arg = (char *) xmalloca (9 + strlen (source_version) + 1);
memcpy (fsource_arg, "-fsource=", 9); memcpy (fsource_arg, "-fsource=", 9);
strcpy (fsource_arg + 9, source_version); strcpy (fsource_arg + 9, source_version);
*argp++ = fsource_arg; *argp++ = fsource_arg;
@@ -321,7 +321,7 @@ compile_using_gcj (const char * const *java_sources,
fsource_arg = NULL; fsource_arg = NULL;
if (ftarget_option) if (ftarget_option)
{ {
ftarget_arg = (char *) xallocsa (9 + strlen (target_version) + 1); ftarget_arg = (char *) xmalloca (9 + strlen (target_version) + 1);
memcpy (ftarget_arg, "-ftarget=", 9); memcpy (ftarget_arg, "-ftarget=", 9);
strcpy (ftarget_arg + 9, target_version); strcpy (ftarget_arg + 9, target_version);
*argp++ = ftarget_arg; *argp++ = ftarget_arg;
@@ -356,10 +356,10 @@ compile_using_gcj (const char * const *java_sources,
err = (exitstatus != 0); err = (exitstatus != 0);
if (ftarget_arg != NULL) if (ftarget_arg != NULL)
freesa (ftarget_arg); freea (ftarget_arg);
if (fsource_arg != NULL) if (fsource_arg != NULL)
freesa (fsource_arg); freea (fsource_arg);
freesa (argv); freea (argv);
return err; return err;
} }
@@ -385,7 +385,7 @@ compile_using_javac (const char * const *java_sources,
argc = argc =
1 + (source_option ? 2 : 0) + (target_option ? 2 : 0) + (optimize ? 1 : 0) 1 + (source_option ? 2 : 0) + (target_option ? 2 : 0) + (optimize ? 1 : 0)
+ (debug ? 1 : 0) + (directory != NULL ? 2 : 0) + java_sources_count; + (debug ? 1 : 0) + (directory != NULL ? 2 : 0) + java_sources_count;
argv = (char **) xallocsa ((argc + 1) * sizeof (char *)); argv = (char **) xmalloca ((argc + 1) * sizeof (char *));
argp = argv; argp = argv;
*argp++ = "javac"; *argp++ = "javac";
@@ -426,7 +426,7 @@ compile_using_javac (const char * const *java_sources,
null_stderr, true, true); null_stderr, true, true);
err = (exitstatus != 0); err = (exitstatus != 0);
freesa (argv); freea (argv);
return err; return err;
} }
@@ -450,7 +450,7 @@ compile_using_jikes (const char * const *java_sources,
argc = argc =
1 + (optimize ? 1 : 0) + (debug ? 1 : 0) + (directory != NULL ? 2 : 0) 1 + (optimize ? 1 : 0) + (debug ? 1 : 0) + (directory != NULL ? 2 : 0)
+ java_sources_count; + java_sources_count;
argv = (char **) xallocsa ((argc + 1) * sizeof (char *)); argv = (char **) xmalloca ((argc + 1) * sizeof (char *));
argp = argv; argp = argv;
*argp++ = "jikes"; *argp++ = "jikes";
@@ -481,7 +481,7 @@ compile_using_jikes (const char * const *java_sources,
null_stderr, true, true); null_stderr, true, true);
err = (exitstatus != 0); err = (exitstatus != 0);
freesa (argv); freea (argv);
return err; return err;
} }
@@ -566,7 +566,7 @@ is_envjavac_gcj (const char *javac)
/* Setup the command "$JAVAC --version". */ /* Setup the command "$JAVAC --version". */
command_length = strlen (javac) + 1 + 9 + 1; command_length = strlen (javac) + 1 + 9 + 1;
command = (char *) xallocsa (command_length); command = (char *) xmalloca (command_length);
p = command; p = command;
/* Don't shell_quote $JAVAC, because it may consist of a command /* Don't shell_quote $JAVAC, because it may consist of a command
and options. */ and options. */
@@ -612,7 +612,7 @@ is_envjavac_gcj (const char *javac)
envjavac_gcj = false; envjavac_gcj = false;
failed: failed:
freesa (command); freea (command);
envjavac_tested = true; envjavac_tested = true;
} }
@@ -647,7 +647,7 @@ is_envjavac_gcj43 (const char *javac)
/* Setup the command "$JAVAC --version". */ /* Setup the command "$JAVAC --version". */
command_length = strlen (javac) + 1 + 9 + 1; command_length = strlen (javac) + 1 + 9 + 1;
command = (char *) xallocsa (command_length); command = (char *) xmalloca (command_length);
p = command; p = command;
/* Don't shell_quote $JAVAC, because it may consist of a command /* Don't shell_quote $JAVAC, because it may consist of a command
and options. */ and options. */
@@ -696,7 +696,7 @@ is_envjavac_gcj43 (const char *javac)
envjavac_gcj43 = false; envjavac_gcj43 = false;
failed: failed:
freesa (command); freea (command);
envjavac_tested = true; envjavac_tested = true;
} }

View File

@@ -32,7 +32,7 @@
#include "sh-quote.h" #include "sh-quote.h"
#include "filename.h" #include "filename.h"
#include "xalloc.h" #include "xalloc.h"
#include "xallocsa.h" #include "xmalloca.h"
#include "error.h" #include "error.h"
#include "gettext.h" #include "gettext.h"
@@ -97,7 +97,7 @@ execute_java_class (const char *class_name,
{ {
char *exe_pathname = concatenated_filename (exe_dir, class_name, EXEEXT); char *exe_pathname = concatenated_filename (exe_dir, class_name, EXEEXT);
char *old_classpath; char *old_classpath;
char **argv = (char **) xallocsa ((1 + nargs + 1) * sizeof (char *)); char **argv = (char **) xmalloca ((1 + nargs + 1) * sizeof (char *));
unsigned int i; unsigned int i;
/* Set CLASSPATH. */ /* Set CLASSPATH. */
@@ -121,7 +121,7 @@ execute_java_class (const char *class_name,
/* Reset CLASSPATH. */ /* Reset CLASSPATH. */
reset_classpath (old_classpath); reset_classpath (old_classpath);
freesa (argv); freea (argv);
goto done1; goto done1;
} }
@@ -152,7 +152,7 @@ execute_java_class (const char *class_name,
command_length += 1 + shell_quote_length (*arg); command_length += 1 + shell_quote_length (*arg);
command_length += 1; command_length += 1;
command = (char *) xallocsa (command_length); command = (char *) xmalloca (command_length);
p = command; p = command;
/* Don't shell_quote $JAVA, because it may consist of a command /* Don't shell_quote $JAVA, because it may consist of a command
and options. */ and options. */
@@ -179,7 +179,7 @@ execute_java_class (const char *class_name,
argv[3] = NULL; argv[3] = NULL;
err = executer (java, "/bin/sh", argv, private_data); err = executer (java, "/bin/sh", argv, private_data);
freesa (command); freea (command);
/* Reset CLASSPATH. */ /* Reset CLASSPATH. */
reset_classpath (old_classpath); reset_classpath (old_classpath);
@@ -218,7 +218,7 @@ execute_java_class (const char *class_name,
if (gij_present) if (gij_present)
{ {
char *old_classpath; char *old_classpath;
char **argv = (char **) xallocsa ((2 + nargs + 1) * sizeof (char *)); char **argv = (char **) xmalloca ((2 + nargs + 1) * sizeof (char *));
unsigned int i; unsigned int i;
/* Set CLASSPATH. */ /* Set CLASSPATH. */
@@ -243,7 +243,7 @@ execute_java_class (const char *class_name,
/* Reset CLASSPATH. */ /* Reset CLASSPATH. */
reset_classpath (old_classpath); reset_classpath (old_classpath);
freesa (argv); freea (argv);
goto done2; goto done2;
} }
@@ -271,7 +271,7 @@ execute_java_class (const char *class_name,
if (java_present) if (java_present)
{ {
char *old_classpath; char *old_classpath;
char **argv = (char **) xallocsa ((2 + nargs + 1) * sizeof (char *)); char **argv = (char **) xmalloca ((2 + nargs + 1) * sizeof (char *));
unsigned int i; unsigned int i;
/* Set CLASSPATH. We don't use the "-classpath ..." option because /* Set CLASSPATH. We don't use the "-classpath ..." option because
@@ -298,7 +298,7 @@ execute_java_class (const char *class_name,
/* Reset CLASSPATH. */ /* Reset CLASSPATH. */
reset_classpath (old_classpath); reset_classpath (old_classpath);
freesa (argv); freea (argv);
goto done2; goto done2;
} }
@@ -325,7 +325,7 @@ execute_java_class (const char *class_name,
if (jre_present) if (jre_present)
{ {
char *old_classpath; char *old_classpath;
char **argv = (char **) xallocsa ((2 + nargs + 1) * sizeof (char *)); char **argv = (char **) xmalloca ((2 + nargs + 1) * sizeof (char *));
unsigned int i; unsigned int i;
/* Set CLASSPATH. We don't use the "-classpath ..." option because /* Set CLASSPATH. We don't use the "-classpath ..." option because
@@ -352,7 +352,7 @@ execute_java_class (const char *class_name,
/* Reset CLASSPATH. */ /* Reset CLASSPATH. */
reset_classpath (old_classpath); reset_classpath (old_classpath);
freesa (argv); freea (argv);
goto done2; goto done2;
} }
@@ -382,7 +382,7 @@ execute_java_class (const char *class_name,
if (jview_present) if (jview_present)
{ {
char *old_classpath; char *old_classpath;
char **argv = (char **) xallocsa ((2 + nargs + 1) * sizeof (char *)); char **argv = (char **) xmalloca ((2 + nargs + 1) * sizeof (char *));
unsigned int i; unsigned int i;
/* Set CLASSPATH. */ /* Set CLASSPATH. */
@@ -407,7 +407,7 @@ execute_java_class (const char *class_name,
/* Reset CLASSPATH. */ /* Reset CLASSPATH. */
reset_classpath (old_classpath); reset_classpath (old_classpath);
freesa (argv); freea (argv);
goto done2; goto done2;
} }

View File

@@ -25,7 +25,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> /* for NULL, in case a nonstandard string.h lacks it */ #include <stddef.h> /* for NULL, in case a nonstandard string.h lacks it */
#include "allocsa.h" #include "malloca.h"
#if HAVE_MBRTOWC #if HAVE_MBRTOWC
# include "mbuiter.h" # include "mbuiter.h"
#endif #endif
@@ -43,7 +43,7 @@ knuth_morris_pratt_unibyte (const char *haystack, const char *needle,
size_t m = strlen (needle); size_t m = strlen (needle);
/* Allocate the table. */ /* Allocate the table. */
size_t *table = (size_t *) allocsa (m * sizeof (size_t)); size_t *table = (size_t *) malloca (m * sizeof (size_t));
if (table == NULL) if (table == NULL)
return false; return false;
/* Fill the table. /* Fill the table.
@@ -118,7 +118,7 @@ knuth_morris_pratt_unibyte (const char *haystack, const char *needle,
} }
} }
freesa (table); freea (table);
return true; return true;
} }
@@ -132,7 +132,7 @@ knuth_morris_pratt_multibyte (const char *haystack, const char *needle,
size_t *table; size_t *table;
/* Allocate room for needle_mbchars and the table. */ /* Allocate room for needle_mbchars and the table. */
char *memory = (char *) allocsa (m * (sizeof (mbchar_t) + sizeof (size_t))); char *memory = (char *) malloca (m * (sizeof (mbchar_t) + sizeof (size_t)));
if (memory == NULL) if (memory == NULL)
return false; return false;
needle_mbchars = (mbchar_t *) memory; needle_mbchars = (mbchar_t *) memory;
@@ -238,7 +238,7 @@ knuth_morris_pratt_multibyte (const char *haystack, const char *needle,
} }
} }
freesa (memory); freea (memory);
return true; return true;
} }
#endif #endif

View File

@@ -24,7 +24,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> /* for NULL, in case a nonstandard string.h lacks it */ #include <stddef.h> /* for NULL, in case a nonstandard string.h lacks it */
#include "allocsa.h" #include "malloca.h"
#if HAVE_MBRTOWC #if HAVE_MBRTOWC
# include "mbuiter.h" # include "mbuiter.h"
#endif #endif
@@ -40,7 +40,7 @@ knuth_morris_pratt_unibyte (const char *haystack, const char *needle,
size_t m = strlen (needle); size_t m = strlen (needle);
/* Allocate the table. */ /* Allocate the table. */
size_t *table = (size_t *) allocsa (m * sizeof (size_t)); size_t *table = (size_t *) malloca (m * sizeof (size_t));
if (table == NULL) if (table == NULL)
return false; return false;
/* Fill the table. /* Fill the table.
@@ -114,7 +114,7 @@ knuth_morris_pratt_unibyte (const char *haystack, const char *needle,
} }
} }
freesa (table); freea (table);
return true; return true;
} }
@@ -128,7 +128,7 @@ knuth_morris_pratt_multibyte (const char *haystack, const char *needle,
size_t *table; size_t *table;
/* Allocate room for needle_mbchars and the table. */ /* Allocate room for needle_mbchars and the table. */
char *memory = (char *) allocsa (m * (sizeof (mbchar_t) + sizeof (size_t))); char *memory = (char *) malloca (m * (sizeof (mbchar_t) + sizeof (size_t)));
if (memory == NULL) if (memory == NULL)
return false; return false;
needle_mbchars = (mbchar_t *) memory; needle_mbchars = (mbchar_t *) memory;
@@ -223,7 +223,7 @@ knuth_morris_pratt_multibyte (const char *haystack, const char *needle,
} }
} }
freesa (memory); freea (memory);
return true; return true;
} }
#endif #endif

View File

@@ -23,10 +23,10 @@
-> xreadlink -> xreadlink
-> readlink -> readlink
-> canonicalize-lgpl -> canonicalize-lgpl
-> allocsa -> malloca
-> relocatable -> relocatable
-> setenv -> setenv
-> allocsa -> malloca
-> strerror -> strerror
-> c-ctype -> c-ctype

View File

@@ -34,7 +34,7 @@
#if _LIBC || !HAVE_SETENV #if _LIBC || !HAVE_SETENV
#if !_LIBC #if !_LIBC
# include "allocsa.h" # include "malloca.h"
#endif #endif
#if !_LIBC #if !_LIBC
@@ -162,7 +162,7 @@ __add_to_environ (const char *name, const char *value, const char *combined,
__mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1), __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1),
value, vallen); value, vallen);
# else # else
new_value = (char *) allocsa (namelen + 1 + vallen); new_value = (char *) malloca (namelen + 1 + vallen);
if (new_value == NULL) if (new_value == NULL)
{ {
__set_errno (ENOMEM); __set_errno (ENOMEM);
@@ -182,7 +182,7 @@ __add_to_environ (const char *name, const char *value, const char *combined,
if (new_environ[size] == NULL) if (new_environ[size] == NULL)
{ {
#if defined USE_TSEARCH && !defined _LIBC #if defined USE_TSEARCH && !defined _LIBC
freesa (new_value); freea (new_value);
#endif #endif
__set_errno (ENOMEM); __set_errno (ENOMEM);
UNLOCK; UNLOCK;
@@ -202,7 +202,7 @@ __add_to_environ (const char *name, const char *value, const char *combined,
STORE_VALUE (new_environ[size]); STORE_VALUE (new_environ[size]);
} }
#if defined USE_TSEARCH && !defined _LIBC #if defined USE_TSEARCH && !defined _LIBC
freesa (new_value); freea (new_value);
#endif #endif
} }
@@ -230,7 +230,7 @@ __add_to_environ (const char *name, const char *value, const char *combined,
__mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1), __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1),
value, vallen); value, vallen);
# else # else
new_value = allocsa (namelen + 1 + vallen); new_value = malloca (namelen + 1 + vallen);
if (new_value == NULL) if (new_value == NULL)
{ {
__set_errno (ENOMEM); __set_errno (ENOMEM);
@@ -250,7 +250,7 @@ __add_to_environ (const char *name, const char *value, const char *combined,
if (np == NULL) if (np == NULL)
{ {
#if defined USE_TSEARCH && !defined _LIBC #if defined USE_TSEARCH && !defined _LIBC
freesa (new_value); freea (new_value);
#endif #endif
__set_errno (ENOMEM); __set_errno (ENOMEM);
UNLOCK; UNLOCK;
@@ -268,7 +268,7 @@ __add_to_environ (const char *name, const char *value, const char *combined,
STORE_VALUE (np); STORE_VALUE (np);
} }
#if defined USE_TSEARCH && !defined _LIBC #if defined USE_TSEARCH && !defined _LIBC
freesa (new_value); freea (new_value);
#endif #endif
} }

View File

@@ -25,7 +25,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> /* for NULL, in case a nonstandard string.h lacks it */ #include <stddef.h> /* for NULL, in case a nonstandard string.h lacks it */
#include "allocsa.h" #include "malloca.h"
#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) #define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
@@ -39,7 +39,7 @@ knuth_morris_pratt (const char *haystack, const char *needle,
size_t m = strlen (needle); size_t m = strlen (needle);
/* Allocate the table. */ /* Allocate the table. */
size_t *table = (size_t *) allocsa (m * sizeof (size_t)); size_t *table = (size_t *) malloca (m * sizeof (size_t));
if (table == NULL) if (table == NULL)
return false; return false;
/* Fill the table. /* Fill the table.
@@ -114,7 +114,7 @@ knuth_morris_pratt (const char *haystack, const char *needle,
} }
} }
freesa (table); freea (table);
return true; return true;
} }

View File

@@ -25,7 +25,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "allocsa.h" #include "malloca.h"
#include "c-strcase.h" #include "c-strcase.h"
#define SIZEOF(a) (sizeof(a)/sizeof(a[0])) #define SIZEOF(a) (sizeof(a)/sizeof(a[0]))
@@ -231,7 +231,7 @@ mem_iconveha (const char *src, size_t srclen,
{ {
int retval; int retval;
size_t len = strlen (to_codeset); size_t len = strlen (to_codeset);
char *to_codeset_suffixed = (char *) allocsa (len + 10 + 1); char *to_codeset_suffixed = (char *) malloca (len + 10 + 1);
memcpy (to_codeset_suffixed, to_codeset, len); memcpy (to_codeset_suffixed, to_codeset, len);
memcpy (to_codeset_suffixed + len, "//TRANSLIT", 10 + 1); memcpy (to_codeset_suffixed + len, "//TRANSLIT", 10 + 1);
@@ -239,7 +239,7 @@ mem_iconveha (const char *src, size_t srclen,
from_codeset, to_codeset_suffixed, from_codeset, to_codeset_suffixed,
handler, offsets, resultp, lengthp); handler, offsets, resultp, lengthp);
freesa (to_codeset_suffixed); freea (to_codeset_suffixed);
return retval; return retval;
} }
@@ -331,14 +331,14 @@ str_iconveha (const char *src,
{ {
char *result; char *result;
size_t len = strlen (to_codeset); size_t len = strlen (to_codeset);
char *to_codeset_suffixed = (char *) allocsa (len + 10 + 1); char *to_codeset_suffixed = (char *) malloca (len + 10 + 1);
memcpy (to_codeset_suffixed, to_codeset, len); memcpy (to_codeset_suffixed, to_codeset, len);
memcpy (to_codeset_suffixed + len, "//TRANSLIT", 10 + 1); memcpy (to_codeset_suffixed + len, "//TRANSLIT", 10 + 1);
result = str_iconveha_notranslit (src, from_codeset, to_codeset_suffixed, result = str_iconveha_notranslit (src, from_codeset, to_codeset_suffixed,
handler); handler);
freesa (to_codeset_suffixed); freea (to_codeset_suffixed);
return result; return result;
} }

View File

@@ -8,7 +8,7 @@ lib/c-strcasestr.c
Depends-on: Depends-on:
c-ctype c-ctype
stdbool stdbool
allocsa malloca
strnlen strnlen
configure.ac: configure.ac:

View File

@@ -7,7 +7,7 @@ lib/c-strstr.c
Depends-on: Depends-on:
stdbool stdbool
allocsa malloca
strnlen strnlen
configure.ac: configure.ac:

View File

@@ -8,7 +8,7 @@ m4/canonicalize-lgpl.m4
Depends-on: Depends-on:
alloca-opt alloca-opt
allocsa malloca
pathmax pathmax
readlink readlink

View File

@@ -14,7 +14,7 @@ pathmax
tmpdir tmpdir
mkdtemp mkdtemp
xalloc xalloc
xallocsa xmalloca
linkedhash-list linkedhash-list
gettext-h gettext-h

View File

@@ -7,7 +7,7 @@ lib/csharpcomp.c
Depends-on: Depends-on:
stdbool stdbool
xallocsa xmalloca
execute execute
pipe pipe
wait-process wait-process

View File

@@ -13,7 +13,7 @@ execute
xsetenv xsetenv
sh-quote sh-quote
xalloc xalloc
xallocsa xmalloca
error error
gettext-h gettext-h
csharpexec-script csharpexec-script

View File

@@ -18,7 +18,7 @@ sh-quote
binary-io binary-io
safe-read safe-read
xalloc xalloc
xallocsa xmalloca
getline getline
filename filename
fwriteerror fwriteerror

View File

@@ -13,7 +13,7 @@ xsetenv
sh-quote sh-quote
filename filename
xalloc xalloc
xallocsa xmalloca
error error
gettext-h gettext-h
javaexec-script javaexec-script

View File

@@ -11,7 +11,7 @@ mbuiter
stdbool stdbool
string string
mbslen mbslen
allocsa malloca
strnlen strnlen
configure.ac: configure.ac:

View File

@@ -11,7 +11,7 @@ mbuiter
stdbool stdbool
string string
mbslen mbslen
allocsa malloca
strnlen strnlen
configure.ac: configure.ac:

View File

@@ -13,8 +13,8 @@ lib/xreadlink.c
lib/readlink.c lib/readlink.c
lib/canonicalize.h lib/canonicalize.h
lib/canonicalize-lgpl.c lib/canonicalize-lgpl.c
lib/allocsa.h lib/malloca.h
lib/allocsa.c lib/malloca.c
lib/relocatable.h lib/relocatable.h
lib/relocatable.c lib/relocatable.c
lib/setenv.h lib/setenv.h
@@ -22,7 +22,7 @@ lib/setenv.c
lib/strerror.c lib/strerror.c
lib/c-ctype.h lib/c-ctype.h
lib/c-ctype.c lib/c-ctype.c
m4/allocsa.m4 m4/malloca.m4
m4/canonicalize-lgpl.m4 m4/canonicalize-lgpl.m4
m4/eealloc.m4 m4/eealloc.m4
m4/longlong.m4 m4/longlong.m4

View File

@@ -9,7 +9,7 @@ lib/unsetenv.c
m4/setenv.m4 m4/setenv.m4
Depends-on: Depends-on:
allocsa malloca
alloca-opt alloca-opt
unistd unistd

View File

@@ -8,7 +8,7 @@ m4/strcasestr.m4
Depends-on: Depends-on:
string string
stdbool stdbool
allocsa malloca
strnlen strnlen
configure.ac: configure.ac:

View File

@@ -9,7 +9,7 @@ lib/striconveha.c
Depends-on: Depends-on:
stdbool stdbool
striconveh striconveh
allocsa malloca
strdup strdup
c-strcase c-strcase