Move realoc() decl to utils.c. s/realloc()/xrealloc()/.
authorAndrew Cagney <cagney@redhat.com>
Tue, 20 Mar 2001 00:54:43 +0000 (00:54 +0000)
committerAndrew Cagney <cagney@redhat.com>
Tue, 20 Mar 2001 00:54:43 +0000 (00:54 +0000)
gdb/ChangeLog
gdb/config/pa/xm-hppah.h
gdb/defs.h
gdb/event-loop.c
gdb/lin-thread.c
gdb/symfile.c
gdb/utils.c

index 8382df8403cf88024a494d73f8a42eda959a1571..4bdc8f33e2f6e98f584594918b3064e410a259e0 100644 (file)
@@ -1,3 +1,12 @@
+2001-03-19  Andrew Cagney  <ac131313@redhat.com>
+
+       * defs.h (realloc): Move declaration from here.
+       * utils.c (realloc): To here.
+       * config/pa/xm-hppah.h (realloc): Delete declaration.
+       * lin-thread.c (insert_thread): Use xrealloc instead of realloc.
+       * symfile.c (add_filename_language): Ditto.
+       * event-loop.c (create_file_handler): Ditto.
+
 2001-03-19  Andrew Cagney  <ac131313@redhat.com>
 
        * defs.h (free): Move declaration from here.
index f77493ab8badb58ea904ec30259d8ae269898b9b..497d2a738b05d4cd472aab9921d99f09244265eb 100644 (file)
@@ -42,5 +42,3 @@
 #define MALLOC_INCOMPATIBLE
 
 extern void *malloc (size_t);
-
-extern void *realloc (void *, size_t);
index 939a8cc6deeaeb57300da2e71dcf17a75a39b67f..5d6947d52ff9cc2479ecf1a1d614fe52a7a4c843 100644 (file)
@@ -951,10 +951,6 @@ extern double atof (const char *); /* X3.159-1989  4.10.1.1 */
 extern PTR malloc ();
 #endif
 
-#ifdef NEED_DECLARATION_REALLOC
-extern PTR realloc ();
-#endif
-
 #endif /* MALLOC_INCOMPATIBLE */
 
 /* Various possibilities for alloca.  */
index 0983fd34c46f86d968c94b68b50cd2102c568b71..5c30cf12b63e990c2f8c6e51fcc0ffeb1a9a9873 100644 (file)
@@ -544,8 +544,9 @@ create_file_handler (int fd, int mask, handler_func * proc, gdb_client_data clie
       gdb_notifier.num_fds++;
       if (gdb_notifier.poll_fds)
        gdb_notifier.poll_fds =
-         (struct pollfd *) realloc (gdb_notifier.poll_fds,
-                          (gdb_notifier.num_fds) * sizeof (struct pollfd));
+         (struct pollfd *) xrealloc (gdb_notifier.poll_fds,
+                                     (gdb_notifier.num_fds
+                                      * sizeof (struct pollfd)));
       else
        gdb_notifier.poll_fds =
          (struct pollfd *) xmalloc (sizeof (struct pollfd));
index 8c4caffc57a8bccd46016d004a681cce4a0c5a55..8c303fd7cb697198a44fa4cf176ff81f58fb9831 100644 (file)
@@ -780,8 +780,8 @@ insert_thread (int tid, int lid, td_thr_state_e state, td_thr_type_e type)
   if (threadlist_top >= threadlist_max)
     {
       threadlist_max += THREADLIST_ALLOC;
-      threadlist      = realloc (threadlist, 
-                                threadlist_max * sizeof (threadinfo));
+      threadlist      = xrealloc (threadlist, 
+                                 threadlist_max * sizeof (threadinfo));
       if (threadlist == NULL)
        return NULL;
     }
index 111a51b26ab6f23a201188f4804c8b810b54c8c2..8efc5d45710190f74a38de72c0661936d5af27eb 100644 (file)
@@ -1782,8 +1782,8 @@ add_filename_language (char *ext, enum language lang)
   if (fl_table_next >= fl_table_size)
     {
       fl_table_size += 10;
-      filename_language_table = realloc (filename_language_table,
-                                        fl_table_size);
+      filename_language_table = xrealloc (filename_language_table,
+                                         fl_table_size);
     }
 
   filename_language_table[fl_table_next].ext = xstrdup (ext);
index 3aac2db3625d69079019b2aedca89439e9f69347..6d164e45ae35e9a6aec88428f2abe703fe8e3f20 100644 (file)
@@ -57,6 +57,9 @@
 #include <readline/readline.h>
 
 #ifndef MALLOC_INCOMPATIBLE
+#ifdef NEED_DECLARATION_REALLOC
+extern PTR realloc ();
+#endif
 #ifdef NEED_DECLARATION_FREE
 extern void free ();
 #endif