* server.c (load_data): Likewise.
(run_shell): Use XCNEW (char) in lieu of xcalloc (1, 1).
* fixincl.c: #include <sys/wait.h>
(run_compiles): Use XCNEWVEC instead of xcalloc.
(fix_with_system, start_fixer): Use XNEWVEC instead of xmalloc.
* fixfixes.c (FIX_PROC_HEAD, main): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99740
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-05-15 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * fixlib.c (load_file_data): Use XRESIZVEC in lieu of xrealloc.
+ * server.c (load_data): Likewise.
+ (run_shell): Use XCNEW (char) in lieu of xcalloc (1, 1).
+ * fixincl.c: #include <sys/wait.h>
+ (run_compiles): Use XCNEWVEC instead of xcalloc.
+ (fix_with_system, start_fixer): Use XNEWVEC instead of xmalloc.
+ * fixfixes.c (FIX_PROC_HEAD, main): Likewise.
+
2005-05-10 Joseph S. Myers <joseph@codesourcery.com>
* inclhack.def (stdio_stdarg_h, stdio_va_list): Bypass on
* *both* the fix name and the file name.
*/
size_t ln = strlen( filname ) + strlen( p_fixd->fix_name ) + 14;
- char* pz = xmalloc( ln );
+ char* pz = XNEWVEC (char, ln);
pz_name = pz;
sprintf( pz, "FIXINC_WRAP_%s-%s", filname, p_fixd->fix_name );
return EXIT_FAILURE;
}
- pz_tmptmp = xmalloc (strlen (argv[4]) + 5);
+ pz_tmptmp = XNEWVEC (char, strlen (argv[4]) + 5);
strcpy( pz_tmptmp, argv[4] );
/* Don't lose because "12345678" and "12345678X" map to the same
#include "fixlib.h"
#include <sys/stat.h>
+#include <sys/wait.h>
#if defined( HAVE_MMAP_FILE )
#include <sys/mman.h>
{
tFixDesc *p_fixd = fixDescList;
int fix_ct = FIX_COUNT;
- regex_t *p_re = xcalloc (REGEX_COUNT, sizeof (regex_t));
+ regex_t *p_re = XCNEWVEC (regex_t, REGEX_COUNT);
/* Make sure compile_re does not stumble across invalid data */
+ strlen (pz_temp_file);
/* Allocate something sure to be big enough for our purposes */
- pz_cmd = xmalloc (argsize);
+ pz_cmd = XNEWVEC (char, argsize);
strcpy (pz_cmd, pz_orig_dir);
pz_scan = pz_cmd + strlen (pz_orig_dir);
}
/* Estimated buffer size we will need. */
- pz_scan = pz_cmd = xmalloc (argsize);
+ pz_scan = pz_cmd = XNEWVEC (char, argsize);
/* How much of it do we allot to the program name and its
arguments. */
parg_size = argsize - parg_size;
else
{
tSCC z_cmd_fmt[] = "file='%s'\n%s";
- pz_cmd = xmalloc (strlen (p_fixd->patch_args[2])
+ pz_cmd = XNEWVEC (char, strlen (p_fixd->patch_args[2])
+ sizeof (z_cmd_fmt) + strlen (pz_fix_file));
sprintf (pz_cmd, z_cmd_fmt, pz_fix_file, p_fixd->patch_args[2]);
pz_cmd_save = p_fixd->patch_args[2];
if (space_left < 1024)
{
space_left += 4096;
- pz_data = xrealloc (pz_data, space_left + space_used + 1 );
+ pz_data = XRESIZEVEC (char, pz_data, space_left + space_used + 1 );
}
size_read = fread (pz_data + space_used, 1, space_left, fp);
space_used += size_read;
} while (! feof (fp));
- pz_data = xrealloc (pz_data, space_used+1 );
+ pz_data = XRESIZEVEC (char, pz_data, space_used+1 );
pz_data[ space_used ] = NUL;
return pz_data;
t_bool got_done = BOOL_FALSE;
text_size = sizeof (z_line) * 2;
- pz_scan = pz_text = xmalloc (text_size);
+ pz_scan = pz_text = XNEWVEC (char, text_size);
for (;;)
{
size_t off = (size_t) (pz_scan - pz_text);
text_size += 4096;
- pz_text = xrealloc (pz_text, text_size);
+ pz_text = XRESIZEVEC (char, pz_text, text_size);
pz_scan = pz_text + off;
}
}
while ((pz_scan > pz_text) && ISSPACE (pz_scan[-1]))
pz_scan--;
*pz_scan = NUL;
- return xrealloc (pz_text, strlen (pz_text) + 1);
+ return XRESIZEVEC (char, pz_text, strlen (pz_text) + 1);
}
if (server_id <= 0)
{
fprintf (stderr, zNoServer, pz_cmd);
- return xcalloc (1, 1);
+ return XCNEW (char);
}
/* Make sure the process will pay attention to us, send the
if (server_id == NULLPROCESS)
{
fprintf (stderr, zNoServer, pz_cmd);
- return xcalloc (1, 1);
+ return XCNEW (char);
}
/* Now try to read back all the data. If we fail due to either a
fprintf (stderr, "CLOSING SHELL SERVER - command failure:\n\t%s\n",
pz_cmd);
- pz = xcalloc (1, 1);
+ pz = XCNEW (char);
}
#ifdef DEBUG
fprintf( stderr, "run_shell command success: %s\n", pz );