From patchwork Fri Dec 27 16:42:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 37105 Received: (qmail 125733 invoked by alias); 27 Dec 2019 16:42:34 -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 125602 invoked by uid 89); 27 Dec 2019 16:42:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.1 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=refresh, tromey, Tromey, tom@tromey.com X-HELO: gateway34.websitewelcome.com Received: from gateway34.websitewelcome.com (HELO gateway34.websitewelcome.com) (192.185.149.77) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Dec 2019 16:42:32 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway34.websitewelcome.com (Postfix) with ESMTP id B93BF24EBC42 for ; Fri, 27 Dec 2019 10:42:30 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id ksh4iAmQoOdBHksh4iGpCq; Fri, 27 Dec 2019 10:42:30 -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=XJbUSupQLeIzYtHY++v8kTewUPOb+OPQvJCo+z8wlWY=; b=w1LIRHJkX7B4SBJvjWiumMqzKc RZ7K1HRNLjnYBDlp9stNi6tfg0wpzSjFb7DGRQxgYf7moD6u5lrT3VjENSH2gWW9n5yMbixqzZ/ZZ gG5CK/8KuWz2QN/ezmzmE85WU; Received: from 75-166-123-50.hlrn.qwest.net ([75.166.123.50]:36592 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iksh4-001xYc-Hr; Fri, 27 Dec 2019 09:42:30 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [FYI 2/3] Change tui_active to bool Date: Fri, 27 Dec 2019 09:42:27 -0700 Message-Id: <20191227164228.27948-3-tom@tromey.com> In-Reply-To: <20191227164228.27948-1-tom@tromey.com> References: <20191227164228.27948-1-tom@tromey.com> This changes tui_active and tui_finish_init to have type "bool". gdb/ChangeLog 2019-12-27 Tom Tromey * tui/tui.c (tui_active): Now bool. (tui_finish_init): Likewise. (tui_enable): Update. (tui_disable): Update. (tui_is_window_visible): Update. * tui/tui.h (tui_active): Now bool. Change-Id: Ia159ae9beb041137e34956b77f5bcf4e83eaf2b9 --- gdb/ChangeLog | 9 +++++++++ gdb/tui/tui.c | 12 ++++++------ gdb/tui/tui.h | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index f33ff441288..0ebe846e0d3 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -58,8 +58,8 @@ #include "readline/readline.h" /* Tells whether the TUI is active or not. */ -int tui_active = 0; -static int tui_finish_init = 1; +bool tui_active = false; +static bool tui_finish_init = true; enum tui_key_mode tui_current_key_mode = TUI_COMMAND_MODE; @@ -482,7 +482,7 @@ tui_enable (void) tui_set_win_focus_to (TUI_SRC_WIN); keypad (TUI_CMD_WIN->handle.get (), TRUE); wrefresh (TUI_CMD_WIN->handle.get ()); - tui_finish_init = 0; + tui_finish_init = false; } else { @@ -501,7 +501,7 @@ tui_enable (void) tui_setup_io (1); - tui_active = 1; + tui_active = true; /* Resize windows before anything might display/refresh a window. */ @@ -555,7 +555,7 @@ tui_disable (void) /* Update gdb's knowledge of its terminal. */ gdb_save_tty_state (); - tui_active = 0; + tui_active = false; tui_update_gdb_sizes (); } @@ -638,7 +638,7 @@ tui_show_assembly (struct gdbarch *gdbarch, CORE_ADDR addr) bool tui_is_window_visible (enum tui_win_type type) { - if (tui_active == 0) + if (!tui_active) return false; if (tui_win_list[type] == 0) diff --git a/gdb/tui/tui.h b/gdb/tui/tui.h index 06f3ef1f01b..14f2939fd24 100644 --- a/gdb/tui/tui.h +++ b/gdb/tui/tui.h @@ -81,6 +81,6 @@ extern enum tui_key_mode tui_current_key_mode; keymap. */ extern void tui_set_key_mode (enum tui_key_mode mode); -extern int tui_active; +extern bool tui_active; #endif /* TUI_TUI_H */