[03/11] Remove unused deprecated_warning_hook
Commit Message
Nobody actually uses this hook anymore. So simply remove it.
gdb/ChangeLog
* defs.h (deprecated_warning_hook): Remove.
* top.c (deprecated_warning_hook): Remove.
* complaints.c (vcomplaint): Adjust.
* interps.c (clear_interpreter_hooks): Adjust.
* utils.c (vwarning): Adjust.
---
gdb/complaints.c | 2 --
gdb/defs.h | 2 --
gdb/interps.c | 1 -
gdb/top.c | 4 ----
gdb/utils.c | 33 ++++++++++++++-------------------
5 files changed, 14 insertions(+), 28 deletions(-)
@@ -185,8 +185,6 @@ vcomplaint (struct complaints **c, const char *file,
if (complaint->file != NULL)
internal_vwarning (complaint->file, complaint->line, fmt, args);
- else if (deprecated_warning_hook)
- (*deprecated_warning_hook) (fmt, args);
else
{
if (complaints->explanation == NULL)
@@ -672,8 +672,6 @@ extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
int noerror);
extern int (*deprecated_query_hook) (const char *, va_list)
ATTRIBUTE_FPTR_PRINTF(1,0);
-extern void (*deprecated_warning_hook) (const char *, va_list)
- ATTRIBUTE_FPTR_PRINTF(1,0);
extern void (*deprecated_interactive_hook) (void);
extern void (*deprecated_readline_begin_hook) (char *, ...)
ATTRIBUTE_FPTR_PRINTF_1;
@@ -391,7 +391,6 @@ clear_interpreter_hooks (void)
deprecated_print_frame_info_listing_hook = 0;
/*print_frame_more_info_hook = 0; */
deprecated_query_hook = 0;
- deprecated_warning_hook = 0;
deprecated_interactive_hook = 0;
deprecated_readline_begin_hook = 0;
deprecated_readline_hook = 0;
@@ -194,10 +194,6 @@ void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
int (*deprecated_query_hook) (const char *, va_list);
-/* Replaces most of warning. */
-
-void (*deprecated_warning_hook) (const char *, va_list);
-
/* These three functions support getting lines of text from the user.
They are used in sequence. First deprecated_readline_begin_hook is
called with a text string that might be (for example) a message for
@@ -399,27 +399,22 @@ free_current_contents (void *ptr)
void
vwarning (const char *string, va_list args)
{
- if (deprecated_warning_hook)
- (*deprecated_warning_hook) (string, args);
- else
- {
- struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
-
- if (target_supports_terminal_ours ())
- {
- make_cleanup_restore_target_terminal ();
- target_terminal_ours_for_output ();
- }
- if (filtered_printing_initialized ())
- wrap_here (""); /* Force out any buffered output. */
- gdb_flush (gdb_stdout);
- if (warning_pre_print)
- fputs_unfiltered (warning_pre_print, gdb_stderr);
- vfprintf_unfiltered (gdb_stderr, string, args);
- fprintf_unfiltered (gdb_stderr, "\n");
+ struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
- do_cleanups (old_chain);
+ if (target_supports_terminal_ours ())
+ {
+ make_cleanup_restore_target_terminal ();
+ target_terminal_ours_for_output ();
}
+ if (filtered_printing_initialized ())
+ wrap_here (""); /* Force out any buffered output. */
+ gdb_flush (gdb_stdout);
+ if (warning_pre_print)
+ fputs_unfiltered (warning_pre_print, gdb_stderr);
+ vfprintf_unfiltered (gdb_stderr, string, args);
+ fprintf_unfiltered (gdb_stderr, "\n");
+
+ do_cleanups (old_chain);
}
/* Print an error message and return to command level.