summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2010-06-10 14:19:51 +0000
committerbz <bz@FreeBSD.org>2010-06-10 14:19:51 +0000
commitfb808063cd6ca3766528a3fd83fb51fb7070200d (patch)
tree60ded25b046446fba7a26b20b51ebb5ab4ad8ee6
parent5e643891b23b4b4ccc04283256c9c16f616caf02 (diff)
downloadFreeBSD-src-fb808063cd6ca3766528a3fd83fb51fb7070200d.zip
FreeBSD-src-fb808063cd6ca3766528a3fd83fb51fb7070200d.tar.gz
Make the char *n_name member of struct nlist 'const'.
This avoids errors or __DECONST() from places with higher WARNS levels. Adjust a local cache variable in ipcs to const as well to compile in the new world order. Suggested by: jhb Reviewed by: jhb, kib, brueffer (man)
-rw-r--r--share/man/man5/a.out.514
-rw-r--r--share/man/man5/stab.54
-rw-r--r--sys/sys/nlist_aout.h4
-rw-r--r--usr.bin/ipcs/ipc.c2
4 files changed, 12 insertions, 12 deletions
diff --git a/share/man/man5/a.out.5 b/share/man/man5/a.out.5
index 137b2e4..d6318ef 100644
--- a/share/man/man5/a.out.5
+++ b/share/man/man5/a.out.5
@@ -35,7 +35,7 @@
.\" @(#)a.out.5 8.1 (Berkeley) 6/5/93
.\" $FreeBSD$
.\"
-.Dd June 5, 1993
+.Dd June 10, 2010
.Dt A.OUT 5
.Os
.Sh NAME
@@ -307,13 +307,13 @@ structures:
.Bd -literal -offset indent
struct nlist {
union {
- char *n_name;
- long n_strx;
+ const char *n_name;
+ long n_strx;
} n_un;
- unsigned char n_type;
- char n_other;
- short n_desc;
- unsigned long n_value;
+ unsigned char n_type;
+ char n_other;
+ short n_desc;
+ unsigned long n_value;
};
.Ed
.Pp
diff --git a/share/man/man5/stab.5 b/share/man/man5/stab.5
index bbbd292..bc4e680 100644
--- a/share/man/man5/stab.5
+++ b/share/man/man5/stab.5
@@ -32,7 +32,7 @@
.\" @(#)stab.5 8.1 (Berkeley) 6/5/93
.\" $FreeBSD$
.\"
-.Dd June 5, 1993
+.Dd June 10, 2010
.Dt STAB 5
.Os
.Sh NAME
@@ -79,7 +79,7 @@ consists of the following structure:
struct nlist {
union {
- char *n_name; /* for use when in-core */
+ const char *n_name; /* for use when in-core */
long n_strx; /* index into file string table */
} n_un;
unsigned char n_type; /* type flag */
diff --git a/sys/sys/nlist_aout.h b/sys/sys/nlist_aout.h
index a4e11c3..fc7a3c7 100644
--- a/sys/sys/nlist_aout.h
+++ b/sys/sys/nlist_aout.h
@@ -51,11 +51,11 @@
struct nlist {
#ifdef _AOUT_INCLUDE_
union {
- char *n_name; /* symbol name (in memory) */
+ const char *n_name; /* symbol name (in memory) */
long n_strx; /* file string table offset (on disk) */
} n_un;
#else
- char *n_name; /* symbol name (in memory) */
+ const char *n_name; /* symbol name (in memory) */
int : 8 * (sizeof(long) > sizeof(char *) ?
sizeof(long) - sizeof(char *) : sizeof(char *) - sizeof(long));
#endif
diff --git a/usr.bin/ipcs/ipc.c b/usr.bin/ipcs/ipc.c
index dfb4bae..f904e01 100644
--- a/usr.bin/ipcs/ipc.c
+++ b/usr.bin/ipcs/ipc.c
@@ -128,7 +128,7 @@ sysctlgatherstruct(void *addr, size_t size, struct scgs_vector *vecarr)
void
kget(int idx, void *addr, size_t size)
{
- char *symn; /* symbol name */
+ const char *symn; /* symbol name */
size_t tsiz;
int rv;
unsigned long kaddr;
OpenPOWER on IntegriCloud