Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Get rid of all sysc_init_field uses - initialize fields dire...
details: https://anonhg.NetBSD.org/src/rev/bf1999e2fb2f
branches: trunk
changeset: 329251:bf1999e2fb2f
user: martin <martin%NetBSD.org@localhost>
date: Fri May 16 12:22:32 2014 +0000
description:
Get rid of all sysc_init_field uses - initialize fields directly in C99
notation.
diffstat:
lib/libc/gen/sysctl.c | 27 ++++++++-------------------
lib/libc/gen/sysctlgetmibinfo.c | 6 +++---
sbin/sysctl/sysctl.c | 6 +++---
sys/compat/linux/common/linux_sysctl.c | 6 +++---
sys/compat/linux32/common/linux32_sysctl.c | 6 +++---
sys/compat/netbsd32/netbsd32_sysctl.c | 6 +++---
sys/kern/kern_sysctl.c | 12 +++---------
7 files changed, 26 insertions(+), 43 deletions(-)
diffs (227 lines):
diff -r 33cc19aae06b -r bf1999e2fb2f lib/libc/gen/sysctl.c
--- a/lib/libc/gen/sysctl.c Fri May 16 10:05:38 2014 +0000
+++ b/lib/libc/gen/sysctl.c Fri May 16 12:22:32 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sysctl.c,v 1.33 2014/05/16 09:41:42 martin Exp $ */
+/* $NetBSD: sysctl.c,v 1.34 2014/05/16 12:22:32 martin Exp $ */
/*-
* Copyright (c) 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)sysctl.c 8.2 (Berkeley) 1/4/94";
#else
-__RCSID("$NetBSD: sysctl.c,v 1.33 2014/05/16 09:41:42 martin Exp $");
+__RCSID("$NetBSD: sysctl.c,v 1.34 2014/05/16 12:22:32 martin Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -109,11 +109,11 @@
#define _INT(s, n, v, d) { \
.sysctl_flags = CTLFLAG_IMMEDIATE|CTLFLAG_PERMANENT| \
CTLTYPE_INT|SYSCTL_VERSION, \
- sysc_init_field(_sysctl_size, sizeof(int)), \
+ .sysctl_size = sizeof(int), \
.sysctl_name = (s), \
.sysctl_num = (n), \
- .sysctl_un = { .scu_idata = (v), }, \
- sysc_init_field(_sysctl_desc, (d)), \
+ .sysctl_un.scu_idata = (v), \
+ .sysctl_desc = (d), \
}
/*
@@ -129,22 +129,11 @@
{
.sysctl_flags = SYSCTL_VERSION|CTLFLAG_PERMANENT|
CTLTYPE_STRING,
- sysc_init_field(_sysctl_size, sizeof(_PATH_STDPATH)),
+ .sysctl_size = sizeof(_PATH_STDPATH),
.sysctl_name = "cs_path",
.sysctl_num = USER_CS_PATH,
- /*
- * XXX these nasty initializers (and the one in
- * the _INT() macro) can go away once all ports
- * are using gcc3, and become
- *
- * .sysctl_data = _PATH_STDPATH,
- * .sysctl_desc = NULL,
- */
- .sysctl_un = { .scu_data = {
- sysc_init_field(_sud_data,
- __UNCONST(_PATH_STDPATH)),
- }, },
- sysc_init_field(_sysctl_desc,
+ .sysctl_data = __UNCONST(_PATH_STDPATH),
+ .sysctl_desc = __UNCONST(
"A value for the PATH environment variable "
"that finds all the standard utilities"),
},
diff -r 33cc19aae06b -r bf1999e2fb2f lib/libc/gen/sysctlgetmibinfo.c
--- a/lib/libc/gen/sysctlgetmibinfo.c Fri May 16 10:05:38 2014 +0000
+++ b/lib/libc/gen/sysctlgetmibinfo.c Fri May 16 12:22:32 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sysctlgetmibinfo.c,v 1.10 2012/03/13 21:13:37 christos Exp $ */
+/* $NetBSD: sysctlgetmibinfo.c,v 1.11 2014/05/16 12:22:32 martin Exp $ */
/*-
* Copyright (c) 2003,2004 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: sysctlgetmibinfo.c,v 1.10 2012/03/13 21:13:37 christos Exp $");
+__RCSID("$NetBSD: sysctlgetmibinfo.c,v 1.11 2014/05/16 12:22:32 martin Exp $");
#endif /* LIBC_SCCS and not lint */
#ifndef RUMP_ACTION
@@ -71,7 +71,7 @@
0
#else /* !lint */
.sysctl_flags = SYSCTL_VERSION|CTLFLAG_ROOT|CTLTYPE_NODE,
- sysc_init_field(_sysctl_size, sizeof(struct sysctlnode)),
+ .sysctl_size = sizeof(struct sysctlnode),
.sysctl_name = "(root)",
#endif /* !lint */
};
diff -r 33cc19aae06b -r bf1999e2fb2f sbin/sysctl/sysctl.c
--- a/sbin/sysctl/sysctl.c Fri May 16 10:05:38 2014 +0000
+++ b/sbin/sysctl/sysctl.c Fri May 16 12:22:32 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sysctl.c,v 1.152 2014/05/16 08:59:24 martin Exp $ */
+/* $NetBSD: sysctl.c,v 1.153 2014/05/16 12:22:32 martin Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
#if 0
static char sccsid[] = "@(#)sysctl.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: sysctl.c,v 1.152 2014/05/16 08:59:24 martin Exp $");
+__RCSID("$NetBSD: sysctl.c,v 1.153 2014/05/16 12:22:32 martin Exp $");
#endif
#endif /* not lint */
@@ -242,7 +242,7 @@
struct sysctlnode my_root = {
.sysctl_flags = SYSCTL_VERSION|CTLFLAG_ROOT|CTLTYPE_NODE,
- sysc_init_field(_sysctl_size, sizeof(struct sysctlnode)),
+ .sysctl_size = sizeof(struct sysctlnode),
.sysctl_num = 0,
.sysctl_name = "(prog_root)",
};
diff -r 33cc19aae06b -r bf1999e2fb2f sys/compat/linux/common/linux_sysctl.c
--- a/sys/compat/linux/common/linux_sysctl.c Fri May 16 10:05:38 2014 +0000
+++ b/sys/compat/linux/common/linux_sysctl.c Fri May 16 12:22:32 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_sysctl.c,v 1.42 2014/02/25 18:30:09 pooka Exp $ */
+/* $NetBSD: linux_sysctl.c,v 1.43 2014/05/16 12:22:32 martin Exp $ */
/*-
* Copyright (c) 2003, 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_sysctl.c,v 1.42 2014/02/25 18:30:09 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sysctl.c,v 1.43 2014/05/16 12:22:32 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -65,7 +65,7 @@
CTLFLAG_ROOT|CTLTYPE_NODE|CTLFLAG_READWRITE,
.sysctl_num = 0,
.sysctl_name = "(linux_root)",
- sysc_init_field(_sysctl_size, sizeof(struct sysctlnode)),
+ .sysctl_size = sizeof(struct sysctlnode),
};
static struct sysctllog *linux_clog1;
diff -r 33cc19aae06b -r bf1999e2fb2f sys/compat/linux32/common/linux32_sysctl.c
--- a/sys/compat/linux32/common/linux32_sysctl.c Fri May 16 10:05:38 2014 +0000
+++ b/sys/compat/linux32/common/linux32_sysctl.c Fri May 16 12:22:32 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux32_sysctl.c,v 1.15 2014/02/25 18:30:09 pooka Exp $ */
+/* $NetBSD: linux32_sysctl.c,v 1.16 2014/05/16 12:22:32 martin Exp $ */
/*-
* Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -31,7 +31,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux32_sysctl.c,v 1.15 2014/02/25 18:30:09 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_sysctl.c,v 1.16 2014/05/16 12:22:32 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -65,7 +65,7 @@
CTLFLAG_ROOT|CTLTYPE_NODE|CTLFLAG_READWRITE,
.sysctl_num = 0,
.sysctl_name = "(linux32_root)",
- sysc_init_field(_sysctl_size, sizeof(struct sysctlnode)),
+ .sysctl_size = sizeof(struct sysctlnode),
};
static struct sysctllog *linux32_clog1;
diff -r 33cc19aae06b -r bf1999e2fb2f sys/compat/netbsd32/netbsd32_sysctl.c
--- a/sys/compat/netbsd32/netbsd32_sysctl.c Fri May 16 10:05:38 2014 +0000
+++ b/sys/compat/netbsd32/netbsd32_sysctl.c Fri May 16 12:22:32 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_sysctl.c,v 1.33 2012/01/20 14:08:07 joerg Exp $ */
+/* $NetBSD: netbsd32_sysctl.c,v 1.34 2014/05/16 12:22:32 martin Exp $ */
/*
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysctl.c,v 1.33 2012/01/20 14:08:07 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysctl.c,v 1.34 2014/05/16 12:22:32 martin Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ddb.h"
@@ -67,7 +67,7 @@
.sysctl_flags = SYSCTL_VERSION|CTLFLAG_ROOT|CTLTYPE_NODE,
.sysctl_num = 0,
.sysctl_name = "(netbsd32_root)",
- sysc_init_field(_sysctl_size, sizeof(struct sysctlnode)),
+ .sysctl_size = sizeof(struct sysctlnode),
};
static struct sysctllog *netbsd32_clog;
diff -r 33cc19aae06b -r bf1999e2fb2f sys/kern/kern_sysctl.c
--- a/sys/kern/kern_sysctl.c Fri May 16 10:05:38 2014 +0000
+++ b/sys/kern/kern_sysctl.c Fri May 16 12:22:32 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_sysctl.c,v 1.249 2014/03/27 21:09:33 christos Exp $ */
+/* $NetBSD: kern_sysctl.c,v 1.250 2014/05/16 12:22:32 martin Exp $ */
/*-
* Copyright (c) 2003, 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.249 2014/03/27 21:09:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.250 2014/05/16 12:22:32 martin Exp $");
#include "opt_defcorename.h"
#include "ksyms.h"
@@ -123,13 +123,7 @@
CTLFLAG_ROOT|CTLFLAG_READWRITE|
CTLTYPE_NODE,
.sysctl_num = 0,
- /*
- * XXX once all ports are on gcc3, we can get rid of this
- * ugliness and simply make it into
- *
- * .sysctl_size = sizeof(struct sysctlnode),
- */
- sysc_init_field(_sysctl_size, sizeof(struct sysctlnode)),
+ .sysctl_size = sizeof(struct sysctlnode),
.sysctl_name = "(root)",
};
Home |
Main Index |
Thread Index |
Old Index