From 6fc39605e69e5c4d76990e2cf4eaf5d294195ca1 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 14 Apr 2023 14:31:44 -0400 Subject: [PATCH] gdb: remove return value of set_language set_language returns the previous language, but nothing uses it. Remove the return value. This lets us remove the assignment to current_language, in _initialize_language. Change-Id: Ifccf9b488434c1addf4626130a74e159a37d8c17 Reviewed-By: Tom Tromey --- gdb/language.c | 14 ++------------ gdb/language.h | 5 +++-- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/gdb/language.c b/gdb/language.c index fb065ef6a75..1ab356597d7 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -353,18 +353,13 @@ set_range_case (void) case_sensitivity = current_language->case_sensitivity (); } -/* Set current language to (enum language) LANG. Returns previous - language. */ +/* See language.h. */ -enum language +void set_language (enum language lang) { - enum language prev_language; - - prev_language = current_language->la_language; current_language = language_def (lang); set_range_case (); - return prev_language; } @@ -1125,11 +1120,6 @@ For Fortran the default is off; for other languages the default is on."), show_case_command, &setlist, &showlist); - /* In order to call SET_LANGUAGE (below) we need to make sure that - CURRENT_LANGUAGE is not NULL. So first set the language to unknown, - then we can change the language to 'auto'. */ - current_language = language_def (language_unknown); - add_set_language_command (); /* Have the above take effect. */ diff --git a/gdb/language.h b/gdb/language.h index 57df8acd0a3..4c91776d94d 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -761,8 +761,9 @@ struct symbol * extern void language_info (); -extern enum language set_language (enum language); - +/* Set the current language to LANG. */ + +extern void set_language (enum language lang); /* Test a character to decide whether it can be printed in literal form or needs to be printed in another representation. For example, -- 2.30.2