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

View File

@@ -25,7 +25,7 @@
#include <stdlib.h>
#include <string.h>
#include "allocsa.h"
#include "malloca.h"
/* 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);
/* 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)
return false;
/* Fill the table.
@@ -111,7 +111,7 @@ knuth_morris_pratt (const char *haystack, const char *needle,
}
}
freesa (table);
freea (table);
return true;
}

View File

@@ -1,5 +1,5 @@
/* 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 program is free software; you can redistribute it and/or modify
@@ -66,7 +66,7 @@
# define __canonicalize_file_name canonicalize_file_name
# define __realpath rpl_realpath
# include "pathmax.h"
# include "allocsa.h"
# include "malloca.h"
# if HAVE_GETCWD
# ifdef VMS
/* We want the directory in Unix syntax, not in VMS syntax. */
@@ -244,7 +244,7 @@ __realpath (const char *name, char *resolved)
goto error;
}
buf = allocsa (path_max);
buf = malloca (path_max);
if (!buf)
{
errno = ENOMEM;
@@ -255,7 +255,7 @@ __realpath (const char *name, char *resolved)
if (n < 0)
{
int saved_errno = errno;
freesa (buf);
freea (buf);
errno = saved_errno;
goto error;
}
@@ -263,10 +263,10 @@ __realpath (const char *name, char *resolved)
if (!extra_buf)
{
extra_buf = allocsa (path_max);
extra_buf = malloca (path_max);
if (!extra_buf)
{
freesa (buf);
freea (buf);
errno = ENOMEM;
goto error;
}
@@ -275,7 +275,7 @@ __realpath (const char *name, char *resolved)
len = strlen (end);
if ((long int) (n + len) >= path_max)
{
freesa (buf);
freea (buf);
__set_errno (ENAMETOOLONG);
goto error;
}
@@ -299,7 +299,7 @@ __realpath (const char *name, char *resolved)
*dest = '\0';
if (extra_buf)
freesa (extra_buf);
freea (extra_buf);
return resolved ? memcpy (resolved, rpath, dest - rpath + 1) : rpath;
@@ -307,7 +307,7 @@ error:
{
int saved_errno = errno;
if (extra_buf)
freesa (extra_buf);
freea (extra_buf);
if (resolved)
strcpy (resolved, rpath);
else

View File

@@ -40,7 +40,7 @@
#include "pathmax.h"
#include "tmpdir.h"
#include "xalloc.h"
#include "xallocsa.h"
#include "xmalloca.h"
#include "gl_linkedhash_list.h"
#include "gettext.h"
#if GNULIB_FWRITEERROR
@@ -327,7 +327,7 @@ create_temp_dir (const char *prefix, const char *parentdir,
false);
/* Create the temporary directory. */
xtemplate = (char *) xallocsa (PATH_MAX);
xtemplate = (char *) xmalloca (PATH_MAX);
if (path_search (xtemplate, PATH_MAX, parentdir, prefix, parentdir == NULL))
{
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
if xstrdup fails. */
tmpdir->dirname = xstrdup (tmpdirname);
freesa (xtemplate);
freea (xtemplate);
return (struct temp_dir *) tmpdir;
quit:
freesa (xtemplate);
freea (xtemplate);
return NULL;
}
@@ -665,14 +665,14 @@ fopen_temp (const char *file_name, const char *mode)
if (supports_delete_on_close ())
{
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_len, "D", 2);
fp = fopen (file_name, augmented_mode);
saved_errno = errno;
freesa (augmented_mode);
freea (augmented_mode);
}
else
#endif

View File

@@ -1,5 +1,5 @@
/* 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.
This program is free software; you can redistribute it and/or modify
@@ -33,7 +33,7 @@
#include "getline.h"
#include "sh-quote.h"
#include "safe-read.h"
#include "xallocsa.h"
#include "xmalloca.h"
#include "error.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
+ 2 * libraries_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++ = "cscc";
@@ -131,7 +131,7 @@ compile_csharp_using_pnet (const char * const *sources,
&& memcmp (source_file + strlen (source_file) - 10, ".resources",
10) == 0)
{
char *option = (char *) xallocsa (12 + strlen (source_file) + 1);
char *option = (char *) xmalloca (12 + strlen (source_file) + 1);
memcpy (option, "-fresources=", 12);
strcpy (option + 12, source_file);
@@ -157,8 +157,8 @@ compile_csharp_using_pnet (const char * const *sources,
for (i = 0; i < sources_count; i++)
if (argv[argc - sources_count + i] != sources[i])
freesa (argv[argc - sources_count + i]);
freesa (argv);
freea (argv[argc - sources_count + i]);
freea (argv);
return (exitstatus != 0);
}
@@ -214,28 +214,28 @@ compile_csharp_using_mono (const char * const *sources,
argc =
1 + (output_is_library ? 1 : 0) + 1 + libdirs_count + libraries_count
+ (debug ? 1 : 0) + sources_count;
argv = (char **) xallocsa ((argc + 1) * sizeof (char *));
argv = (char **) xmalloca ((argc + 1) * sizeof (char *));
argp = argv;
*argp++ = "mcs";
if (output_is_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);
strcpy (option + 5, output_file);
*argp++ = option;
}
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);
strcpy (option + 5, libdirs[i]);
*argp++ = option;
}
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 + 11, libraries[i], strlen (libraries[i]));
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",
10) == 0)
{
char *option = (char *) xallocsa (10 + strlen (source_file) + 1);
char *option = (char *) xmalloca (10 + strlen (source_file) + 1);
memcpy (option, "-resource:", 10);
strcpy (option + 10, source_file);
@@ -308,11 +308,11 @@ compile_csharp_using_mono (const char * const *sources,
i < 1 + (output_is_library ? 1 : 0)
+ 1 + libdirs_count + libraries_count;
i++)
freesa (argv[i]);
freea (argv[i]);
for (i = 0; i < sources_count; i++)
if (argv[argc - sources_count + i] != sources[i])
freesa (argv[argc - sources_count + i]);
freesa (argv);
freea (argv[argc - sources_count + i]);
freea (argv);
return (exitstatus != 0);
}
@@ -396,28 +396,28 @@ compile_csharp_using_sscli (const char * const *sources,
argc =
1 + 1 + 1 + libdirs_count + libraries_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++ = "csc";
*argp++ =
(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);
strcpy (option + 5, output_file);
*argp++ = option;
}
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);
strcpy (option + 5, libdirs[i]);
*argp++ = option;
}
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 + 11, libraries[i], strlen (libraries[i]));
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",
10) == 0)
{
char *option = (char *) xallocsa (10 + strlen (source_file) + 1);
char *option = (char *) xmalloca (10 + strlen (source_file) + 1);
memcpy (option, "-resource:", 10);
strcpy (option + 10, source_file);
@@ -459,11 +459,11 @@ compile_csharp_using_sscli (const char * const *sources,
true, true);
for (i = 2; i < 3 + libdirs_count + libraries_count; i++)
freesa (argv[i]);
freea (argv[i]);
for (i = 0; i < sources_count; i++)
if (argv[argc - sources_count + i] != sources[i])
freesa (argv[argc - sources_count + i]);
freesa (argv);
freea (argv[argc - sources_count + i]);
freea (argv);
return (exitstatus != 0);
}

View File

@@ -1,5 +1,5 @@
/* 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.
This program is free software; you can redistribute it and/or modify
@@ -27,7 +27,7 @@
#include "execute.h"
#include "sh-quote.h"
#include "xallocsa.h"
#include "xmalloca.h"
#include "error.h"
#include "gettext.h"
@@ -124,7 +124,7 @@ execute_csharp_using_pnet (const char *assembly_path,
bool err;
argc = 1 + 2 * libdirs_count + 1 + nargs;
argv = (char **) xallocsa ((argc + 1) * sizeof (char *));
argv = (char **) xmalloca ((argc + 1) * sizeof (char *));
argp = argv;
*argp++ = "ilrun";
@@ -150,7 +150,7 @@ execute_csharp_using_pnet (const char *assembly_path,
err = executer ("ilrun", "ilrun", argv, private_data);
freesa (argv);
freea (argv);
return err;
}
@@ -188,7 +188,7 @@ execute_csharp_using_mono (const char *assembly_path,
if (mono_present)
{
char *old_monopath;
char **argv = (char **) xallocsa ((2 + nargs + 1) * sizeof (char *));
char **argv = (char **) xmalloca ((2 + nargs + 1) * sizeof (char *));
unsigned int i;
bool err;
@@ -212,7 +212,7 @@ execute_csharp_using_mono (const char *assembly_path,
/* Reset MONO_PATH. */
reset_monopath (old_monopath);
freesa (argv);
freea (argv);
return err;
}
@@ -249,7 +249,7 @@ execute_csharp_using_sscli (const char *assembly_path,
if (clix_present)
{
char *old_clixpath;
char **argv = (char **) xallocsa ((2 + nargs + 1) * sizeof (char *));
char **argv = (char **) xmalloca ((2 + nargs + 1) * sizeof (char *));
unsigned int i;
bool err;
@@ -273,7 +273,7 @@ execute_csharp_using_sscli (const char *assembly_path,
/* Reset clix' PATH variable. */
reset_clixpath (old_clixpath);
freesa (argv);
freea (argv);
return err;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -25,7 +25,7 @@
#include <stdbool.h>
#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))
@@ -39,7 +39,7 @@ knuth_morris_pratt (const char *haystack, const char *needle,
size_t m = strlen (needle);
/* 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)
return false;
/* Fill the table.
@@ -114,7 +114,7 @@ knuth_morris_pratt (const char *haystack, const char *needle,
}
}
freesa (table);
freea (table);
return true;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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