Source-Changes-HG archive

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

[src/trunk]: src Don't use const foo const as type, one const is enough.



details:   https://anonhg.NetBSD.org/src/rev/ca64850ba612
branches:  trunk
changeset: 781545:ca64850ba612
user:      joerg <joerg%NetBSD.org@localhost>
date:      Thu Sep 13 21:44:49 2012 +0000

description:
Don't use const foo const as type, one const is enough.

diffstat:

 external/bsd/atf/dist/atf-c/macros_test.c |   8 ++++----
 external/bsd/dhcpcd/dist/bpf-filter.h     |   4 ++--
 external/bsd/dhcpcd/dist/dhcp.c           |   2 +-
 lib/libutil/parsedate.y                   |  10 +++++-----
 sys/dev/sdmmc/sdhc.c                      |   6 +++---
 sys/kern/subr_vmem.c                      |   6 +++---
 usr.bin/rump_dhcpclient/bpf-filter.h      |   4 ++--
 usr.bin/rump_dhcpclient/dhcp.c            |   2 +-
 usr.sbin/quotarestore/quotarestore.c      |   6 +++---
 9 files changed, 24 insertions(+), 24 deletions(-)

diffs (220 lines):

diff -r 9c67449858f0 -r ca64850ba612 external/bsd/atf/dist/atf-c/macros_test.c
--- a/external/bsd/atf/dist/atf-c/macros_test.c Thu Sep 13 21:13:34 2012 +0000
+++ b/external/bsd/atf/dist/atf-c/macros_test.c Thu Sep 13 21:44:49 2012 +0000
@@ -442,8 +442,8 @@
 H_CHECK_STREQ_MSG(2_2, "2", "2", "2 does not match 2");
 #define CHECK_STREQ_VAR1 "5"
 #define CHECK_STREQ_VAR2 "9"
-const const char *check_streq_var1 = CHECK_STREQ_VAR1;
-const const char *check_streq_var2 = CHECK_STREQ_VAR2;
+const char check_streq_var1[] = CHECK_STREQ_VAR1;
+const char check_streq_var2[] = CHECK_STREQ_VAR2;
 H_CHECK_STREQ(vars, check_streq_var1, check_streq_var2);
 
 ATF_TC(check_streq);
@@ -630,8 +630,8 @@
 H_REQUIRE_STREQ_MSG(2_2, "2", "2", "2 does not match 2");
 #define REQUIRE_STREQ_VAR1 "5"
 #define REQUIRE_STREQ_VAR2 "9"
-const const char *require_streq_var1 = REQUIRE_STREQ_VAR1;
-const const char *require_streq_var2 = REQUIRE_STREQ_VAR2;
+const char require_streq_var1[] = REQUIRE_STREQ_VAR1;
+const char require_streq_var2[] = REQUIRE_STREQ_VAR2;
 H_REQUIRE_STREQ(vars, require_streq_var1, require_streq_var2);
 
 ATF_TC(require_streq);
diff -r 9c67449858f0 -r ca64850ba612 external/bsd/dhcpcd/dist/bpf-filter.h
--- a/external/bsd/dhcpcd/dist/bpf-filter.h     Thu Sep 13 21:13:34 2012 +0000
+++ b/external/bsd/dhcpcd/dist/bpf-filter.h     Thu Sep 13 21:44:49 2012 +0000
@@ -30,7 +30,7 @@
 #ifndef BPF_WHOLEPACKET
 # define BPF_WHOLEPACKET ~0U
 #endif
-static const struct bpf_insn const arp_bpf_filter [] = {
+static const struct bpf_insn arp_bpf_filter [] = {
 #ifndef BPF_SKIPTYPE
        /* Make sure this is an ARP packet... */
        BPF_STMT(BPF_LD + BPF_H + BPF_ABS, 12),
@@ -75,7 +75,7 @@
  *   http://www.isc.org/
  */
 
-static const struct bpf_insn const dhcp_bpf_filter [] = {
+static const struct bpf_insn dhcp_bpf_filter [] = {
 #ifndef BPF_SKIPTYPE
        /* Make sure this is an IP packet... */
        BPF_STMT(BPF_LD + BPF_H + BPF_ABS, 12),
diff -r 9c67449858f0 -r ca64850ba612 external/bsd/dhcpcd/dist/dhcp.c
--- a/external/bsd/dhcpcd/dist/dhcp.c   Thu Sep 13 21:13:34 2012 +0000
+++ b/external/bsd/dhcpcd/dist/dhcp.c   Thu Sep 13 21:44:49 2012 +0000
@@ -67,7 +67,7 @@
        const char *var;
 };
 
-static const struct dhcp_opt const dhcp_opts[] = {
+static const struct dhcp_opt dhcp_opts[] = {
        { 1,    IPV4 | REQUEST, "subnet_mask" },
                /* RFC 3442 states that the CSR has to come before all other
                 * routes. For completeness, we also specify static routes,
diff -r 9c67449858f0 -r ca64850ba612 lib/libutil/parsedate.y
--- a/lib/libutil/parsedate.y   Thu Sep 13 21:13:34 2012 +0000
+++ b/lib/libutil/parsedate.y   Thu Sep 13 21:44:49 2012 +0000
@@ -367,7 +367,7 @@
 %%
 
 /* Month and day table. */
-static const TABLE const MonthDayTable[] = {
+static const TABLE MonthDayTable[] = {
     { "january",       tMONTH,  1 },
     { "february",      tMONTH,  2 },
     { "march",         tMONTH,  3 },
@@ -396,7 +396,7 @@
 };
 
 /* Time units table. */
-static const TABLE const UnitsTable[] = {
+static const TABLE UnitsTable[] = {
     { "year",          tMONTH_UNIT,    12 },
     { "month",         tMONTH_UNIT,    1 },
     { "fortnight",     tMINUTE_UNIT,   14 * 24 * 60 },
@@ -411,7 +411,7 @@
 };
 
 /* Assorted relative-time words. */
-static const TABLE const OtherTable[] = {
+static const TABLE OtherTable[] = {
     { "tomorrow",      tMINUTE_UNIT,   1 * 24 * 60 },
     { "yesterday",     tMINUTE_UNIT,   -1 * 24 * 60 },
     { "today",         tMINUTE_UNIT,   0 },
@@ -449,7 +449,7 @@
 
 /* The timezone table. */
 /* Some of these are commented out because a time_t can't store a float. */
-static const TABLE const TimezoneTable[] = {
+static const TABLE TimezoneTable[] = {
     { "gmt",   tZONE,     HOUR( 0) },  /* Greenwich Mean */
     { "ut",    tZONE,     HOUR( 0) },  /* Universal (Coordinated) */
     { "utc",   tZONE,     HOUR( 0) },
@@ -533,7 +533,7 @@
 };
 
 /* Military timezone table. */
-static const TABLE const MilitaryTable[] = {
+static const TABLE MilitaryTable[] = {
     { "a",     tZONE,  HOUR(  1) },
     { "b",     tZONE,  HOUR(  2) },
     { "c",     tZONE,  HOUR(  3) },
diff -r 9c67449858f0 -r ca64850ba612 sys/dev/sdmmc/sdhc.c
--- a/sys/dev/sdmmc/sdhc.c      Thu Sep 13 21:13:34 2012 +0000
+++ b/sys/dev/sdmmc/sdhc.c      Thu Sep 13 21:44:49 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdhc.c,v 1.30 2012/08/31 01:44:20 matt Exp $   */
+/*     $NetBSD: sdhc.c,v 1.31 2012/09/13 21:44:50 joerg Exp $  */
 /*     $OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $        */
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.30 2012/08/31 01:44:20 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.31 2012/09/13 21:44:50 joerg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -220,7 +220,7 @@
 static int
 sdhc_cfprint(void *aux, const char *pnp)
 {
-       const struct sdmmcbus_attach_args const * saa = aux;
+       const struct sdmmcbus_attach_args * const saa = aux;
        const struct sdhc_host * const hp = saa->saa_sch;
        
        if (pnp) {
diff -r 9c67449858f0 -r ca64850ba612 sys/kern/subr_vmem.c
--- a/sys/kern/subr_vmem.c      Thu Sep 13 21:13:34 2012 +0000
+++ b/sys/kern/subr_vmem.c      Thu Sep 13 21:44:49 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_vmem.c,v 1.75 2012/09/01 12:28:58 para Exp $      */
+/*     $NetBSD: subr_vmem.c,v 1.76 2012/09/13 21:44:50 joerg Exp $     */
 
 /*-
  * Copyright (c)2006,2007,2008,2009 YAMAMOTO Takashi,
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_vmem.c,v 1.75 2012/09/01 12:28:58 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_vmem.c,v 1.76 2012/09/13 21:44:50 joerg Exp $");
 
 #if defined(_KERNEL)
 #include "opt_ddb.h"
@@ -895,7 +895,7 @@
  */
 
 static int
-vmem_fit(const bt_t const *bt, vmem_size_t size, vmem_size_t align,
+vmem_fit(const bt_t *bt, vmem_size_t size, vmem_size_t align,
     vmem_size_t phase, vmem_size_t nocross,
     vmem_addr_t minaddr, vmem_addr_t maxaddr, vmem_addr_t *addrp)
 {
diff -r 9c67449858f0 -r ca64850ba612 usr.bin/rump_dhcpclient/bpf-filter.h
--- a/usr.bin/rump_dhcpclient/bpf-filter.h      Thu Sep 13 21:13:34 2012 +0000
+++ b/usr.bin/rump_dhcpclient/bpf-filter.h      Thu Sep 13 21:44:49 2012 +0000
@@ -30,7 +30,7 @@
 #ifndef BPF_WHOLEPACKET
 # define BPF_WHOLEPACKET ~0U
 #endif
-static const struct bpf_insn const arp_bpf_filter [] = {
+static const struct bpf_insn arp_bpf_filter [] = {
 #ifndef BPF_SKIPTYPE
        /* Make sure this is an ARP packet... */
        BPF_STMT(BPF_LD + BPF_H + BPF_ABS, 12),
@@ -75,7 +75,7 @@
  *   http://www.isc.org/
  */
 
-static const struct bpf_insn const dhcp_bpf_filter [] = {
+static const struct bpf_insn dhcp_bpf_filter [] = {
 #ifndef BPF_SKIPTYPE
        /* Make sure this is an IP packet... */
        BPF_STMT(BPF_LD + BPF_H + BPF_ABS, 12),
diff -r 9c67449858f0 -r ca64850ba612 usr.bin/rump_dhcpclient/dhcp.c
--- a/usr.bin/rump_dhcpclient/dhcp.c    Thu Sep 13 21:13:34 2012 +0000
+++ b/usr.bin/rump_dhcpclient/dhcp.c    Thu Sep 13 21:44:49 2012 +0000
@@ -64,7 +64,7 @@
        const char *var;
 };
 
-static const struct dhcp_opt const dhcp_opts[] = {
+static const struct dhcp_opt dhcp_opts[] = {
        { 1,    IPV4 | REQUEST, "subnet_mask" },
                /* RFC 3442 states that the CSR has to come before all other
                 * routes. For completeness, we also specify static routes,
diff -r 9c67449858f0 -r ca64850ba612 usr.sbin/quotarestore/quotarestore.c
--- a/usr.sbin/quotarestore/quotarestore.c      Thu Sep 13 21:13:34 2012 +0000
+++ b/usr.sbin/quotarestore/quotarestore.c      Thu Sep 13 21:44:49 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: quotarestore.c,v 1.2 2012/02/14 17:33:38 joerg Exp $   */
+/*     $NetBSD: quotarestore.c,v 1.3 2012/09/13 21:44:50 joerg Exp $   */
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: quotarestore.c,v 1.2 2012/02/14 17:33:38 joerg Exp $");
+__RCSID("$NetBSD: quotarestore.c,v 1.3 2012/09/13 21:44:50 joerg Exp $");
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -42,7 +42,7 @@
 
 #include <quota.h>
 
-static const char const ws[] = " \t\r\n";
+static const char ws[] = " \t\r\n";
 
 static char **idtypenames;
 static unsigned numidtypes;



Home | Main Index | Thread Index | Old Index