svn commit: r228468 - in head: include sys/dev/uart sys/sys usr.bin/mail

Ed Schouten ed at FreeBSD.org
Tue Dec 13 13:32:57 UTC 2011


Author: ed
Date: Tue Dec 13 13:32:56 2011
New Revision: 228468
URL: http://svn.freebsd.org/changeset/base/228468

Log:
  Replace __const by const in all non-contributed source code.
  
  As C1X is close to being released, there is no need to wrap around a
  feature that is already part of C90. Most of these files already use
  `const' in different placed as well.

Modified:
  head/include/netdb.h
  head/include/regex.h
  head/include/signal.h
  head/include/stdio.h
  head/include/stdlib.h
  head/sys/dev/uart/uart_subr.c
  head/sys/sys/types.h
  head/usr.bin/mail/extern.h
  head/usr.bin/mail/lex.c

Modified: head/include/netdb.h
==============================================================================
--- head/include/netdb.h	Tue Dec 13 13:03:11 2011	(r228467)
+++ head/include/netdb.h	Tue Dec 13 13:32:56 2011	(r228468)
@@ -276,7 +276,7 @@ int		getservbyport_r(int, const char *, 
 int		getservent_r(struct servent *, char *, size_t,
     struct servent **);
 void		herror(const char *);
-__const char	*hstrerror(int);
+const char	*hstrerror(int);
 int		innetgr(const char *, const char *, const char *, const char *);
 void		setnetgrent(const char *);
 #endif

Modified: head/include/regex.h
==============================================================================
--- head/include/regex.h	Tue Dec 13 13:03:11 2011	(r228467)
+++ head/include/regex.h	Tue Dec 13 13:32:56 2011	(r228468)
@@ -51,7 +51,7 @@ typedef	__size_t	size_t;
 typedef struct {
 	int re_magic;
 	size_t re_nsub;		/* number of parenthesized subexpressions */
-	__const char *re_endp;	/* end pointer for REG_PEND */
+	const char *re_endp;	/* end pointer for REG_PEND */
 	struct re_guts *re_g;	/* none of your business :-) */
 } regex_t;
 

Modified: head/include/signal.h
==============================================================================
--- head/include/signal.h	Tue Dec 13 13:03:11 2011	(r228467)
+++ head/include/signal.h	Tue Dec 13 13:32:56 2011	(r228468)
@@ -42,9 +42,9 @@
  * XXX should enlarge these, if only to give empty names instead of bounds
  * errors for large signal numbers.
  */
-extern __const char *__const sys_signame[NSIG];
-extern __const char *__const sys_siglist[NSIG];
-extern __const int sys_nsig;
+extern const char * const sys_signame[NSIG];
+extern const char * const sys_siglist[NSIG];
+extern const int sys_nsig;
 #endif
 
 #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE

Modified: head/include/stdio.h
==============================================================================
--- head/include/stdio.h	Tue Dec 13 13:03:11 2011	(r228467)
+++ head/include/stdio.h	Tue Dec 13 13:32:56 2011	(r228468)
@@ -404,8 +404,8 @@ int	 vasprintf(char **, const char *, __
  * positive errno values.  Use strerror() or strerror_r() from <string.h>
  * instead.
  */
-extern __const int sys_nerr;
-extern __const char *__const sys_errlist[];
+extern const int sys_nerr;
+extern const char * const sys_errlist[];
 
 /*
  * Stdio function-access interface.

Modified: head/include/stdlib.h
==============================================================================
--- head/include/stdlib.h	Tue Dec 13 13:03:11 2011	(r228467)
+++ head/include/stdlib.h	Tue Dec 13 13:32:56 2011	(r228468)
@@ -271,7 +271,7 @@ char 	*devname_r(__dev_t, __mode_t, char
 char	*fdevname(int);
 char 	*fdevname_r(int, char *, int);
 int	 getloadavg(double [], int);
-__const char *
+const char *
 	 getprogname(void);
 
 int	 heapsort(void *, size_t, size_t, int (*)(const void *, const void *));

Modified: head/sys/dev/uart/uart_subr.c
==============================================================================
--- head/sys/dev/uart/uart_subr.c	Tue Dec 13 13:03:11 2011	(r228467)
+++ head/sys/dev/uart/uart_subr.c	Tue Dec 13 13:32:56 2011	(r228468)
@@ -56,13 +56,13 @@ static struct uart_class *uart_classes[]
 static size_t uart_nclasses = sizeof(uart_classes) / sizeof(uart_classes[0]);
 
 static bus_addr_t
-uart_parse_addr(__const char **p)
+uart_parse_addr(const char **p)
 {
 	return (strtoul(*p, (char**)(uintptr_t)p, 0));
 }
 
 static struct uart_class *
-uart_parse_class(struct uart_class *class, __const char **p)
+uart_parse_class(struct uart_class *class, const char **p)
 {
 	struct uart_class *uc;
 	const char *nm;
@@ -84,13 +84,13 @@ uart_parse_class(struct uart_class *clas
 }
 
 static long
-uart_parse_long(__const char **p)
+uart_parse_long(const char **p)
 {
 	return (strtol(*p, (char**)(uintptr_t)p, 0));
 }
 
 static int
-uart_parse_parity(__const char **p)
+uart_parse_parity(const char **p)
 {
 	if (!strncmp(*p, "even", 4)) {
 		*p += 4;
@@ -116,7 +116,7 @@ uart_parse_parity(__const char **p)
 }
 
 static int
-uart_parse_tag(__const char **p)
+uart_parse_tag(const char **p)
 {
 	int tag;
 
@@ -192,7 +192,7 @@ out:
 int
 uart_getenv(int devtype, struct uart_devinfo *di, struct uart_class *class)
 {
-	__const char *spec;
+	const char *spec;
 	bus_addr_t addr = ~0U;
 	int error;
 

Modified: head/sys/sys/types.h
==============================================================================
--- head/sys/sys/types.h	Tue Dec 13 13:03:11 2011	(r228467)
+++ head/sys/sys/types.h	Tue Dec 13 13:32:56 2011	(r228468)
@@ -72,7 +72,7 @@ typedef	__int64_t	quad_t;
 typedef	quad_t *	qaddr_t;
 
 typedef	char *		caddr_t;	/* core address */
-typedef	__const char *	c_caddr_t;	/* core address, pointer to const */
+typedef	const char *	c_caddr_t;	/* core address, pointer to const */
 typedef	__volatile char *v_caddr_t;	/* core address, pointer to volatile */
 
 #ifndef _BLKSIZE_T_DECLARED

Modified: head/usr.bin/mail/extern.h
==============================================================================
--- head/usr.bin/mail/extern.h	Tue Dec 13 13:03:11 2011	(r228467)
+++ head/usr.bin/mail/extern.h	Tue Dec 13 13:32:56 2011	(r228468)
@@ -154,7 +154,7 @@ int	 ishead(char []);
 int	 isign(const char *, struct ignoretab []);
 int	 isprefix(const char *, const char *);
 void	 istrncpy(char *, const char *, size_t);
-__const struct cmd *
+const struct cmd *
 	 lex(char []);
 void	 load(char *);
 struct var *

Modified: head/usr.bin/mail/lex.c
==============================================================================
--- head/usr.bin/mail/lex.c	Tue Dec 13 13:03:11 2011	(r228467)
+++ head/usr.bin/mail/lex.c	Tue Dec 13 13:32:56 2011	(r228468)
@@ -482,7 +482,7 @@ setmsize(int sz)
  * to the passed command "word"
  */
 
-__const struct cmd *
+const struct cmd *
 lex(char word[])
 {
 	const struct cmd *cp;


More information about the svn-src-head mailing list