public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] gas: S_GET_{NAME, SEGMENT}() don't alter their input symbol
@ 2023-11-08  8:29 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2023-11-08  8:29 UTC (permalink / raw)
  To: bfd-cvs

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

commit 80968745ee9fd6b48996e35adaf998d1ccf35642
Author: Jan Beulich <jbeulich@suse.com>
Date:   Wed Nov 8 09:29:39 2023 +0100

    gas: S_GET_{NAME,SEGMENT}() don't alter their input symbol
    
    Make their parameters pointer-to-const, thus allowing callers to also be
    const-correct where possible.

Diff:
---
 gas/symbols.c | 4 ++--
 gas/symbols.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gas/symbols.c b/gas/symbols.c
index 45e46ed39b7..b07ed244142 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -2484,13 +2484,13 @@ S_IS_FORWARD_REF (const symbolS *s)
 }
 
 const char *
-S_GET_NAME (symbolS *s)
+S_GET_NAME (const symbolS *s)
 {
   return s->name;
 }
 
 segT
-S_GET_SEGMENT (symbolS *s)
+S_GET_SEGMENT (const symbolS *s)
 {
   if (s->flags.local_symbol)
     return ((struct local_symbol *) s)->section;
diff --git a/gas/symbols.h b/gas/symbols.h
index 46425c97d79..55fae25b99f 100644
--- a/gas/symbols.h
+++ b/gas/symbols.h
@@ -109,8 +109,8 @@ extern int S_IS_STABD (symbolS *);
 extern int S_CAN_BE_REDEFINED (const symbolS *);
 extern int S_IS_VOLATILE (const symbolS *);
 extern int S_IS_FORWARD_REF (const symbolS *);
-extern const char *S_GET_NAME (symbolS *);
-extern segT S_GET_SEGMENT (symbolS *);
+extern const char *S_GET_NAME (const symbolS *);
+extern segT S_GET_SEGMENT (const symbolS *);
 extern void S_SET_SEGMENT (symbolS *, segT);
 extern void S_SET_EXTERNAL (symbolS *);
 extern void S_SET_NAME (symbolS *, const char *);

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

only message in thread, other threads:[~2023-11-08  8:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-08  8:29 [binutils-gdb] gas: S_GET_{NAME, SEGMENT}() don't alter their input symbol Jan Beulich

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).