This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] zap last remaining calloc()
- To: GDB Patches <gdb-patches at sourceware dot cygnus dot com>
- Subject: [patch] zap last remaining calloc()
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Wed, 28 Mar 2001 18:21:38 -0500
Just FYI,
(And really zap last remaining malloc())
Andrew
2001-03-28 Andrew Cagney <ac131313@redhat.com>
* config/pa/xm-hppah.h (malloc): Really delete declaration
(MALLOC_INCOMPATIBLE): Really delete macro.
* cli/cli-cmds.c (apropos_command): Use xcalloc.
Index: cli/cli-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
retrieving revision 1.5
diff -p -r1.5 cli-cmds.c
*** cli-cmds.c 2001/03/19 23:31:41 1.5
--- cli-cmds.c 2001/03/28 23:18:03
*************** apropos_command (char *searchstr, int fr
*** 542,548 ****
regex_t pattern;
char *pattern_fastmap;
char errorbuffer[512];
! pattern_fastmap=calloc(256,sizeof(char));
if (searchstr == NULL)
error("REGEXP string is empty");
--- 542,548 ----
regex_t pattern;
char *pattern_fastmap;
char errorbuffer[512];
! pattern_fastmap = xcalloc (256, sizeof (char));
if (searchstr == NULL)
error("REGEXP string is empty");
Index: config/pa/xm-hppah.h
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/xm-hppah.h,v
retrieving revision 1.6
diff -p -r1.6 xm-hppah.h
*** xm-hppah.h 2001/03/23 00:41:02 1.6
--- xm-hppah.h 2001/03/28 23:18:03
***************
*** 30,39 ****
#define USG
#define HAVE_TERMIOS
-
- /* HP defines malloc and realloc as returning void *, even for non-ANSI
- compilations (such as with the native compiler). */
-
- #define MALLOC_INCOMPATIBLE
-
- extern void *malloc (size_t);
--- 30,32 ----
Index: mi/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/mi/ChangeLog,v
retrieving revision 1.14
diff -p -r1.14 ChangeLog
*** ChangeLog 2001/03/26 11:51:50 1.14
--- ChangeLog 2001/03/28 23:18:18
***************
*** 1,3 ****
--- 1,7 ----
+ 2001-03-28 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c (mi_cmd_data_read_memory): Use xcalloc.
+
2001-03-26 Eli Zaretskii <eliz@is.elta.co.il>
* gdbmi.texinfo: Update copyright. Change Permissions to GFDL.
Index: mi/mi-main.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-main.c,v
retrieving revision 1.11
diff -p -r1.11 mi-main.c
*** mi-main.c 2001/03/13 23:31:14 1.11
--- mi-main.c 2001/03/28 23:18:19
*************** mi_cmd_data_read_memory (char *command,
*** 859,865 ****
/* create a buffer and read it in. */
total_bytes = word_size * nr_rows * nr_cols;
! mbuf = calloc (total_bytes, 1);
make_cleanup (xfree, mbuf);
if (mbuf == NULL)
{
--- 859,865 ----
/* create a buffer and read it in. */
total_bytes = word_size * nr_rows * nr_cols;
! mbuf = xcalloc (total_bytes, 1);
make_cleanup (xfree, mbuf);
if (mbuf == NULL)
{