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)
This commit is contained in:
Bjoern A. Zeeb 2010-06-10 14:19:51 +00:00
parent 3e241e2e08
commit 54e57c8145
4 changed files with 12 additions and 12 deletions

View File

@ -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

View File

@ -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 */

View File

@ -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

View File

@ -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;