From patchwork Thu Nov 28 15:05:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 36355 Received: (qmail 47613 invoked by alias); 28 Nov 2019 15:07:21 -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 47605 invoked by uid 89); 28 Nov 2019 15:07:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.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=HX-Languages-Length:1252 X-HELO: gateway22.websitewelcome.com Received: from gateway22.websitewelcome.com (HELO gateway22.websitewelcome.com) (192.185.46.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 28 Nov 2019 15:07:16 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway22.websitewelcome.com (Postfix) with ESMTP id 0294826CA7 for ; Thu, 28 Nov 2019 09:05:53 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id aLMeiRBJSOdBHaLMeidBhM; Thu, 28 Nov 2019 09:05:53 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=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: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=vDvc7e8iGI2tkYYd5akvnR5rWqJniBKLyNgrMZqCXNg=; b=qyZVUfmcqpP6FjPESbFgXBXSgO ZIEqD1Wswi8fNIlMt2ChbPHm2HkS17svVHrZnSLIaNxHOPJKAqTYW2YQbyrPwhKg0BBpBsVlohVnn PW6+lz+EYiGwzmwnuWJqMflnu; Received: from 97-118-104-188.hlrn.qwest.net ([97.118.104.188]:54000 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iaLMe-004JGZ-Mp; Thu, 28 Nov 2019 08:05:52 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [FYI] Make two range_bounds bitfields unsigned Date: Thu, 28 Nov 2019 08:05:50 -0700 Message-Id: <20191128150550.18943-1-tom@tromey.com> While debugging gdb, I noticed that the bitfields in a range_bounds were signed, causing the values of these fields to be -1. I think this is odd; and while we haven't yet committed to boolean bitfields, I think it is a small improvement to change these types to unsigned. gdb/ChangeLog 2019-11-28 Tom Tromey * gdbtypes.h (struct range_bounds) : Now unsigned. Change-Id: Ia377fd931594bbf8653180d4dcb4e60354d90139 --- gdb/ChangeLog | 5 +++++ gdb/gdbtypes.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 8fc770c5d39..2e128aae063 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -631,12 +631,12 @@ struct range_bounds /* True if HIGH range bound contains the number of elements in the subrange. This affects how the final high bound is computed. */ - int flag_upper_bound_is_count : 1; + unsigned int flag_upper_bound_is_count : 1; /* True if LOW or/and HIGH are resolved into a static bound from a dynamic one. */ - int flag_bound_evaluated : 1; + unsigned int flag_bound_evaluated : 1; }; /* Compare two range_bounds objects for equality. Simply does