diff options
author | Andrew Cagney <cagney@redhat.com> | 2001-03-20 00:54:43 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2001-03-20 00:54:43 +0000 |
commit | 0e52036f1f47078a9863f6a377ff11e10a81e8c4 (patch) | |
tree | 843cc4d980261981f8a7053bd2d3a9c87c085ac6 /gdb | |
parent | 81b8eb809e1fd6ad16bbeda4a365b8e7a81a441c (diff) | |
download | gdb-0e52036f1f47078a9863f6a377ff11e10a81e8c4.zip gdb-0e52036f1f47078a9863f6a377ff11e10a81e8c4.tar.gz gdb-0e52036f1f47078a9863f6a377ff11e10a81e8c4.tar.bz2 |
Move realoc() decl to utils.c. s/realloc()/xrealloc()/.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/config/pa/xm-hppah.h | 2 | ||||
-rw-r--r-- | gdb/defs.h | 4 | ||||
-rw-r--r-- | gdb/event-loop.c | 5 | ||||
-rw-r--r-- | gdb/lin-thread.c | 4 | ||||
-rw-r--r-- | gdb/symfile.c | 4 | ||||
-rw-r--r-- | gdb/utils.c | 3 |
7 files changed, 19 insertions, 12 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8382df8..4bdc8f3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,14 @@ 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. * utils.c (free): To here. (xfree): Document as the only call to free(). diff --git a/gdb/config/pa/xm-hppah.h b/gdb/config/pa/xm-hppah.h index f77493a..497d2a7 100644 --- a/gdb/config/pa/xm-hppah.h +++ b/gdb/config/pa/xm-hppah.h @@ -42,5 +42,3 @@ #define MALLOC_INCOMPATIBLE extern void *malloc (size_t); - -extern void *realloc (void *, size_t); @@ -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. */ diff --git a/gdb/event-loop.c b/gdb/event-loop.c index 0983fd3..5c30cf1 100644 --- a/gdb/event-loop.c +++ b/gdb/event-loop.c @@ -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)); diff --git a/gdb/lin-thread.c b/gdb/lin-thread.c index 8c4caff..8c303fd 100644 --- a/gdb/lin-thread.c +++ b/gdb/lin-thread.c @@ -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; } diff --git a/gdb/symfile.c b/gdb/symfile.c index 111a51b..8efc5d4 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -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); diff --git a/gdb/utils.c b/gdb/utils.c index 3aac2db..6d164e4 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -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 |