Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH 2/2] Make null_ptid and minus_one_ptid "const"
Date: Mon, 04 Mar 2019 20:25:00 -0000	[thread overview]
Message-ID: <20190304202516.19100-3-tromey@adacore.com> (raw)
In-Reply-To: <20190304202516.19100-1-tromey@adacore.com>

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  <tromey@adacore.com>

	* 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 */
-- 
2.20.1


  reply	other threads:[~2019-03-04 20:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-04 20:25 [PATCH 0/2] constify null_ptid and minus_one_ptid Tom Tromey
2019-03-04 20:25 ` Tom Tromey [this message]
2019-03-04 23:30   ` [PATCH 2/2] Make null_ptid and minus_one_ptid "const" Kevin Buettner
2019-03-04 20:25 ` [PATCH 1/2] Change iterate_over_lwps to take a gdb::function_view Tom Tromey
2019-03-04 23:28   ` Kevin Buettner
2019-03-12 16:46 ` [PATCH 0/2] constify null_ptid and minus_one_ptid Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190304202516.19100-3-tromey@adacore.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox