From patchwork Tue Sep 10 19:08:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 34479 Received: (qmail 26042 invoked by alias); 10 Sep 2019 19:09:11 -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 25603 invoked by uid 89); 10 Sep 2019 19:09:07 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.5 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*r:esmtpa, H*RU:esmtpa, HX-Spam-Relays-External:esmtpa X-HELO: gateway22.websitewelcome.com Received: from gateway22.websitewelcome.com (HELO gateway22.websitewelcome.com) (192.185.47.129) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Sep 2019 19:09:05 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway22.websitewelcome.com (Postfix) with ESMTP id EC14F2669D for ; Tue, 10 Sep 2019 14:09:03 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 7lVfi2Npn3Qi07lVfif6nJ; Tue, 10 Sep 2019 14:09:03 -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=Hmc9bmgXgxDJ0vyNaFLncju929O+YUHGVLH8RBq5Y/0=; b=MAJwnkR2pT8BQe1J0LQ0LQLbqB mg+Uv02s7wT3ke+x9d1jE20+lOMqIGH9YRYYBdwaGZNjugrIszjwSsxr5QYxG7wz5W3HqVwGn/TOU WNBv1oox685b3T7xZ6HWHbky6; Received: from 71-218-73-27.hlrn.qwest.net ([71.218.73.27]:51788 helo=bapiya.Home) by box5379.bluehost.com with esmtpa (Exim 4.92) (envelope-from ) id 1i7lVf-000EcZ-Mf; Tue, 10 Sep 2019 14:09:03 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 10/20] Change "win_resized" to bool Date: Tue, 10 Sep 2019 13:08:47 -0600 Message-Id: <20190910190857.6562-11-tom@tromey.com> In-Reply-To: <20190910190857.6562-1-tom@tromey.com> References: <20190910190857.6562-1-tom@tromey.com> This changes the "win_resized" global to be a bool and then updates the uses. gdb/ChangeLog 2019-09-10 Tom Tromey * tui/tui.c (tui_enable): Update. * tui/tui-win.c (tui_sigwinch_handler, tui_async_resize_screen): Update. * tui/tui-data.h (tui_win_resized, tui_set_win_resized_to): Update. * tui/tui-data.c (win_resized): Now bool. (tui_win_resized): Return bool. (tui_set_win_resized_to): Accept a bool. --- gdb/ChangeLog | 11 +++++++++++ gdb/tui/tui-data.c | 8 ++++---- gdb/tui/tui-data.h | 4 ++-- gdb/tui/tui-win.c | 4 ++-- gdb/tui/tui.c | 2 +- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c index 833ea49a951..c14b1711f60 100644 --- a/gdb/tui/tui-data.c +++ b/gdb/tui/tui-data.c @@ -38,7 +38,7 @@ struct tui_win_info *tui_win_list[MAX_MAJOR_WINDOWS]; static int term_height, term_width; static struct tui_win_info *win_with_focus = NULL; -static int win_resized = FALSE; +static bool win_resized = false; /********************************* @@ -56,8 +56,8 @@ tui_win_is_auxiliary (enum tui_win_type win_type) ******************************************/ /* Answer a whether the terminal window has been resized or not. */ -int -tui_win_resized (void) +bool +tui_win_resized () { return win_resized; } @@ -65,7 +65,7 @@ tui_win_resized (void) /* Set a whether the terminal window has been resized or not. */ void -tui_set_win_resized_to (int resized) +tui_set_win_resized_to (bool resized) { win_resized = resized; } diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index be819503cf2..264652361ef 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -297,8 +297,8 @@ 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 int tui_win_resized (void); -extern void tui_set_win_resized_to (int); +extern bool tui_win_resized (); +extern void tui_set_win_resized_to (bool); extern struct tui_win_info *tui_next_win (struct tui_win_info *); extern struct tui_win_info *tui_prev_win (struct tui_win_info *); diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index bf84cdac442..d07a777360f 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -664,7 +664,7 @@ static void tui_sigwinch_handler (int signal) { mark_async_signal_handler (tui_sigwinch_token); - tui_set_win_resized_to (TRUE); + tui_set_win_resized_to (true); } /* Callback for asynchronously resizing TUI following a SIGWINCH signal. */ @@ -685,7 +685,7 @@ tui_async_resize_screen (gdb_client_data arg) } else { - tui_set_win_resized_to (FALSE); + tui_set_win_resized_to (false); tui_resize_all (); tui_refresh_all_win (); tui_update_gdb_sizes (); diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index db34e0c0441..35a7ec70532 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -501,7 +501,7 @@ tui_enable (void) window. */ if (tui_win_resized ()) { - tui_set_win_resized_to (FALSE); + tui_set_win_resized_to (false); tui_resize_all (); }