From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id C5178385DC3B; Thu, 7 Apr 2022 15:08:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C5178385DC3B Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: have reggroup_find return a const X-Act-Checkin: binutils-gdb X-Git-Author: Andrew Burgess X-Git-Refname: refs/heads/master X-Git-Oldrev: 0ee336595924558bde5486becd83a9e4c40059ed X-Git-Newrev: 2b72890eba0373fee1e5c6f6ac0157782222ef3d Message-Id: <20220407150811.C5178385DC3B@sourceware.org> Date: Thu, 7 Apr 2022 15:08:11 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Apr 2022 15:08:11 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D2b72890eba03= 73fee1e5c6f6ac0157782222ef3d commit 2b72890eba0373fee1e5c6f6ac0157782222ef3d Author: Andrew Burgess Date: Thu Mar 31 16:24:32 2022 +0100 gdb: have reggroup_find return a const =20 Update reggroup_find to return a const reggroup *. =20 There are other function in gdb/reggroup.{c,h} files that could benefit from returning const, these will be updated in later commits. =20 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, i= nt regnum, =20 /* See reggroups.h. */ =20 -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 *gd= barch, 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); =20 /* Is REGNUM a member of REGGROUP? */ extern int default_register_reggroup_p (struct gdbarch *gdbarch, int regnu= m,