Skip to content

Commit

Permalink
Replace __const by const in all non-contributed source code.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Ed Schouten authored and Ed Schouten committed Dec 13, 2011
1 parent 1c6eedd commit f6ab808
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion include/netdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ int getservbyport_r(int, const char *, struct servent *, 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
Expand Down
2 changes: 1 addition & 1 deletion include/regex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions include/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions include/stdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,8 @@ int vasprintf(char **, const char *, __va_list)
* 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.
Expand Down
2 changes: 1 addition & 1 deletion include/stdlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ char *devname_r(__dev_t, __mode_t, char *, int);
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 *));
Expand Down
12 changes: 6 additions & 6 deletions sys/dev/uart/uart_subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -84,13 +84,13 @@ uart_parse_class(struct uart_class *class, __const char **p)
}

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

Expand Down Expand Up @@ -192,7 +192,7 @@ uart_parse_tag(__const char **p)
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;

Expand Down
2 changes: 1 addition & 1 deletion sys/sys/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion usr.bin/mail/extern.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down
2 changes: 1 addition & 1 deletion usr.bin/mail/lex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f6ab808

Please sign in to comment.