From 8f47c760be0f444e75fc5461891e22edf56fc6c5 Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 29 Aug 2022 06:08:03 +0000 Subject: [PATCH] static const, not const static c99 6.11.5: "The placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature." ok miod@ tb@ --- lib/libcrypto/ec/ecp_nistz256.c | 6 +++--- sys/arch/alpha/alpha/trap.c | 4 ++-- sys/arch/i386/pci/ali1543.c | 6 +++--- sys/crypto/sha2.c | 12 ++++++------ sys/dev/ic/adwlib.c | 8 ++++---- sys/dev/isa/gus.c | 4 ++-- sys/dev/pci/if_mtd_pci.c | 4 ++-- sys/dev/pci/if_tht.c | 6 +++--- sys/dev/pci/pciide_natsemi_reg.h | 14 +++++++------- sys/dev/pci/pciide_opti_reg.h | 10 +++++----- sys/dev/pci/yds.c | 6 +++--- sys/dev/sbus/cs4231.c | 4 ++-- sys/miscfs/fuse/fuse_device.c | 4 ++-- 13 files changed, 44 insertions(+), 44 deletions(-) diff --git a/lib/libcrypto/ec/ecp_nistz256.c b/lib/libcrypto/ec/ecp_nistz256.c index 05a16b8c074..dec7d312562 100644 --- a/lib/libcrypto/ec/ecp_nistz256.c +++ b/lib/libcrypto/ec/ecp_nistz256.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecp_nistz256.c,v 1.10 2021/09/08 17:29:21 tb Exp $ */ +/* $OpenBSD: ecp_nistz256.c,v 1.11 2022/08/29 06:08:03 jsg Exp $ */ /* Copyright (c) 2014, Intel Corporation. * * Permission to use, copy, modify, and/or distribute this software for any @@ -573,12 +573,12 @@ ecp_nistz256_windowed_mul(const EC_GROUP *group, P256_POINT *r, } /* Coordinates of G, for which we have precomputed tables */ -const static BN_ULONG def_xG[P256_LIMBS] = { +static const BN_ULONG def_xG[P256_LIMBS] = { TOBN(0x79e730d4, 0x18a9143c), TOBN(0x75ba95fc, 0x5fedb601), TOBN(0x79fb732b, 0x77622510), TOBN(0x18905f76, 0xa53755c6) }; -const static BN_ULONG def_yG[P256_LIMBS] = { +static const BN_ULONG def_yG[P256_LIMBS] = { TOBN(0xddf25357, 0xce95560a), TOBN(0x8b4ab8e4, 0xba19e45c), TOBN(0xd2e88688, 0xdd21f325), TOBN(0x8571ff18, 0x25885d85) }; diff --git a/sys/arch/alpha/alpha/trap.c b/sys/arch/alpha/alpha/trap.c index c80e0141d91..3541c81d488 100644 --- a/sys/arch/alpha/alpha/trap.c +++ b/sys/arch/alpha/alpha/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.102 2022/08/12 17:19:52 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.103 2022/08/29 06:08:03 jsg Exp $ */ /* $NetBSD: trap.c,v 1.52 2000/05/24 16:48:33 thorpej Exp $ */ /*- @@ -693,7 +693,7 @@ ast(framep) userret(p); } -const static int reg_to_framereg[32] = { +static const int reg_to_framereg[32] = { FRAME_V0, FRAME_T0, FRAME_T1, FRAME_T2, FRAME_T3, FRAME_T4, FRAME_T5, FRAME_T6, FRAME_T7, FRAME_S0, FRAME_S1, FRAME_S2, diff --git a/sys/arch/i386/pci/ali1543.c b/sys/arch/i386/pci/ali1543.c index 298e07eed9d..df2216756ea 100644 --- a/sys/arch/i386/pci/ali1543.c +++ b/sys/arch/i386/pci/ali1543.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ali1543.c,v 1.4 2014/09/14 14:17:23 jsg Exp $ */ +/* $OpenBSD: ali1543.c,v 1.5 2022/08/29 06:08:03 jsg Exp $ */ /* $NetBSD: ali1543.c,v 1.2 2001/09/13 14:00:52 tshiozak Exp $ */ /* @@ -122,10 +122,10 @@ const struct pciintr_icu ali1543_icu = { * Linux source code (linux/arch/i386/kernel/pci-irq.c) says that the * irq order of ALi PCI ICU is shuffled. */ -const static int ali1543_intr_shuffle_get[16] = { +static const int ali1543_intr_shuffle_get[16] = { 0, 9, 3, 10, 4, 5, 7, 6, 1, 11, 0, 12, 0, 14, 0, 15 }; -const static int ali1543_intr_shuffle_set[16] = { +static const int ali1543_intr_shuffle_set[16] = { 0, 8, 0, 2, 4, 5, 7, 6, 0, 1, 3, 9, 11, 0, 13, 15 }; diff --git a/sys/crypto/sha2.c b/sys/crypto/sha2.c index 769b73262ca..f789ef3f55b 100644 --- a/sys/crypto/sha2.c +++ b/sys/crypto/sha2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sha2.c,v 1.19 2021/03/12 10:22:46 jsg Exp $ */ +/* $OpenBSD: sha2.c,v 1.20 2022/08/29 06:08:03 jsg Exp $ */ /* * FILE: sha2.c @@ -152,7 +152,7 @@ void SHA512Transform(u_int64_t *, const u_int8_t *); /*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/ /* Hash constant words K for SHA-256: */ -const static u_int32_t K256[64] = { +static const u_int32_t K256[64] = { 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, @@ -172,7 +172,7 @@ const static u_int32_t K256[64] = { }; /* Initial hash value H for SHA-256: */ -const static u_int32_t sha256_initial_hash_value[8] = { +static const u_int32_t sha256_initial_hash_value[8] = { 0x6a09e667UL, 0xbb67ae85UL, 0x3c6ef372UL, @@ -184,7 +184,7 @@ const static u_int32_t sha256_initial_hash_value[8] = { }; /* Hash constant words K for SHA-384 and SHA-512: */ -const static u_int64_t K512[80] = { +static const u_int64_t K512[80] = { 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, @@ -228,7 +228,7 @@ const static u_int64_t K512[80] = { }; /* Initial hash value H for SHA-384 */ -const static u_int64_t sha384_initial_hash_value[8] = { +static const u_int64_t sha384_initial_hash_value[8] = { 0xcbbb9d5dc1059ed8ULL, 0x629a292a367cd507ULL, 0x9159015a3070dd17ULL, @@ -240,7 +240,7 @@ const static u_int64_t sha384_initial_hash_value[8] = { }; /* Initial hash value H for SHA-512 */ -const static u_int64_t sha512_initial_hash_value[8] = { +static const u_int64_t sha512_initial_hash_value[8] = { 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, 0x3c6ef372fe94f82bULL, diff --git a/sys/dev/ic/adwlib.c b/sys/dev/ic/adwlib.c index 2e346d52dd0..3fe5eb3b075 100644 --- a/sys/dev/ic/adwlib.c +++ b/sys/dev/ic/adwlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adwlib.c,v 1.28 2022/08/01 20:35:25 miod Exp $ */ +/* $OpenBSD: adwlib.c,v 1.29 2022/08/29 06:08:03 jsg Exp $ */ /* $NetBSD: adwlib.c,v 1.20 2000/07/04 04:17:03 itojun Exp $ */ /* @@ -95,7 +95,7 @@ void AdwDelayMicroSecond(u_int32_t); * Additional structure information can be found in adwlib.h where * the structure is defined. */ -const static ADW_EEPROM adw_3550_Default_EEPROM = { +static const ADW_EEPROM adw_3550_Default_EEPROM = { ADW_EEPROM_BIOS_ENABLE, /* 00 cfg_lsw */ 0x0000, /* 01 cfg_msw */ 0xFFFF, /* 02 disc_enable */ @@ -132,7 +132,7 @@ const static ADW_EEPROM adw_3550_Default_EEPROM = { 0 /* 35 saved_adw_err_addr */ }; -const static ADW_EEPROM adw_38C0800_Default_EEPROM = { +static const ADW_EEPROM adw_38C0800_Default_EEPROM = { ADW_EEPROM_BIOS_ENABLE, /* 00 cfg_lsw */ 0x0000, /* 01 cfg_msw */ 0xFFFF, /* 02 disc_enable */ @@ -178,7 +178,7 @@ const static ADW_EEPROM adw_38C0800_Default_EEPROM = { { 0,0,0,0 } /* 60-63 reserved2[4] */ }; -const static ADW_EEPROM adw_38C1600_Default_EEPROM = { +static const ADW_EEPROM adw_38C1600_Default_EEPROM = { ADW_EEPROM_BIOS_ENABLE, /* 00 cfg_lsw */ 0x0000, /* 01 cfg_msw */ 0xFFFF, /* 02 disc_enable */ diff --git a/sys/dev/isa/gus.c b/sys/dev/isa/gus.c index 77c381a1fdd..fbe64587fd2 100644 --- a/sys/dev/isa/gus.c +++ b/sys/dev/isa/gus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gus.c,v 1.50 2022/03/21 19:22:40 miod Exp $ */ +/* $OpenBSD: gus.c,v 1.51 2022/08/29 06:08:04 jsg Exp $ */ /* $NetBSD: gus.c,v 1.51 1998/01/25 23:48:06 mycroft Exp $ */ /*- @@ -291,7 +291,7 @@ const struct audio_hw_if gus_hw_if = { NULL }; -const static struct audio_hw_if gusmax_hw_if = { +static const struct audio_hw_if gusmax_hw_if = { gusmaxopen, gusmax_close, gusmax_set_params, diff --git a/sys/dev/pci/if_mtd_pci.c b/sys/dev/pci/if_mtd_pci.c index fcda4c40e71..2a2242e52df 100644 --- a/sys/dev/pci/if_mtd_pci.c +++ b/sys/dev/pci/if_mtd_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mtd_pci.c,v 1.12 2022/03/11 18:00:48 mpi Exp $ */ +/* $OpenBSD: if_mtd_pci.c,v 1.13 2022/08/29 06:08:04 jsg Exp $ */ /* * Copyright (c) 2003 Oleg Safiullin @@ -58,7 +58,7 @@ const struct cfattach mtd_pci_ca = { sizeof(struct mtd_softc), mtd_pci_match, mtd_pci_attach }; -const static struct pci_matchid mtd_pci_devices[] = { +static const struct pci_matchid mtd_pci_devices[] = { { PCI_VENDOR_MYSON, PCI_PRODUCT_MYSON_MTD800 }, { PCI_VENDOR_MYSON, PCI_PRODUCT_MYSON_MTD803 }, { PCI_VENDOR_MYSON, PCI_PRODUCT_MYSON_MTD891 }, diff --git a/sys/dev/pci/if_tht.c b/sys/dev/pci/if_tht.c index e157acc9bc3..e07be120ec3 100644 --- a/sys/dev/pci/if_tht.c +++ b/sys/dev/pci/if_tht.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tht.c,v 1.145 2022/03/11 18:00:48 mpi Exp $ */ +/* $OpenBSD: if_tht.c,v 1.146 2022/08/29 06:08:04 jsg Exp $ */ /* * Copyright (c) 2007 David Gwynne @@ -1549,7 +1549,7 @@ tht_fifo_write_dmap(struct tht_softc *sc, struct tht_fifo *tf, void tht_fifo_write_pad(struct tht_softc *sc, struct tht_fifo *tf, int bc) { - const static u_int32_t pad = 0x0; + static const u_int32_t pad = 0x0; /* this assumes you'll only ever be writing multiples of 4 bytes */ if (bc % 8) @@ -1570,7 +1570,7 @@ tht_fifo_post(struct tht_softc *sc, struct tht_fifo *tf) tf->tf_wptr, tf->tf_rptr); } -const static bus_size_t tht_mac_regs[3] = { +static const bus_size_t tht_mac_regs[3] = { THT_REG_RX_UNC_MAC2, THT_REG_RX_UNC_MAC1, THT_REG_RX_UNC_MAC0 }; diff --git a/sys/dev/pci/pciide_natsemi_reg.h b/sys/dev/pci/pciide_natsemi_reg.h index 473aa4ab842..9c381a85721 100644 --- a/sys/dev/pci/pciide_natsemi_reg.h +++ b/sys/dev/pci/pciide_natsemi_reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pciide_natsemi_reg.h,v 1.8 2022/01/09 05:42:58 jsg Exp $ */ +/* $OpenBSD: pciide_natsemi_reg.h,v 1.9 2022/08/29 06:08:04 jsg Exp $ */ /* * Copyright (c) 2001 Jason L. Wright (jason@thought.net) @@ -113,23 +113,23 @@ static u_int8_t natsemi_dma_recover[] = { 6, 8, 9 }; #define SCx200_PIOFORMAT_SHIFT 31 /* PIO mode timings */ -const static u_int32_t scx200_pio33[2][5] = { +static const u_int32_t scx200_pio33[2][5] = { /* Format 0 */ { 0x00009172, 0x00012171, 0x00020080, 0x00032010, 0x00040010 }, /* Format 1 */ { 0x9172d132, 0x21717121, 0x00803020, 0x20102010, 0x00100010 }}; -const static u_int32_t scx200_pio66[2][5] = { +static const u_int32_t scx200_pio66[2][5] = { /* Format 0 */ { 0x0000f8e4, 0x000153f3, 0x000213f1, 0x00034231, 0x00041131 }, /* Format 1 */ { 0xf8e4f8e4, 0x53f3f353, 0x13f18141, 0x42314231, 0x11311131 }}; /* DMA mode timings */ -const static u_int32_t scx200_dma33[] = { 0x00077771, 0x00012121, 0x00002020 }; -const static u_int32_t scx200_dma66[] = { 0x000ffff3, 0x00035352, 0x00015151 }; +static const u_int32_t scx200_dma33[] = { 0x00077771, 0x00012121, 0x00002020 }; +static const u_int32_t scx200_dma66[] = { 0x000ffff3, 0x00035352, 0x00015151 }; /* UDMA mode timings */ -const static u_int32_t scx200_udma33[] = { 0x00921250, 0x00911140, 0x00911030 }; -const static u_int32_t scx200_udma66[] = { 0x009436a1, 0x00933481, 0x00923261 }; +static const u_int32_t scx200_udma33[] = { 0x00921250, 0x00911140, 0x00911030 }; +static const u_int32_t scx200_udma66[] = { 0x009436a1, 0x00933481, 0x00923261 }; #endif /* !_DEV_PCI_PCIIDE_NATSEMI_REG_H_ */ diff --git a/sys/dev/pci/pciide_opti_reg.h b/sys/dev/pci/pciide_opti_reg.h index 83f8950f093..1bf176ddde9 100644 --- a/sys/dev/pci/pciide_opti_reg.h +++ b/sys/dev/pci/pciide_opti_reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pciide_opti_reg.h,v 1.4 2008/06/26 05:42:17 ray Exp $ */ +/* $OpenBSD: pciide_opti_reg.h,v 1.5 2022/08/29 06:08:04 jsg Exp $ */ /* $NetBSD: pciide_opti_reg.h,v 1.2 2000/06/07 20:42:53 scw Exp $ */ /*- @@ -104,22 +104,22 @@ * supported by the OPTi chip. The first index of the two-dimensional * arrays is used for a 33MHz PCIbus, the second for a 25MHz PCIbus. */ -const static u_int8_t opti_tim_cp[2][8] = { /* Command Pulse */ +static const u_int8_t opti_tim_cp[2][8] = { /* Command Pulse */ {5, 4, 3, 2, 2, 7, 2, 2}, {4, 3, 2, 2, 1, 5, 2, 1} }; -const static u_int8_t opti_tim_rt[2][8] = { /* Recovery Time */ +static const u_int8_t opti_tim_rt[2][8] = { /* Recovery Time */ {9, 4, 0, 0, 0, 6, 0, 0}, {6, 2, 0, 0, 0, 4, 0, 0} }; -const static u_int8_t opti_tim_as[2][8] = { /* Address Setup */ +static const u_int8_t opti_tim_as[2][8] = { /* Address Setup */ {2, 1, 1, 1, 0, 0, 0, 0}, {1, 1, 0, 0, 0, 0, 0, 0} }; -const static u_int8_t opti_tim_em[8] = { /* Enhanced Mode */ +static const u_int8_t opti_tim_em[8] = { /* Enhanced Mode */ 0, 0, 0, 1, 2, 0, 1 ,2 }; diff --git a/sys/dev/pci/yds.c b/sys/dev/pci/yds.c index d4910b587c7..5657423174e 100644 --- a/sys/dev/pci/yds.c +++ b/sys/dev/pci/yds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yds.c,v 1.59 2022/03/21 19:22:41 miod Exp $ */ +/* $OpenBSD: yds.c,v 1.60 2022/08/29 06:08:04 jsg Exp $ */ /* $NetBSD: yds.c,v 1.5 2001/05/21 23:55:04 minoura Exp $ */ /* @@ -199,7 +199,7 @@ static void yds_dump_play_slot(struct yds_softc *, int); #define YDS_DUMP_PLAY_SLOT(n,sc,bank) #endif /* AUDIO_DEBUG */ -const static struct audio_hw_if yds_hw_if = { +static const struct audio_hw_if yds_hw_if = { yds_open, yds_close, yds_set_params, @@ -224,7 +224,7 @@ const static struct audio_hw_if yds_hw_if = { yds_trigger_input }; -const static struct { +static const struct { u_int id; u_int flags; #define YDS_CAP_MCODE_1 0x0001 diff --git a/sys/dev/sbus/cs4231.c b/sys/dev/sbus/cs4231.c index 2672609ae1a..bdf261390f5 100644 --- a/sys/dev/sbus/cs4231.c +++ b/sys/dev/sbus/cs4231.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cs4231.c,v 1.41 2022/03/21 19:22:41 miod Exp $ */ +/* $OpenBSD: cs4231.c,v 1.42 2022/08/29 06:08:04 jsg Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -287,7 +287,7 @@ cs4231_set_speed(struct cs4231_softc *sc, u_long *argp) } speed_struct; u_long arg = *argp; - const static speed_struct speed_table[] = { + static const speed_struct speed_table[] = { {5510, (0 << 1) | CLOCK_XTAL2}, {5510, (0 << 1) | CLOCK_XTAL2}, {6620, (7 << 1) | CLOCK_XTAL2}, diff --git a/sys/miscfs/fuse/fuse_device.c b/sys/miscfs/fuse/fuse_device.c index 361b6d2a2ab..eaa6ad0c194 100644 --- a/sys/miscfs/fuse/fuse_device.c +++ b/sys/miscfs/fuse/fuse_device.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fuse_device.c,v 1.37 2022/07/02 08:50:42 visa Exp $ */ +/* $OpenBSD: fuse_device.c,v 1.38 2022/08/29 06:08:04 jsg Exp $ */ /* * Copyright (c) 2012-2013 Sylvestre Gallon * @@ -67,7 +67,7 @@ int fusekqfilter(dev_t dev, struct knote *kn); int filt_fuse_read(struct knote *, long); void filt_fuse_rdetach(struct knote *); -const static struct filterops fuse_rd_filtops = { +static const struct filterops fuse_rd_filtops = { .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_fuse_rdetach, -- 2.20.1