diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2020-10-13 04:42:29 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2020-10-13 04:42:29 +0000 |
commit | 7d2d48defa5eea5adad144680c48f1abb8afdd45 (patch) | |
tree | 8dc0b9f9a77ebaa4b610fca2ab3fcf1912c6f167 /lib | |
parent | 0f48951455a429354d6cfe23c4604d2c4d5971c3 (diff) |
Do some easy .data -> .rodata/.data.rel.ro conversions
ok millert@ deraadt@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/gen/auth_subr.c | 4 | ||||
-rw-r--r-- | lib/libc/gen/charclass.h | 4 | ||||
-rw-r--r-- | lib/libc/gen/fnmatch.c | 4 | ||||
-rw-r--r-- | lib/libc/gen/glob.c | 4 | ||||
-rw-r--r-- | lib/libc/hash/md5.c | 4 | ||||
-rw-r--r-- | lib/libc/hash/rmd160.c | 2 | ||||
-rw-r--r-- | lib/libc/regex/cclass.h | 10 | ||||
-rw-r--r-- | lib/libc/regex/regcomp.c | 10 | ||||
-rw-r--r-- | lib/libc/rpc/getrpcent.c | 4 |
9 files changed, 23 insertions, 23 deletions
diff --git a/lib/libc/gen/auth_subr.c b/lib/libc/gen/auth_subr.c index 11c6416a274..e28a55e7ecb 100644 --- a/lib/libc/gen/auth_subr.c +++ b/lib/libc/gen/auth_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auth_subr.c,v 1.55 2020/07/06 13:33:06 pirofti Exp $ */ +/* $OpenBSD: auth_subr.c,v 1.56 2020/10/13 04:42:28 guenther Exp $ */ /* * Copyright (c) 2000-2002,2004 Todd C. Miller <millert@openbsd.org> @@ -134,7 +134,7 @@ static char *_auth_next_arg(auth_session_t *); /* * Set up a known environment for all authentication scripts. */ -static char *auth_environ[] = { +static char * const auth_environ[] = { "PATH=" _PATH_DEFPATH, "SHELL=" _PATH_BSHELL, NULL, diff --git a/lib/libc/gen/charclass.h b/lib/libc/gen/charclass.h index 073baf69cd7..1d1ec079511 100644 --- a/lib/libc/gen/charclass.h +++ b/lib/libc/gen/charclass.h @@ -1,13 +1,13 @@ /* * Public domain, 2008, Todd C. Miller <millert@openbsd.org> * - * $OpenBSD: charclass.h,v 1.2 2019/01/25 00:19:25 millert Exp $ + * $OpenBSD: charclass.h,v 1.3 2020/10/13 04:42:28 guenther Exp $ */ /* * POSIX character class support for fnmatch() and glob(). */ -static struct cclass { +static const struct cclass { const char *name; int (*isctype)(int); } cclasses[] = { diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c index d7afd5f8ee2..ff6b26e98c0 100644 --- a/lib/libc/gen/fnmatch.c +++ b/lib/libc/gen/fnmatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fnmatch.c,v 1.22 2020/03/13 03:25:45 djm Exp $ */ +/* $OpenBSD: fnmatch.c,v 1.23 2020/10/13 04:42:28 guenther Exp $ */ /* Copyright (c) 2011, VMware, Inc. * All rights reserved. @@ -100,7 +100,7 @@ classmatch(const char *pattern, char test, int foldcase, const char **ep) { const char * const mismatch = pattern; const char *colon; - struct cclass *cc; + const struct cclass *cc; int rval = RANGE_NOMATCH; size_t len; diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c index 58ece51059f..fb24af6cdc6 100644 --- a/lib/libc/gen/glob.c +++ b/lib/libc/gen/glob.c @@ -1,4 +1,4 @@ -/* $OpenBSD: glob.c,v 1.49 2020/04/21 08:25:22 dtucker Exp $ */ +/* $OpenBSD: glob.c,v 1.50 2020/10/13 04:42:28 guenther Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -429,7 +429,7 @@ g_charclass(const Char **patternp, Char **bufnextp) const Char *pattern = *patternp + 1; Char *bufnext = *bufnextp; const Char *colon; - struct cclass *cc; + const struct cclass *cc; size_t len; if ((colon = g_strchr(pattern, ':')) == NULL || colon[1] != ']') diff --git a/lib/libc/hash/md5.c b/lib/libc/hash/md5.c index 435e5ac8838..93555abc2ac 100644 --- a/lib/libc/hash/md5.c +++ b/lib/libc/hash/md5.c @@ -1,4 +1,4 @@ -/* $OpenBSD: md5.c,v 1.11 2015/09/11 09:18:27 guenther Exp $ */ +/* $OpenBSD: md5.c,v 1.12 2020/10/13 04:42:28 guenther Exp $ */ /* * This code implements the MD5 message-digest algorithm. @@ -37,7 +37,7 @@ (cp)[1] = (value) >> 8; \ (cp)[0] = (value); } while (0) -static u_int8_t PADDING[MD5_BLOCK_LENGTH] = { +static const u_int8_t PADDING[MD5_BLOCK_LENGTH] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 diff --git a/lib/libc/hash/rmd160.c b/lib/libc/hash/rmd160.c index 3bf5801221c..9fac3e7085d 100644 --- a/lib/libc/hash/rmd160.c +++ b/lib/libc/hash/rmd160.c @@ -82,7 +82,7 @@ #define X(i) x[i] -static u_int8_t PADDING[RMD160_BLOCK_LENGTH] = { +static const u_int8_t PADDING[RMD160_BLOCK_LENGTH] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 diff --git a/lib/libc/regex/cclass.h b/lib/libc/regex/cclass.h index 9f144a6b696..9a1bea88729 100644 --- a/lib/libc/regex/cclass.h +++ b/lib/libc/regex/cclass.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cclass.h,v 1.5 2003/06/02 20:18:36 millert Exp $ */ +/* $OpenBSD: cclass.h,v 1.6 2020/10/13 04:42:28 guenther Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 Henry Spencer. @@ -36,10 +36,10 @@ */ /* character-class table */ -static struct cclass { - char *name; - char *chars; - char *multis; +static const struct cclass { + const char *name; + const char *chars; + const char *multis; } cclasses[] = { { "alnum", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ 0123456789", ""} , diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c index 3f2d46d0512..7396cf1dda5 100644 --- a/lib/libc/regex/regcomp.c +++ b/lib/libc/regex/regcomp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: regcomp.c,v 1.34 2019/02/05 20:57:30 millert Exp $ */ +/* $OpenBSD: regcomp.c,v 1.35 2020/10/13 04:42:28 guenther Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 Henry Spencer. * Copyright (c) 1992, 1993, 1994 @@ -90,7 +90,7 @@ static void freeset(struct parse *, cset *); static int freezeset(struct parse *, cset *); static int firstch(struct parse *, cset *); static int nch(struct parse *, cset *); -static void mcadd(struct parse *, cset *, char *); +static void mcadd(struct parse *, cset *, const char *); static void mcinvert(struct parse *, cset *); static void mccase(struct parse *, cset *); static int isinsets(struct re_guts *, int); @@ -762,9 +762,9 @@ static void p_b_cclass(struct parse *p, cset *cs) { char *sp = p->next; - struct cclass *cp; + const struct cclass *cp; size_t len; - char *u; + const char *u; char c; while (MORE() && isalpha((uch)PEEK())) @@ -1177,7 +1177,7 @@ nch(struct parse *p, cset *cs) - mcadd - add a collating element to a cset */ static void -mcadd( struct parse *p, cset *cs, char *cp) +mcadd( struct parse *p, cset *cs, const char *cp) { size_t oldend = cs->smultis; void *np; diff --git a/lib/libc/rpc/getrpcent.c b/lib/libc/rpc/getrpcent.c index 6581270c4bc..5786f11c7b4 100644 --- a/lib/libc/rpc/getrpcent.c +++ b/lib/libc/rpc/getrpcent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getrpcent.c,v 1.21 2015/09/13 15:36:56 guenther Exp $ */ +/* $OpenBSD: getrpcent.c,v 1.22 2020/10/13 04:42:28 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -52,7 +52,7 @@ static struct rpcdata { static struct rpcent *interpret(char *val, int len); -static char RPCDB[] = "/etc/rpc"; +static const char RPCDB[] = "/etc/rpc"; static struct rpcdata * _rpcdata(void) |