mirror of git://gcc.gnu.org/git/gcc.git
pex-win32.c (argv_to_cmdline): Replace xmalloc with XNEWVEC.
(find_executable): Likewise. (win32_spawn): Cast alloca return to (char**). Replace malloc with XNEWVEC. bcopy.c (bcopy): Add explict casts in assignments. From-SVN: r118058
This commit is contained in:
parent
0da67a3234
commit
7445de0a7b
|
@ -1,3 +1,11 @@
|
||||||
|
2006-10-26 Danny Smith <dannysmith@users.sourceforge.net>
|
||||||
|
|
||||||
|
pex-win32.c (argv_to_cmdline): Replace xmalloc with XNEWVEC.
|
||||||
|
(find_executable): Likewise.
|
||||||
|
(win32_spawn): Cast alloca return to (char**).
|
||||||
|
Replace malloc with XNEWVEC.
|
||||||
|
bcopy.c (bcopy): Add explict casts in assignments.
|
||||||
|
|
||||||
2006-10-25 Ben Elliston <bje@au.ibm.com>
|
2006-10-25 Ben Elliston <bje@au.ibm.com>
|
||||||
|
|
||||||
* pexecute.txh: Wrap pexecute's "flag" argument with @var {..}.
|
* pexecute.txh: Wrap pexecute's "flag" argument with @var {..}.
|
||||||
|
|
|
@ -16,8 +16,8 @@ bcopy (const void *src, void *dest, size_t len)
|
||||||
{
|
{
|
||||||
if (dest < src)
|
if (dest < src)
|
||||||
{
|
{
|
||||||
const char *firsts = src;
|
const char *firsts = (const char *) src;
|
||||||
char *firstd = dest;
|
char *firstd = (char *) dest;
|
||||||
while (len--)
|
while (len--)
|
||||||
*firstd++ = *firsts++;
|
*firstd++ = *firsts++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* Utilities to execute a program in a subprocess (possibly linked by pipes
|
/* Utilities to execute a program in a subprocess (possibly linked by pipes
|
||||||
with other subprocesses), and wait for it. Generic Win32 specialization.
|
with other subprocesses), and wait for it. Generic Win32 specialization.
|
||||||
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
|
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of the libiberty library.
|
This file is part of the libiberty library.
|
||||||
|
@ -358,7 +358,7 @@ argv_to_cmdline (char *const *argv)
|
||||||
cmdline_len += j;
|
cmdline_len += j;
|
||||||
cmdline_len += 3; /* for leading and trailing quotes and space */
|
cmdline_len += 3; /* for leading and trailing quotes and space */
|
||||||
}
|
}
|
||||||
cmdline = xmalloc (cmdline_len);
|
cmdline = XNEWVEC (char, cmdline_len);
|
||||||
p = cmdline;
|
p = cmdline;
|
||||||
for (i = 0; argv[i]; i++)
|
for (i = 0; argv[i]; i++)
|
||||||
{
|
{
|
||||||
|
@ -433,7 +433,7 @@ find_executable (const char *program, BOOL search)
|
||||||
q++;
|
q++;
|
||||||
}
|
}
|
||||||
fe_len = fe_len + 1 + proglen + (has_extension ? 1 : 5);
|
fe_len = fe_len + 1 + proglen + (has_extension ? 1 : 5);
|
||||||
full_executable = xmalloc (fe_len);
|
full_executable = XNEWVEC (char, fe_len);
|
||||||
|
|
||||||
p = path;
|
p = path;
|
||||||
do
|
do
|
||||||
|
@ -557,14 +557,14 @@ win32_spawn (const char *executable,
|
||||||
|
|
||||||
/* Windows needs the members of the block to be sorted by variable
|
/* Windows needs the members of the block to be sorted by variable
|
||||||
name. */
|
name. */
|
||||||
env_copy = alloca (sizeof (char *) * env_size);
|
env_copy = (char **) alloca (sizeof (char *) * env_size);
|
||||||
memcpy (env_copy, env, sizeof (char *) * env_size);
|
memcpy (env_copy, env, sizeof (char *) * env_size);
|
||||||
qsort (env_copy, env_size, sizeof (char *), env_compare);
|
qsort (env_copy, env_size, sizeof (char *), env_compare);
|
||||||
|
|
||||||
for (var = 0; var < env_size; var++)
|
for (var = 0; var < env_size; var++)
|
||||||
total_size += strlen (env[var]) + 1;
|
total_size += strlen (env[var]) + 1;
|
||||||
|
|
||||||
env_block = malloc (total_size);
|
env_block = XNEWVEC (char, total_size);
|
||||||
bufptr = env_block;
|
bufptr = env_block;
|
||||||
for (var = 0; var < env_size; var++)
|
for (var = 0; var < env_size; var++)
|
||||||
bufptr = stpcpy (bufptr, env_copy[var]) + 1;
|
bufptr = stpcpy (bufptr, env_copy[var]) + 1;
|
||||||
|
|
Loading…
Reference in New Issue