From patchwork Sun Jun 23 22:42:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33298 Received: (qmail 50346 invoked by alias); 23 Jun 2019 22:44:03 -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 48561 invoked by uid 89); 23 Jun 2019 22:43:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.2 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=HX-Languages-Length:2659 X-HELO: gateway33.websitewelcome.com Received: from gateway33.websitewelcome.com (HELO gateway33.websitewelcome.com) (192.185.145.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 23 Jun 2019 22:43:44 +0000 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 3B57B141A2 for ; Sun, 23 Jun 2019 17:43:43 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id fBD5hdbwP90onfBD5hbzVz; Sun, 23 Jun 2019 17:43:43 -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=ZYaNisu77FJEJYeC/dXly1Hg+sk30nuewOTgWHLf2uk=; b=qqfPE488fZuujwh+ZP8pcg658T VXFad8labibmG901OI4PjaBn0JGpDuL/Tj0bOufbrtvsURLlrBrMBArDVhlGSMdXY8nxIZHHRSkiy xwly7/mNcQpwr9LOAipWZf+BF; Received: from 75-166-12-78.hlrn.qwest.net ([75.166.12.78]:54396 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hfBD5-000vDQ-0p; Sun, 23 Jun 2019 17:43:43 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 19/66] Inline constructors and initializers Date: Sun, 23 Jun 2019 16:42:42 -0600 Message-Id: <20190623224329.16060-20-tom@tromey.com> In-Reply-To: <20190623224329.16060-1-tom@tromey.com> References: <20190623224329.16060-1-tom@tromey.com> This inlines the constructors and initializers for tui_cmd_window and tui_data_window. This makes the code a bit simpler. gdb/ChangeLog 2019-06-23 Tom Tromey * tui/tui-data.h (struct tui_data_window, struct tui_cmd_window): Inline constructor. Add initializers for members. * tui/tui-data.c (tui_data_window, tui_cmd_window): Remove constructors; now inline in class. --- gdb/ChangeLog | 7 +++++++ gdb/tui/tui-data.c | 17 ----------------- gdb/tui/tui-data.h | 31 +++++++++++++++++++++---------- 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c index fe751574b95..c9c0bdf3f21 100644 --- a/gdb/tui/tui-data.c +++ b/gdb/tui/tui-data.c @@ -495,23 +495,6 @@ tui_source_window_base::tui_source_window_base (enum tui_win_type type) start_line_or_addr.u.addr = 0; } -tui_data_window::tui_data_window () - : tui_win_info (DATA_WIN) -{ - data_content = NULL; - data_content_count = 0; - regs_content = NULL; - regs_content_count = 0; - regs_column_count = 1; - display_regs = false; - current_group = 0; -} - -tui_cmd_window::tui_cmd_window () - : tui_win_info (CMD_WIN) -{ -} - struct tui_win_info * tui_alloc_win_info (enum tui_win_type type) { diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 50e926c42ad..48c92bf99f0 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -346,19 +346,26 @@ protected: struct tui_data_window : public tui_win_info { - tui_data_window (); + tui_data_window () + : tui_win_info (DATA_WIN) + { + } + ~tui_data_window () override; DISABLE_COPY_AND_ASSIGN (tui_data_window); void clear_detail () override; - tui_win_content data_content; /* Start of data display content. */ - int data_content_count; - tui_win_content regs_content; /* Start of regs display content. */ - int regs_content_count; - int regs_column_count; - bool display_regs; /* Should regs be displayed at all? */ - struct reggroup *current_group; + /* Start of data display content. */ + tui_win_content data_content = NULL; + int data_content_count = 0; + /* Start of regs display content. */ + tui_win_content regs_content = NULL; + int regs_content_count = 0; + int regs_column_count = 0; + /* Should regs be displayed at all? */ + bool display_regs = false; + struct reggroup *current_group = nullptr; protected: @@ -372,12 +379,16 @@ protected: struct tui_cmd_window : public tui_win_info { - tui_cmd_window (); + tui_cmd_window () + : tui_win_info (CMD_WIN) + { + } + DISABLE_COPY_AND_ASSIGN (tui_cmd_window); void clear_detail () override; - int start_line; + int start_line = 0; protected: