Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys make some more constant arrays 'const'



details:   https://anonhg.NetBSD.org/src/rev/507c494610c3
branches:  trunk
changeset: 504101:507c494610c3
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Wed Feb 21 21:39:52 2001 +0000

description:
make some more constant arrays 'const'

diffstat:

 sys/arch/i386/i386/procfs_machdep.c     |   4 +-
 sys/compat/linux/common/linux_termios.c |   4 +-
 sys/compat/svr4/svr4_errno.c            |   4 +-
 sys/compat/svr4/svr4_errno.h            |   4 +-
 sys/compat/svr4/svr4_signal.c           |   4 +-
 sys/compat/svr4/svr4_signal.h           |   4 +-
 sys/crypto/blowfish/bf_pi.h             |   4 +-
 sys/crypto/cast128/cast128.c            |  34 ++++++++++++++++----------------
 sys/crypto/des/des_setkey.c             |   6 ++--
 sys/crypto/rijndael/boxes-fst.dat       |  34 ++++++++++++++++----------------
 sys/dev/ic/elink3.c                     |  10 ++++----
 sys/dev/ic/i82365.c                     |   6 ++--
 sys/dev/ic/tulip.c                      |  14 ++++++------
 sys/dev/ic/tulipvar.h                   |   4 +-
 sys/dev/isa/spkr.c                      |   6 ++--
 sys/dev/pci/pccbb.c                     |   6 ++--
 sys/dev/pcmcia/if_xi.c                  |  12 +++++-----
 sys/dev/pcmcia/wdc_pcmcia.c             |  12 +++++-----
 sys/dev/usb/ukbd.c                      |   6 ++--
 sys/dev/usb/umidi.c                     |   6 ++--
 sys/kern/vfs_subr.c                     |   6 ++--
 sys/miscfs/kernfs/kernfs.h              |   4 +-
 sys/miscfs/kernfs/kernfs_vnops.c        |  24 +++++++++++-----------
 sys/miscfs/procfs/procfs_vnops.c        |   8 +++---
 sys/netkey/key.c                        |   8 +++---
 sys/nfs/nfs_nqlease.c                   |   4 +-
 sys/nfs/nfs_socket.c                    |   6 ++--
 sys/nfs/nfs_srvcache.c                  |   6 ++--
 sys/nfs/nfs_subs.c                      |   4 +-
 sys/sys/vnode.h                         |   4 +-
 30 files changed, 129 insertions(+), 129 deletions(-)

diffs (truncated from 1085 to 300 lines):

diff -r 50df82b4f642 -r 507c494610c3 sys/arch/i386/i386/procfs_machdep.c
--- a/sys/arch/i386/i386/procfs_machdep.c       Wed Feb 21 19:24:30 2001 +0000
+++ b/sys/arch/i386/i386/procfs_machdep.c       Wed Feb 21 21:39:52 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: procfs_machdep.c,v 1.5 2001/01/18 17:48:00 tv Exp $    */
+/*     $NetBSD: procfs_machdep.c,v 1.6 2001/02/21 21:39:59 jdolecek Exp $      */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -51,7 +51,7 @@
 extern char cpu_vendor[];
 extern int cpu_id, cpu_class;
 
-static const char *i386_features[] = {
+static const char * const i386_features[] = {
        "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
        "cx8", "apic", "10", "sep", "mtrr", "pge", "mca", "cmov",
        "fgpat", "pse36", "psn", "19", "20", "21", "22", "mmx",
diff -r 50df82b4f642 -r 507c494610c3 sys/compat/linux/common/linux_termios.c
--- a/sys/compat/linux/common/linux_termios.c   Wed Feb 21 19:24:30 2001 +0000
+++ b/sys/compat/linux/common/linux_termios.c   Wed Feb 21 21:39:52 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_termios.c,v 1.10 2001/02/05 04:33:41 itojun Exp $        */
+/*     $NetBSD: linux_termios.c,v 1.11 2001/02/21 21:39:57 jdolecek Exp $      */
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
        9600, 19200, 38400, 57600, 115200, 230400
 };
 
-static int linux_spmasks[] = {
+static const int linux_spmasks[] = {
        LINUX_B0, LINUX_B50, LINUX_B75, LINUX_B110, LINUX_B134, LINUX_B150,
        LINUX_B200, LINUX_B300, LINUX_B600, LINUX_B1200, LINUX_B1800,
        LINUX_B2400, LINUX_B4800, LINUX_B9600, LINUX_B19200, LINUX_B38400,
diff -r 50df82b4f642 -r 507c494610c3 sys/compat/svr4/svr4_errno.c
--- a/sys/compat/svr4/svr4_errno.c      Wed Feb 21 19:24:30 2001 +0000
+++ b/sys/compat/svr4/svr4_errno.c      Wed Feb 21 21:39:52 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_errno.c,v 1.7 1998/10/23 04:06:00 erh Exp $        */
+/*     $NetBSD: svr4_errno.c,v 1.8 2001/02/21 21:39:59 jdolecek Exp $   */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
 #include <compat/svr4/svr4_errno.h>
 
 
-int native_to_svr4_errno[] = {
+const int native_to_svr4_errno[] = {
        0,
        SVR4_EPERM,
        SVR4_ENOENT,
diff -r 50df82b4f642 -r 507c494610c3 sys/compat/svr4/svr4_errno.h
--- a/sys/compat/svr4/svr4_errno.h      Wed Feb 21 19:24:30 2001 +0000
+++ b/sys/compat/svr4/svr4_errno.h      Wed Feb 21 21:39:52 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_errno.h,v 1.5 1998/10/24 19:35:36 mrg Exp $        */
+/*     $NetBSD: svr4_errno.h,v 1.6 2001/02/21 21:39:59 jdolecek Exp $   */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -177,6 +177,6 @@
 #define        SVR4_EAUTH              SVR4_ENOSYS
 #define        SVR4_ENEEDAUTH          SVR4_ENOSYS
 
-extern int native_to_svr4_errno[];
+extern const int native_to_svr4_errno[];
 
 #endif /* !_SVR4_ERRNO_H_ */
diff -r 50df82b4f642 -r 507c494610c3 sys/compat/svr4/svr4_signal.c
--- a/sys/compat/svr4/svr4_signal.c     Wed Feb 21 19:24:30 2001 +0000
+++ b/sys/compat/svr4/svr4_signal.c     Wed Feb 21 21:39:52 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_signal.c,v 1.40 2000/12/22 22:58:59 jdolecek Exp $         */
+/*     $NetBSD: svr4_signal.c,v 1.41 2001/02/21 21:39:59 jdolecek Exp $         */
 
 /*-
  * Copyright (c) 1994, 1998 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
 void native_to_svr4_sigaction __P((const struct sigaction *,
                                struct svr4_sigaction *));
 
-int native_to_svr4_sig[NSIG] = {
+const int native_to_svr4_sig[NSIG] = {
        0,
        SVR4_SIGHUP,
        SVR4_SIGINT,
diff -r 50df82b4f642 -r 507c494610c3 sys/compat/svr4/svr4_signal.h
--- a/sys/compat/svr4/svr4_signal.h     Wed Feb 21 19:24:30 2001 +0000
+++ b/sys/compat/svr4/svr4_signal.h     Wed Feb 21 21:39:52 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_signal.h,v 1.18 1999/01/21 23:17:19 christos Exp $         */
+/*     $NetBSD: svr4_signal.h,v 1.19 2001/02/21 21:39:59 jdolecek Exp $         */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
 #define SVR4_SS_DISABLE                0x00000002
 #define SVR4_SS_ALLBITS                0x00000003
 
-extern int native_to_svr4_sig[];
+extern const int native_to_svr4_sig[];
 void native_to_svr4_sigset __P((const sigset_t *, svr4_sigset_t *));
 void svr4_to_native_sigset __P((const svr4_sigset_t *, sigset_t *));
 void native_to_svr4_sigaltstack __P((const struct sigaltstack *, struct svr4_sigaltstack *));
diff -r 50df82b4f642 -r 507c494610c3 sys/crypto/blowfish/bf_pi.h
--- a/sys/crypto/blowfish/bf_pi.h       Wed Feb 21 19:24:30 2001 +0000
+++ b/sys/crypto/blowfish/bf_pi.h       Wed Feb 21 21:39:52 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bf_pi.h,v 1.1.1.1 2000/06/14 19:45:33 thorpej Exp $    */
+/*     $NetBSD: bf_pi.h,v 1.2 2001/02/21 21:39:53 jdolecek Exp $       */
 /*     $KAME: bf_pi.h,v 1.3 2000/03/27 04:36:26 sumikawa Exp $ */
 
 /* crypto/bf/bf_pi.h */
@@ -59,7 +59,7 @@
  * [including the GNU Public Licence.]
  */
 
-static BF_KEY bf_init= {
+static const BF_KEY bf_init= {
        {
        0x243f6a88L, 0x85a308d3L, 0x13198a2eL, 0x03707344L,
        0xa4093822L, 0x299f31d0L, 0x082efa98L, 0xec4e6c89L,
diff -r 50df82b4f642 -r 507c494610c3 sys/crypto/cast128/cast128.c
--- a/sys/crypto/cast128/cast128.c      Wed Feb 21 19:24:30 2001 +0000
+++ b/sys/crypto/cast128/cast128.c      Wed Feb 21 21:39:52 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cast128.c,v 1.2 2000/11/06 14:11:41 itojun Exp $       */
+/*     $NetBSD: cast128.c,v 1.3 2001/02/21 21:39:52 jdolecek Exp $     */
 /*     $KAME: cast128.c,v 1.4 2000/11/06 13:58:08 itojun Exp $ */
 
 /*
@@ -46,14 +46,14 @@
 #include <crypto/cast128/cast128_subkey.h>
 
 
-static u_int32_t S1[];
-static u_int32_t S2[];
-static u_int32_t S3[];
-static u_int32_t S4[];
-static u_int32_t S5[];
-static u_int32_t S6[];
-static u_int32_t S7[];
-static u_int32_t S8[];
+static const u_int32_t S1[];
+static const u_int32_t S2[];
+static const u_int32_t S3[];
+static const u_int32_t S4[];
+static const u_int32_t S5[];
+static const u_int32_t S6[];
+static const u_int32_t S7[];
+static const u_int32_t S8[];
 
 
 /*
@@ -340,7 +340,7 @@
 }
 
 
-static u_int32_t S1[] = {
+static const u_int32_t S1[] = {
        0x30fb40d4, 0x9fa0ff0b, 0x6beccd2f, 0x3f258c7a,
        0x1e213f2f, 0x9c004dd3, 0x6003e540, 0xcf9fc949,
        0xbfd4af27, 0x88bbbdb5, 0xe2034090, 0x98d09675,
@@ -407,7 +407,7 @@
        0x427b169c, 0x5ac9f049, 0xdd8f0f00, 0x5c8165bf,
 };
 
-static u_int32_t S2[] = {
+static const u_int32_t S2[] = {
        0x1f201094, 0xef0ba75b, 0x69e3cf7e, 0x393f4380,
        0xfe61cf7a, 0xeec5207a, 0x55889c94, 0x72fc0651,
        0xada7ef79, 0x4e1d7235, 0xd55a63ce, 0xde0436ba,
@@ -474,7 +474,7 @@
        0x7160a539, 0x73bfbe70, 0x83877605, 0x4523ecf1,
 };
 
-static u_int32_t S3[] = {
+static const u_int32_t S3[] = {
        0x8defc240, 0x25fa5d9f, 0xeb903dbf, 0xe810c907,
        0x47607fff, 0x369fe44b, 0x8c1fc644, 0xaececa90,
        0xbeb1f9bf, 0xeefbcaea, 0xe8cf1950, 0x51df07ae,
@@ -541,7 +541,7 @@
        0xdfef4636, 0xa133c501, 0xe9d3531c, 0xee353783,
 };
 
-static u_int32_t S4[] = {
+static const u_int32_t S4[] = {
        0x9db30420, 0x1fb6e9de, 0xa7be7bef, 0xd273a298,
        0x4a4f7bdb, 0x64ad8c57, 0x85510443, 0xfa020ed1,
        0x7e287aff, 0xe60fb663, 0x095f35a1, 0x79ebf120,
@@ -608,7 +608,7 @@
        0x13ecf0b0, 0xd3ffb372, 0x3f85c5c1, 0x0aef7ed2,
 };
 
-static u_int32_t S5[] = {
+static const u_int32_t S5[] = {
        0x7ec90c04, 0x2c6e74b9, 0x9b0e66df, 0xa6337911,
        0xb86a7fff, 0x1dd358f5, 0x44dd9d44, 0x1731167f,
        0x08fbf1fa, 0xe7f511cc, 0xd2051b00, 0x735aba00,
@@ -675,7 +675,7 @@
        0x5e76ffa8, 0xb1534546, 0x6d47de08, 0xefe9e7d4,
 };
 
-static u_int32_t S6[] = {
+static const u_int32_t S6[] = {
        0xf6fa8f9d, 0x2cac6ce1, 0x4ca34867, 0xe2337f7c,
        0x95db08e7, 0x016843b4, 0xeced5cbc, 0x325553ac,
        0xbf9f0960, 0xdfa1e2ed, 0x83f0579d, 0x63ed86b9,
@@ -742,7 +742,7 @@
        0x48392905, 0xa65b1db8, 0x851c97bd, 0xd675cf2f,
 };
 
-static u_int32_t S7[] = {
+static const u_int32_t S7[] = {
        0x85e04019, 0x332bf567, 0x662dbfff, 0xcfc65693,
        0x2a8d7f6f, 0xab9bc912, 0xde6008a1, 0x2028da1f,
        0x0227bce7, 0x4d642916, 0x18fac300, 0x50f18b82,
@@ -809,7 +809,7 @@
        0xf2a279c7, 0x94e01be8, 0x90716f4b, 0x954b8aa3,
 };
 
-static u_int32_t S8[] = {
+static const u_int32_t S8[] = {
        0xe216300d, 0xbbddfffc, 0xa7ebdabd, 0x35648095,
        0x7789f8b7, 0xe6c1121b, 0x0e241600, 0x052ce8b5,
        0x11a9cfb0, 0xe5952f11, 0xece7990a, 0x9386d174,
diff -r 50df82b4f642 -r 507c494610c3 sys/crypto/des/des_setkey.c
--- a/sys/crypto/des/des_setkey.c       Wed Feb 21 19:24:30 2001 +0000
+++ b/sys/crypto/des/des_setkey.c       Wed Feb 21 21:39:52 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: des_setkey.c,v 1.3 2000/11/06 14:11:41 itojun Exp $    */
+/*     $NetBSD: des_setkey.c,v 1.4 2001/02/21 21:39:53 jdolecek Exp $  */
 /*     $KAME: des_setkey.c,v 1.5 2000/11/06 13:58:09 itojun Exp $      */
 
 /* crypto/des/set_key.c */
@@ -101,7 +101,7 @@
  * (and actual cblock values).
  */
 #define NUM_WEAK_KEY   16
-static des_cblock weak_keys[NUM_WEAK_KEY]={
+static const des_cblock weak_keys[NUM_WEAK_KEY]={
        /* weak keys */
        {0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},
        {0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE},
@@ -156,7 +156,7 @@
 des_cblock (*key);
 des_key_schedule schedule;
        {
-       static int shifts2[16]={0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0};
+       static const int shifts2[16]={0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0};
        register DES_LONG c,d,t,s;
        register unsigned char *in;
        register DES_LONG *k;
diff -r 50df82b4f642 -r 507c494610c3 sys/crypto/rijndael/boxes-fst.dat
--- a/sys/crypto/rijndael/boxes-fst.dat Wed Feb 21 19:24:30 2001 +0000
+++ b/sys/crypto/rijndael/boxes-fst.dat Wed Feb 21 21:39:52 2001 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: boxes-fst.dat,v 1.2 2000/10/02 17:19:15 itojun Exp $   */
+/*     $NetBSD: boxes-fst.dat,v 1.3 2001/02/21 21:39:53 jdolecek Exp $ */
 /*     $KAME: boxes-fst.dat,v 1.5 2000/10/02 17:14:26 itojun Exp $     */
 
-word8 S[256] = {
+const word8 S[256] = {
  99, 124, 119, 123, 242, 107, 111, 197,  48,   1, 103,  43, 254, 215, 171, 118, 
 202, 130, 201, 125, 250,  89,  71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 
 183, 253, 147,  38,  54,  63, 247, 204,  52, 165, 229, 241, 113, 216,  49,  21, 
@@ -21,7 +21,7 @@
 };
 
 #ifdef INTERMEDIATE_VALUE_KAT
-static word8 Si[256] = {
+static const word8 Si[256] = {
  82,   9, 106, 213,  48,  54, 165,  56, 191,  64, 163, 158, 129, 243, 215, 251, 
 124, 227,  57, 130, 155,  47, 255, 135,  52, 142,  67,  68, 196, 222, 233, 203, 
  84, 123, 148,  50, 166, 194,  35,  61, 238,  76, 149,  11,  66, 250, 195,  78, 
@@ -41,7 +41,7 @@
 };
 #endif /* INTERMEDIATE_VALUE_KAT */
 
-static word8 T1[256][4] = {
+static const word8 T1[256][4] = {
 {0xc6,0x63,0x63,0xa5}, {0xf8,0x7c,0x7c,0x84}, {0xee,0x77,0x77,0x99}, {0xf6,0x7b,0x7b,0x8d},
 {0xff,0xf2,0xf2,0x0d}, {0xd6,0x6b,0x6b,0xbd}, {0xde,0x6f,0x6f,0xb1}, {0x91,0xc5,0xc5,0x54},
 {0x60,0x30,0x30,0x50}, {0x02,0x01,0x01,0x03}, {0xce,0x67,0x67,0xa9}, {0x56,0x2b,0x2b,0x7d},
@@ -108,7 +108,7 @@
 {0x7b,0xb0,0xb0,0xcb}, {0xa8,0x54,0x54,0xfc}, {0x6d,0xbb,0xbb,0xd6}, {0x2c,0x16,0x16,0x3a}
 };
 
-static word8 T2[256][4] = {
+static const word8 T2[256][4] = {
 {0xa5,0xc6,0x63,0x63}, {0x84,0xf8,0x7c,0x7c}, {0x99,0xee,0x77,0x77}, {0x8d,0xf6,0x7b,0x7b},
 {0x0d,0xff,0xf2,0xf2}, {0xbd,0xd6,0x6b,0x6b}, {0xb1,0xde,0x6f,0x6f}, {0x54,0x91,0xc5,0xc5},
 {0x50,0x60,0x30,0x30}, {0x03,0x02,0x01,0x01}, {0xa9,0xce,0x67,0x67}, {0x7d,0x56,0x2b,0x2b},
@@ -175,7 +175,7 @@
 {0xcb,0x7b,0xb0,0xb0}, {0xfc,0xa8,0x54,0x54}, {0xd6,0x6d,0xbb,0xbb}, {0x3a,0x2c,0x16,0x16}
 };
 



Home | Main Index | Thread Index | Old Index