From patchwork Sat Jan 4 18:34:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 37186 Received: (qmail 1055 invoked by alias); 4 Jan 2020 18:34:27 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 601 invoked by uid 89); 4 Jan 2020 18:34:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=temptation X-HELO: gateway24.websitewelcome.com Received: from gateway24.websitewelcome.com (HELO gateway24.websitewelcome.com) (192.185.51.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 04 Jan 2020 18:34:18 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 0CB76C0D50 for ; Sat, 4 Jan 2020 12:34:17 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id noFdiWgEIW4frnoFdinK2B; Sat, 04 Jan 2020 12:34:17 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=EtKMHGfFTvgNom/+29IEsGEghxJz1IP3CQ8dymHYMK8=; b=bVsREUUnonoPmjc81Vphwp7edo hDWxMve1lPxk4xCyB1qdTyPXA1Q+DSX78WjPagQN5a9feMfG/q+FY2QmSylPCob0dPCUxlKid92XS /j6jm3u5HNmY9ctjT6wXJCuSx; Received: from 75-166-123-50.hlrn.qwest.net ([75.166.123.50]:48942 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1inoFc-0026Lh-SG; Sat, 04 Jan 2020 11:34:16 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 18/24] Remove tui_set_win_focus_to Date: Sat, 4 Jan 2020 11:34:04 -0700 Message-Id: <20200104183410.17114-19-tom@tromey.com> In-Reply-To: <20200104183410.17114-1-tom@tromey.com> References: <20200104183410.17114-1-tom@tromey.com> I noticed that the TUI had two functions with similar names: tui_set_win_focus_to and tui_set_win_with_focus. However, the former was just an implementation detail of the latter. So, this patch removes the former entirely, to avoid any temptation to call it. 2020-01-04 Tom Tromey * tui/tui-win.c (tui_set_win_focus_to): Move to tui-data.c. * tui/tui-data.h (tui_set_win_with_focus): Don't declare. * tui/tui-data.c (tui_set_win_with_focus): Remove. (tui_set_win_focus_to): Move from tui-win.c. Change-Id: Idffddab773436bdf80d55480906d76b292981ef2 --- gdb/ChangeLog | 7 +++++++ gdb/tui/tui-data.c | 11 ++++++++--- gdb/tui/tui-data.h | 1 - gdb/tui/tui-win.c | 15 --------------- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c index db637d8fbe6..1d822c9090f 100644 --- a/gdb/tui/tui-data.c +++ b/gdb/tui/tui-data.c @@ -59,11 +59,16 @@ tui_win_with_focus (void) } -/* Set the window that has the logical focus. */ +/* Set the logical focus to win_info. */ void -tui_set_win_with_focus (struct tui_win_info *win_info) +tui_set_win_focus_to (struct tui_win_info *win_info) { - win_with_focus = win_info; + if (win_info != NULL) + { + tui_unhighlight_win (win_with_focus); + win_with_focus = win_info; + tui_highlight_win (win_info); + } } diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 56600926636..0583c4a5c99 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -244,7 +244,6 @@ extern int tui_term_width (void); extern void tui_set_term_width_to (int); extern struct tui_locator_window *tui_locator_win_info_ptr (void); extern struct tui_win_info *tui_win_with_focus (void); -extern void tui_set_win_with_focus (struct tui_win_info *); extern bool tui_win_resized (); extern void tui_set_win_resized_to (bool); diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index f8a57732cca..1cd0878b1b9 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -452,21 +452,6 @@ tui_update_gdb_sizes (void) } -/* Set the logical focus to win_info. */ -void -tui_set_win_focus_to (struct tui_win_info *win_info) -{ - if (win_info != NULL) - { - struct tui_win_info *win_with_focus = tui_win_with_focus (); - - tui_unhighlight_win (win_with_focus); - tui_set_win_with_focus (win_info); - tui_highlight_win (win_info); - } -} - - void tui_win_info::forward_scroll (int num_to_scroll) {