From patchwork Thu Jul 4 17:02:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33573 Received: (qmail 109310 invoked by alias); 4 Jul 2019 17:03:53 -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 106767 invoked by uid 89); 4 Jul 2019 17:03:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.9 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=H*RU:esmtpa, H*r:esmtpa X-HELO: gateway23.websitewelcome.com Received: from gateway23.websitewelcome.com (HELO gateway23.websitewelcome.com) (192.185.49.104) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 Jul 2019 17:03:29 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 4200F103A5 for ; Thu, 4 Jul 2019 12:03:28 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id j58qhUt0jYTGMj58qhNg2O; Thu, 04 Jul 2019 12:03:28 -0500 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=OHhjdGykl8RKTcMsEQ+VNPtCLn18OZvs0ZhBrk4xpJs=; b=nmRMXY+9kPvGzF/x2ZnCVetA/4 YZOnIIdYRnM862m3bgnepXRQ/1m/GBsRc5KRdioz7cCiB3WRLTMZsTDvkdBqabn2SUwMxFGCINZJd izPdaeXcBFpFDm/aEdHTWEZ9F; Received: from 174-29-58-150.hlrn.qwest.net ([174.29.58.150]:34696 helo=bapiya.Home) by box5379.bluehost.com with esmtpa (Exim 4.92) (envelope-from ) id 1hj58q-002sIW-2I; Thu, 04 Jul 2019 12:03:28 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 39/61] Remove reset_locator Date: Thu, 4 Jul 2019 11:02:49 -0600 Message-Id: <20190704170311.15982-40-tom@tromey.com> In-Reply-To: <20190704170311.15982-1-tom@tromey.com> References: <20190704170311.15982-1-tom@tromey.com> reset_locator was introduced just a few patches ago, but it's already time to remove it. It consists of a call to the locator's "reset" method, plus a call to tui_make_window; but the latter is redundant at all the places that call reset_locator. 2019-07-04 Tom Tromey * tui/tui-layout.c (show_source_disasm_command, show_data): Update. (reset_locator): Remove. (show_source_or_disasm_and_command): Update. --- gdb/ChangeLog | 7 +++++++ gdb/tui/tui-layout.c | 39 ++++++++++++--------------------------- 2 files changed, 19 insertions(+), 27 deletions(-) diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index 79c7996d19b..d15df2a37c8 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -43,8 +43,6 @@ ** Static Local Decls ********************************/ static void show_layout (enum tui_layout_type); -static void reset_locator (tui_gen_win_info *, - int, int, int, int); static void show_source_or_disasm_and_command (enum tui_layout_type); static struct tui_win_info *make_command_window (int, int); static struct tui_win_info *make_source_window (int, int); @@ -611,11 +609,10 @@ show_source_disasm_command (void) { tui_win_list[DISASSEM_WIN] = make_disasm_window (asm_height, src_height - 1); - reset_locator (locator, - 2 /* 1 */ , - tui_term_width (), - 0, - (src_height + asm_height) - 1); + locator->reset (2 /* 1 */ , + tui_term_width (), + 0, + (src_height + asm_height) - 1); } else { @@ -688,11 +685,10 @@ show_data (enum tui_layout_type new_layout) else tui_win_list[win_type] = make_disasm_window (src_height, data_height - 1); - reset_locator (locator, - 2 /* 1 */ , - tui_term_width (), - 0, - total_height - 1); + locator->reset (2 /* 1 */ , + tui_term_width (), + 0, + total_height - 1); base = (tui_source_window_base *) tui_win_list[win_type]; } else @@ -736,16 +732,6 @@ tui_gen_win_info::reset (int height_, int width_, origin.y = origin_y_; } -static void -reset_locator (tui_gen_win_info *win_info, - int height, int width, - int origin_x, int origin_y) -{ - win_info->reset (height, width, origin_x, origin_y); - tui_make_window (win_info, DONT_BOX_WINDOW); -} - - /* Show the Source/Command or the Disassem layout. */ static void show_source_or_disasm_and_command (enum tui_layout_type layout_type) @@ -775,11 +761,10 @@ show_source_or_disasm_and_command (enum tui_layout_type layout_type) *win_info_ptr = make_source_window (src_height - 1, 0); else *win_info_ptr = make_disasm_window (src_height - 1, 0); - reset_locator (locator, - 2 /* 1 */ , - tui_term_width (), - 0, - src_height - 1); + locator->reset (2 /* 1 */ , + tui_term_width (), + 0, + src_height - 1); base = (tui_source_window_base *) *win_info_ptr; } else