From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26041 invoked by alias); 24 Nov 2016 15:32:44 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 26029 invoked by uid 89); 24 Nov 2016 15:32:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.4 required=5.0 tests=AWL,BAYES_50,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=Hx-spam-relays-external:sk:cable-1, H*RU:sk:cable-1, H*r:sk:cable-1, uiout X-HELO: barracuda.ebox.ca Received: from barracuda.ebox.ca (HELO barracuda.ebox.ca) (96.127.255.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 24 Nov 2016 15:32:43 +0000 X-ASG-Debug-ID: 1480001561-0c856e65d5b8a0d0001-fS2M51 Received: from smtp.electronicbox.net (smtp.electronicbox.net [96.127.255.82]) by barracuda.ebox.ca with ESMTP id SkaF8KpIMv0HVrtW (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Nov 2016 10:32:41 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.lan (cable-11.246.173-162.electronicbox.net [173.246.11.162]) by smtp.electronicbox.net (Postfix) with ESMTP id BA235440E7D; Thu, 24 Nov 2016 10:32:41 -0500 (EST) From: Simon Marchi X-Barracuda-Effective-Source-IP: cable-11.246.173-162.electronicbox.net[173.246.11.162] X-Barracuda-Apparent-Source-IP: 173.246.11.162 X-Barracuda-RBL-IP: 173.246.11.162 To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 22/22] Introduce enum_flag type for ui_out flags Date: Thu, 24 Nov 2016 15:32:00 -0000 X-ASG-Orig-Subj: [PATCH 22/22] Introduce enum_flag type for ui_out flags Message-Id: <20161124153228.25177-22-simon.marchi@polymtl.ca> In-Reply-To: <20161124152428.24725-1-simon.marchi@polymtl.ca> References: <20161124152428.24725-1-simon.marchi@polymtl.ca> X-Barracuda-Connect: smtp.electronicbox.net[96.127.255.82] X-Barracuda-Start-Time: 1480001561 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 2423 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.34709 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00761.txt.bz2 This patch changes the ui_out flags to be an enum flag. gdb/ChangeLog: * ui-out.c (ui_out::test_flags): Change type of parameter to ui_out_flags. (ui_out::ui_out): Likewise. * ui-out.h (enum ui_flags): Rename to ... (enum ui_out_flag): ... this. (ui_out_flags): Define enum flag type. (ui_out::ui_out): Change type of parameter to ui_out_flags. (ui_out::test_flags): Likewise. (ui_out::m_flags): Likewise. --- gdb/ui-out.c | 6 +++--- gdb/ui-out.h | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gdb/ui-out.c b/gdb/ui-out.c index 3257f89..e262cd8 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -558,8 +558,8 @@ ui_out::redirect (ui_file *outstream) } /* Test the flags against the mask given. */ -int -ui_out::test_flags (int mask) +ui_out_flags +ui_out::test_flags (ui_out_flags mask) { return m_flags & mask; } @@ -626,7 +626,7 @@ ui_out::query_table_field (int colno, int *width, int *alignment, /* The constructor. */ -ui_out::ui_out (ui_out_impl_base *impl, int flags) +ui_out::ui_out (ui_out_impl_base *impl, ui_out_flags flags) : m_impl (impl), m_flags (flags) { diff --git a/gdb/ui-out.h b/gdb/ui-out.h index a0d8348..ea6440e 100644 --- a/gdb/ui-out.h +++ b/gdb/ui-out.h @@ -45,12 +45,12 @@ enum ui_align }; /* flags enum */ -enum ui_flags +enum ui_out_flag { - ui_from_tty = 1, ui_source_list = 2 }; +DEF_ENUM_FLAGS_TYPE (ui_out_flag, ui_out_flags); /* Prototypes for ui-out API. */ @@ -162,7 +162,7 @@ class ui_out { public: - ui_out (ui_out_impl_base *impl, int flags = 0); + ui_out (ui_out_impl_base *impl, ui_out_flags flags = 0); ui_out_impl_base *impl (); @@ -204,7 +204,7 @@ class ui_out /* Redirect the output of a ui_out object temporarily. */ int redirect (ui_file *outstream); - int test_flags (int mask); + ui_out_flags test_flags (ui_out_flags mask); /* HACK: Code in GDB is currently checking to see the type of ui_out builder when determining which output to produce. This function is @@ -221,7 +221,7 @@ class ui_out /* Specific implementation of ui-out. */ std::unique_ptr m_impl; - int m_flags; + ui_out_flags m_flags; /* Vector to store and track the ui-out levels. */ std::vector> m_levels; -- 2.10.0