From patchwork Mon Mar 4 20:25:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 31715 Received: (qmail 89748 invoked by alias); 4 Mar 2019 20:25:25 -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 89376 invoked by uid 89); 4 Mar 2019 20:25:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=H*MI:sk:2019030, HContent-Transfer-Encoding:8bit X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 04 Mar 2019 20:25:21 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9BD8B56127; Mon, 4 Mar 2019 15:25:19 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id DxSFqmv17KTB; Mon, 4 Mar 2019 15:25:19 -0500 (EST) Received: from murgatroyd.Home (75-166-85-218.hlrn.qwest.net [75.166.85.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 486DC560BB; Mon, 4 Mar 2019 15:25:19 -0500 (EST) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 2/2] Make null_ptid and minus_one_ptid "const" Date: Mon, 4 Mar 2019 13:25:16 -0700 Message-Id: <20190304202516.19100-3-tromey@adacore.com> In-Reply-To: <20190304202516.19100-1-tromey@adacore.com> References: <20190304202516.19100-1-tromey@adacore.com> MIME-Version: 1.0 This makes null_ptid and minus_one_ptid "const". I think this is an improvement because it means they can't be accidentally modified. xgdb/ChangeLog 2019-03-04 Tom Tromey * common/ptid.c (null_ptid, minus_one_ptid): Now const. * common/ptid.h (null_ptid, minus_one_ptid): Now const. --- gdb/ChangeLog | 5 +++++ gdb/common/ptid.c | 4 ++-- gdb/common/ptid.h | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gdb/common/ptid.c b/gdb/common/ptid.c index 93f853af802..c025511a37b 100644 --- a/gdb/common/ptid.c +++ b/gdb/common/ptid.c @@ -22,5 +22,5 @@ /* See ptid.h for these. */ -ptid_t null_ptid = ptid_t::make_null (); -ptid_t minus_one_ptid = ptid_t::make_minus_one (); +ptid_t const null_ptid = ptid_t::make_null (); +ptid_t const minus_one_ptid = ptid_t::make_minus_one (); diff --git a/gdb/common/ptid.h b/gdb/common/ptid.h index 31440c8d7cd..f5625a61387 100644 --- a/gdb/common/ptid.h +++ b/gdb/common/ptid.h @@ -145,11 +145,11 @@ private: /* The null or zero ptid, often used to indicate no process. */ -extern ptid_t null_ptid; +extern const ptid_t null_ptid; /* The (-1,0,0) ptid, often used to indicate either an error condition or a "don't care" condition, i.e, "run all threads." */ -extern ptid_t minus_one_ptid; +extern const ptid_t minus_one_ptid; #endif /* COMMON_PTID_H */