* defs.h (XMALLOC): Define.
authorAndrew Cagney <cagney@redhat.com>
Tue, 19 Mar 2002 02:51:09 +0000 (02:51 +0000)
committerAndrew Cagney <cagney@redhat.com>
Tue, 19 Mar 2002 02:51:09 +0000 (02:51 +0000)
* gdb-events.sh (XMALLOC): Delete macro.
* gdb-events.c, gdb-events.h: Regenerate.
* gdbarch.sh (XMALLOC): Delete macro.
* gdbarch.c: Regenerate.
* serial.c (XMALLOC): Delete macro.
* ui-file.c (XMALLOC): Ditto.
* ser-unix.h (XMALLOC): Ditto.
* sh-tdep.c (XMALLOC): Ditto.
* ui-out.c (XMALLOC): Ditto.
* utils.c (XMALLOC): Ditto.
* i386-tdep.c (XMALLOC): Ditto.
* gdb-events.c (XMALLOC): Ditto.
* d10v-tdep.c (XMALLOC): Ditto.
* cli-out.c (XMALLOC): Ditto.

* cli-out.c, d10v-tdep.c, gdb-events.c: Update copyright.
* gdb-events.sh, i386-tdep.c, ser-unix.h, serial.c: Ditto.
* ui-file.c, ui-out.c: Ditto.

25 files changed:
gdb/ChangeLog
gdb/cli-out.c
gdb/d10v-tdep.c
gdb/defs.h
gdb/gdb-events.c
gdb/gdb-events.h
gdb/gdb-events.sh
gdb/gdbarch.c
gdb/gdbarch.sh
gdb/i386-tdep.c
gdb/mi/ChangeLog
gdb/mi/mi-cmd-break.c
gdb/mi/mi-cmd-var.c
gdb/mi/mi-console.c
gdb/mi/mi-main.c
gdb/mi/mi-out.c
gdb/mi/mi-parse.c
gdb/ser-unix.h
gdb/serial.c
gdb/sh-tdep.c
gdb/tui/ChangeLog
gdb/tui/tui-out.c
gdb/ui-file.c
gdb/ui-out.c
gdb/utils.c

index 90118cb4bd6818c829bc28e012e87fbd558896b9..0db58f33866b6d7615c5d5a5f209a5b186cbeb53 100644 (file)
@@ -1,3 +1,25 @@
+2002-03-18  Andrew Cagney  <ac131313@redhat.com>
+
+       * defs.h (XMALLOC): Define.
+       * gdb-events.sh (XMALLOC): Delete macro.
+       * gdb-events.c, gdb-events.h: Regenerate.
+       * gdbarch.sh (XMALLOC): Delete macro.
+       * gdbarch.c: Regenerate.
+       * serial.c (XMALLOC): Delete macro.
+       * ui-file.c (XMALLOC): Ditto.
+       * ser-unix.h (XMALLOC): Ditto.
+       * sh-tdep.c (XMALLOC): Ditto.
+       * ui-out.c (XMALLOC): Ditto.
+       * utils.c (XMALLOC): Ditto.
+       * i386-tdep.c (XMALLOC): Ditto.
+       * gdb-events.c (XMALLOC): Ditto.
+       * d10v-tdep.c (XMALLOC): Ditto.
+       * cli-out.c (XMALLOC): Ditto.
+
+       * cli-out.c, d10v-tdep.c, gdb-events.c: Update copyright.
+       * gdb-events.sh, i386-tdep.c, ser-unix.h, serial.c: Ditto.
+       * ui-file.c, ui-out.c: Ditto.
+
 2002-03-18  Andrew Cagney  <ac131313@redhat.com>
 
        * command.h (struct cmd_list_element): Add field context.
index 9bcfa4684a10f9daae610946eb095a5b34e216d8..bd079f250bb8eccdbcff469443ee94fd21475b07 100644 (file)
@@ -1,5 +1,7 @@
 /* Output generating routines for GDB CLI.
-   Copyright 1999, 2000 Free Software Foundation, Inc.
+
+   Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
+
    Contributed by Cygnus Solutions.
    Written by Fernando Nasser for Cygnus.
 
 #include "gdb_string.h"
 #include "gdb_assert.h"
 
-/* Convenience macro for allocting typesafe memory. */
-
-#ifndef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-#endif
-
 struct ui_out_data
   {
     struct ui_file *stream;
index d06a0b9b1073e4ea6d01377e9a7f0e8237f0ab0a..bd35fc065af73ca1d368fe2da68d4d7904e642f0 100644 (file)
@@ -1,6 +1,7 @@
 /* Target-dependent code for Mitsubishi D10V, for GDB.
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+   Foundation, Inc.
 
    This file is part of GDB.
 
@@ -41,9 +42,6 @@
 #include "floatformat.h"
 #include "sim-d10v.h"
 
-#undef XMALLOC
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
-
 struct frame_extra_info
   {
     CORE_ADDR return_pc;
index 230364517900fd6cf6cda8efaa994f72f2042ad7..455eb661e1516ee8d0dec741cf0a6761dc7bced4 100644 (file)
@@ -840,6 +840,11 @@ extern void xmfree (void *md, void *ptr);
    "libiberty.h". */
 extern void xfree (void *);
 
+/* Utility macro to allocate typed memory.  Avoids errors like
+   ``struct foo *foo = xmalloc (sizeof bar)'' and ``struct foo *foo =
+   (struct foo *) xmalloc (sizeof bar)''.  */
+#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
+
 /* Like asprintf/vasprintf but get an internal_error if the call
    fails. */
 extern void xasprintf (char **ret, const char *format, ...) ATTR_FORMAT (printf, 2, 3);
index 0fbb3bab798bb85324c5ccbc6cd12365ba4641cb..ada30a3ef5abc70e017d48f7397cbc58f6bf1fbe 100644 (file)
@@ -1,5 +1,6 @@
 /* User Interface Events.
-   Copyright 1999, 2001 Free Software Foundation, Inc.
+
+   Copyright 1999, 2001, 2002 Free Software Foundation, Inc.
 
    Contributed by Cygnus Solutions.
 
@@ -38,9 +39,6 @@
 #include "gdb-events.h"
 #include "gdbcmd.h"
 
-#undef XMALLOC
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
-
 #if WITH_GDB_EVENTS
 static struct gdb_events null_event_hooks;
 static struct gdb_events queue_event_hooks;
index 18a4a2018c26c6a7b9fe183c468bcecc6a6fec30..5f7fc6b5a55b2bd56c1fd8cb6954bf6488cfc9ac 100644 (file)
@@ -1,5 +1,6 @@
 /* User Interface Events.
-   Copyright 1999, 2001 Free Software Foundation, Inc.
+
+   Copyright 1999, 2001, 2002 Free Software Foundation, Inc.
 
    Contributed by Cygnus Solutions.
 
index eb7346551a094bec82a642b34f89b3fa3183fc53..9965f05577f5373cc851774c52d81e7ddd0439a9 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 # User Interface Events.
-# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
 #
 # Contributed by Cygnus Solutions.
 #
@@ -113,7 +113,8 @@ copyright ()
 {
   cat <<EOF
 /* User Interface Events.
-   Copyright 1999, 2001 Free Software Foundation, Inc.
+
+   Copyright 1999, 2001, 2002 Free Software Foundation, Inc.
 
    Contributed by Cygnus Solutions.
 
@@ -303,9 +304,6 @@ cat <<EOF
 #include "gdb-events.h"
 #include "gdbcmd.h"
 
-#undef XMALLOC
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
-
 #if WITH_GDB_EVENTS
 static struct gdb_events null_event_hooks;
 static struct gdb_events queue_event_hooks;
index 5aad461ed481fd3184be517c6483b9d026e2e6f2..9b516980919b795ed9dde0487993be4ced0ce374 100644 (file)
@@ -74,13 +74,6 @@ static void init_gdbarch_swap (struct gdbarch *);
 static void swapout_gdbarch_swap (struct gdbarch *);
 static void swapin_gdbarch_swap (struct gdbarch *);
 
-/* Convenience macro for allocting typesafe memory. */
-
-#ifndef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-#endif
-
-
 /* Non-zero if we want to trace architecture code.  */
 
 #ifndef GDBARCH_DEBUG
index 310d3c4cd7c90a3bcffe91aa1bb9716396cb8165..ef69e8e069cc933fdf17c4c34f9b2a5ce62d6df8 100755 (executable)
@@ -1212,13 +1212,6 @@ static void init_gdbarch_swap (struct gdbarch *);
 static void swapout_gdbarch_swap (struct gdbarch *);
 static void swapin_gdbarch_swap (struct gdbarch *);
 
-/* Convenience macro for allocting typesafe memory. */
-
-#ifndef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-#endif
-
-
 /* Non-zero if we want to trace architecture code.  */
 
 #ifndef GDBARCH_DEBUG
index b2ddd280675c38e8af94c5b2ee6654cb87995c60..4e3a15f6ecc8c3406e8aaba905690f582942f38a 100644 (file)
@@ -1,7 +1,7 @@
 /* Intel 386 target-dependent stuff.
-   Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-   1998, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+
+   Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+   1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -40,9 +40,6 @@
 
 #include "i386-tdep.h"
 
-#undef XMALLOC
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
-
 /* Names of the registers.  The first 10 registers match the register
    numbering scheme used by GCC for stabs and DWARF.  */
 static char *i386_register_names[] =
index 7b71e8a92b58cb6323f43625e39d537d8ef8f3ff..8908a7a9674239e29ed91f3526645e31297584d2 100644 (file)
@@ -1,3 +1,15 @@
+2002-03-15  Andrew Cagney  <ac131313@redhat.com>
+
+       * mi-main.c (XMALLOC): Delete macro.
+       * mi-out.c (XMALLOC): Ditto.
+       * mi-parse.c (XMALLOC): Ditto.
+       * mi-console.c (XMALLOC): Ditto.
+       * mi-cmd-var.c (XMALLOC): Ditto.
+       * mi-cmd-break.c (XMALLOC): Ditto.
+       
+       * mi/mi-cmd-var.c, mi/mi-console.c, mi/mi-out.c: Update copyright
+       * mi/mi-parse.c: Ditto.
+
 2002-02-24  Andrew Cagney  <ac131313@redhat.com>
 
        From wiz at danbala:
index 5061392fa67596d02764dd849226f6a64ea5b673..5d15aa98b8a7fd52fdd7478234b4ffcf1af565ee 100644 (file)
 #include "gdb-events.h"
 #include "gdb.h"
 
-/* Convenience macro for allocting typesafe memory. */
-
-#undef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-
 enum
   {
     FROM_TTY = 0
index 0c840648bf7e79dbcdf5daf0d1762f11352ecc8f..4848a4e29c18ff22aba25c1a8b6d58dcc29beafa 100644 (file)
@@ -1,5 +1,7 @@
 /* MI Command Set - varobj commands.
-   Copyright 2000 Free Software Foundation, Inc.
+
+   Copyright 2000, 2002 Free Software Foundation, Inc.
+
    Contributed by Cygnus Solutions (a Red Hat company).
 
    This file is part of GDB.
 #include "value.h"
 #include <ctype.h>
 
-/* Convenience macro for allocting typesafe memory. */
-
-#undef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-
 extern int varobjdebug;                /* defined in varobj.c */
 
 static int varobj_update_one (struct varobj *var);
index 5824f833ceb00505543e55af698c8094a08029e8..c1b6e9f7b33d53349865d2ff1e0b6d5a1562ea0a 100644 (file)
@@ -1,5 +1,7 @@
 /* MI Console code.
-   Copyright 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+
    Contributed by Cygnus Solutions (a Red Hat company).
 
    This file is part of GDB.
 #include "mi-console.h"
 #include "gdb_string.h"
 
-/* Convenience macro for allocting typesafe memory. */
-
-#undef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-
 /* MI-console: send output to std-out but correcty encapsulated */
 
 static ui_file_fputs_ftype mi_console_file_fputs;
index 3a59fc88decca519a95904ca0c566e4d3990dbcd..238d0e73608d23f0990302e6ccc34c88b9635f52 100644 (file)
 #include <ctype.h>
 #include <sys/time.h>
 
-/* Convenience macro for allocting typesafe memory. */
-
-#undef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-
 enum
   {
     FROM_TTY = 0
index a92ccbeab8e290d98a5c94911091885780120fa4..947720bc10cc4dbc58137b3091d936636765ab96 100644 (file)
@@ -1,5 +1,7 @@
 /* MI Command Set - output generating routines.
-   Copyright 2000 Free Software Foundation, Inc.
+
+   Copyright 2000, 2002 Free Software Foundation, Inc.
+
    Contributed by Cygnus Solutions (a Red Hat company).
 
    This file is part of GDB.
 #include "ui-out.h"
 #include "mi-out.h"
 
-/* Convenience macro for allocting typesafe memory. */
-
-#ifndef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-#endif
-
 struct ui_out_data
   {
     int suppress_field_separator;
index 2ed49b8b773f72f28c44bf33badb8acfea482450..caefd5936a5969e9d1a6bb603242589d6e99d82c 100644 (file)
@@ -1,5 +1,7 @@
 /* MI Command Set - MI parser.
-   Copyright 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+
    Contributed by Cygnus Solutions (a Red Hat company).
 
    This file is part of GDB.
@@ -26,9 +28,6 @@
 #include <ctype.h>
 #include "gdb_string.h"
 
-#undef XMALLOC
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
-
 static void
 mi_parse_argv (char *args, struct mi_parse *parse)
 {
index 861694fb8065b024470b6688a44e972167cb6574..f7be059b28a0011a01f4a23ef6efbbbbab590ac2 100644 (file)
@@ -1,5 +1,6 @@
 /* Serial interface for UN*X file-descriptor based connection.
-   Copyright 1999, 2000 Free Software Foundation, Inc.
+
+   Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -21,9 +22,6 @@
 #ifndef SER_UNIX_H
 #define SER_UNIX_H
 
-#undef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-
 /* Generic UNIX/FD functions */
 
 extern int ser_unix_nop_flush_output (struct serial *scb);
index 22964eb3f98880a032c0cbaf79cbf9d06a601c8f..ada5631dce939fc0bb2e5f2c40215716afc68660 100644 (file)
@@ -1,7 +1,7 @@
 /* Generic serial interface routines
 
-   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+   2001, 2002 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -58,9 +58,6 @@ static const char logbase_ascii[] = "ascii";
 static const char *logbase_enums[] =
 {logbase_hex, logbase_octal, logbase_ascii, NULL};
 static const char *serial_logbase = logbase_ascii;
-
-#undef XMALLOC
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
 \f
 
 static int serial_current_type = 0;
index 3f7bc6a1732df94c4d86757bb6db4aceadafd07b..f5d123bf4fbedcbd5159c77945bd21ba2106fd0e 100644 (file)
@@ -43,9 +43,6 @@
 
 #include "solib-svr4.h"
 
-#undef XMALLOC
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
-
 void (*sh_show_regs) (void);
 CORE_ADDR (*skip_prologue_hard_way) (CORE_ADDR);
 void (*do_pseudo_register) (int);
index 2f676a88d1b42432bb5269f151885ca14fe0388e..d278c6a73a779330842d438409a6bf0b11ee2b73 100644 (file)
@@ -1,3 +1,7 @@
+2002-03-15  Andrew Cagney  <ac131313@redhat.com>
+
+       * tui-out.c (XMALLOC): Delete macro.  Update copyright.
+
 2002-03-01  Andrew Cagney  <ac131313@redhat.com>
 
        * tui-hooks.c: Add FIXME to explain true/false problem.  Update
index 9789c65a60822f04a8104b29d2d9d196f28be5f5..a8cc58ba5caa5a4187a025a2b7f37d7b33c9ff2d 100644 (file)
@@ -1,5 +1,7 @@
 /* Output generating routines for GDB CLI.
-   Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
    Contributed by Cygnus Solutions.
    Written by Fernando Nasser for Cygnus.
 
 #include "gdb_string.h"
 #include "gdb_assert.h"
 
-/* Convenience macro for allocting typesafe memory. */
-
-#ifndef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-#endif
-
 struct ui_out_data
   {
     struct ui_file *stream;
index 86655e9c2f71d74448786ceb19331cc3f26a4ced..3dbcaab13267fd03cdfb90dda6eb8f318ec50598 100644 (file)
@@ -1,5 +1,6 @@
 /* UI_FILE - a generic STDIO like output stream.
-   Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -24,9 +25,6 @@
 #include "ui-file.h"
 #include "gdb_string.h"
 
-#undef XMALLOC
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
-
 static ui_file_isatty_ftype null_file_isatty;
 static ui_file_write_ftype null_file_write;
 static ui_file_fputs_ftype null_file_fputs;
index 06db646de3dbd9186f22c4a76ff68b6980f4ec8f..7e27d592ed6c55d15888cb669de65b6a67c4a051 100644 (file)
@@ -1,5 +1,7 @@
 /* Output generating routines for GDB.
-   Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
    Contributed by Cygnus Solutions.
    Written by Fernando Nasser for Cygnus.
 
 #include "ui-out.h"
 #include "gdb_assert.h"
 
-/* Convenience macro for allocting typesafe memory. */
-
-#undef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-
 /* table header structures */
 
 struct ui_out_hdr
index edc340e326e6b6a52439f1316c0f3eecfe76afea..4a1b577514303e2f5918bfcffa24a7dd9723752d 100644 (file)
@@ -87,9 +87,6 @@ extern void free ();
 extern char *canonicalize_file_name (const char *);
 #endif
 
-#undef XMALLOC
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
-
 /* readline defines this.  */
 #undef savestring
 
This page took 0.056243 seconds and 4 git commands to generate.