Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jun 2010 14:19:51 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r208986 - in head: share/man/man5 sys/sys usr.bin/ipcs
Message-ID:  <201006101419.o5AEJpX7074091@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Thu Jun 10 14:19:51 2010
New Revision: 208986
URL: http://svn.freebsd.org/changeset/base/208986

Log:
  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)

Modified:
  head/share/man/man5/a.out.5
  head/share/man/man5/stab.5
  head/sys/sys/nlist_aout.h
  head/usr.bin/ipcs/ipc.c

Modified: head/share/man/man5/a.out.5
==============================================================================
--- head/share/man/man5/a.out.5	Thu Jun 10 12:15:09 2010	(r208985)
+++ head/share/man/man5/a.out.5	Thu Jun 10 14:19:51 2010	(r208986)
@@ -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

Modified: head/share/man/man5/stab.5
==============================================================================
--- head/share/man/man5/stab.5	Thu Jun 10 12:15:09 2010	(r208985)
+++ head/share/man/man5/stab.5	Thu Jun 10 14:19:51 2010	(r208986)
@@ -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 */

Modified: head/sys/sys/nlist_aout.h
==============================================================================
--- head/sys/sys/nlist_aout.h	Thu Jun 10 12:15:09 2010	(r208985)
+++ head/sys/sys/nlist_aout.h	Thu Jun 10 14:19:51 2010	(r208986)
@@ -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

Modified: head/usr.bin/ipcs/ipc.c
==============================================================================
--- head/usr.bin/ipcs/ipc.c	Thu Jun 10 12:15:09 2010	(r208985)
+++ head/usr.bin/ipcs/ipc.c	Thu Jun 10 14:19:51 2010	(r208986)
@@ -128,7 +128,7 @@ sysctlgatherstruct(void *addr, size_t si
 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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006101419.o5AEJpX7074091>