Make null_ptid and minus_one_ptid "const"
authorTom Tromey <tromey@adacore.com>
Mon, 4 Mar 2019 19:05:47 +0000 (12:05 -0700)
committerTom Tromey <tromey@adacore.com>
Tue, 12 Mar 2019 16:45:37 +0000 (10:45 -0600)
This makes null_ptid and minus_one_ptid "const".  I think this is an
improvement because it means they can't be accidentally modified.

2019-03-12  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
gdb/common/ptid.c
gdb/common/ptid.h

index 5e9beb9b7a6736e36ff49df448dd38a3e6d74c25..e6903f22819ae4a25bb836f78b56e9bb13903556 100644 (file)
@@ -1,3 +1,8 @@
+2019-03-12  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.
+
 2019-03-12  Tom Tromey  <tromey@adacore.com>
 
        * linux-nat.c (iterate_over_lwps): Update.
index 93f853af802b99264e9e2556fcdff89602299182..c025511a37bebbfe55ae8967b84c083be30500e1 100644 (file)
@@ -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 ();
index 31440c8d7cd953b9ab01d99e522ede5a74d39727..f5625a61387b5bfd44b88f464571b5ace1de921f 100644 (file)
@@ -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 */
This page took 0.029977 seconds and 4 git commands to generate.