public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb: have reggroup_find return a const
@ 2022-04-07 15:08 Andrew Burgess
  0 siblings, 0 replies; only message in thread
From: Andrew Burgess @ 2022-04-07 15:08 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2b72890eba0373fee1e5c6f6ac0157782222ef3d

commit 2b72890eba0373fee1e5c6f6ac0157782222ef3d
Author: Andrew Burgess <aburgess@redhat.com>
Date:   Thu Mar 31 16:24:32 2022 +0100

    gdb: have reggroup_find return a const
    
    Update reggroup_find to return a const reggroup *.
    
    There are other function in gdb/reggroup.{c,h} files that could
    benefit from returning const, these will be updated in later commits.
    
    There should be no user visible changes after this commit.

Diff:
---
 gdb/reggroups.c | 2 +-
 gdb/reggroups.h | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/gdb/reggroups.c b/gdb/reggroups.c
index d5a263f8109..6c38ca743f4 100644
--- a/gdb/reggroups.c
+++ b/gdb/reggroups.c
@@ -219,7 +219,7 @@ default_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
 
 /* See reggroups.h.  */
 
-reggroup *
+const reggroup *
 reggroup_find (struct gdbarch *gdbarch, const char *name)
 {
   struct reggroup *group;
diff --git a/gdb/reggroups.h b/gdb/reggroups.h
index df8e871e365..bc87a7325f0 100644
--- a/gdb/reggroups.h
+++ b/gdb/reggroups.h
@@ -62,7 +62,8 @@ extern struct reggroup *reggroup_next (struct gdbarch *gdbarch,
 extern struct reggroup *reggroup_prev (struct gdbarch *gdbarch,
 				       const struct reggroup *curr);
 /* Find a reggroup by name.  */
-extern reggroup *reggroup_find (struct gdbarch *gdbarch, const char *name);
+extern const reggroup *reggroup_find (struct gdbarch *gdbarch,
+				      const char *name);
 
 /* Is REGNUM a member of REGGROUP?  */
 extern int default_register_reggroup_p (struct gdbarch *gdbarch, int regnum,


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-07 15:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-07 15:08 [binutils-gdb] gdb: have reggroup_find return a const Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).