Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Don't next structure and enum definitions.
details: https://anonhg.NetBSD.org/src/rev/f79ca26e1ecb
branches: trunk
changeset: 332038:f79ca26e1ecb
user: matt <matt%NetBSD.org@localhost>
date: Fri Sep 05 05:57:21 2014 +0000
description:
Don't next structure and enum definitions.
Don't use C++ keywords new, try, class, private, etc.
diffstat:
sys/kern/kern_descrip.c | 48 +++++++++++++++++++-------------------
sys/kern/kern_event.c | 8 +++---
sys/kern/kern_lwp.c | 30 ++++++++++++------------
sys/kern/kern_module.c | 38 +++++++++++++++---------------
sys/kern/kern_mutex.c | 26 ++++++++++----------
sys/kern/kern_rndsink.c | 20 +++++++++-------
sys/kern/kern_rwlock.c | 46 +++++++++++++++++++-------------------
sys/kern/kern_sleepq.c | 10 ++++----
sys/kern/subr_autoconf.c | 28 +++++++++++-----------
sys/kern/subr_devsw.c | 24 +++++++++---------
sys/kern/sys_descrip.c | 16 ++++++------
sys/kern/sys_pipe.c | 20 ++++++++--------
sys/kern/uipc_sem.c | 10 ++++----
sys/kern/uipc_socket2.c | 10 ++++----
sys/kern/uipc_usrreq.c | 14 +++++-----
sys/kern/vfs_bio.c | 10 ++++----
sys/kern/vfs_dirhash.c | 8 +++---
sys/kern/vfs_subr.c | 16 ++++++------
sys/kern/vfs_trans.c | 28 +++++++++++-----------
sys/kern/vfs_vnode.c | 7 +++--
sys/kern/vfs_wapbl.c | 39 ++++++++++++++++---------------
sys/kern/vfs_xattr.c | 58 ++++++++++++++++++++++++------------------------
22 files changed, 259 insertions(+), 255 deletions(-)
diffs (truncated from 1632 to 300 lines):
diff -r bd139c5779f6 -r f79ca26e1ecb sys/kern/kern_descrip.c
--- a/sys/kern/kern_descrip.c Fri Sep 05 05:54:48 2014 +0000
+++ b/sys/kern/kern_descrip.c Fri Sep 05 05:57:21 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_descrip.c,v 1.225 2014/07/25 08:10:40 dholland Exp $ */
+/* $NetBSD: kern_descrip.c,v 1.226 2014/09/05 05:57:21 matt Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_descrip.c,v 1.225 2014/07/25 08:10:40 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_descrip.c,v 1.226 2014/09/05 05:57:21 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -741,7 +741,7 @@
* dup2 operation.
*/
int
-fd_dup2(file_t *fp, unsigned new, int flags)
+fd_dup2(file_t *fp, unsigned newfd, int flags)
{
filedesc_t *fdp = curlwp->l_fd;
fdfile_t *ff;
@@ -753,7 +753,7 @@
* Ensure there are enough slots in the descriptor table,
* and allocate an fdfile_t up front in case we need it.
*/
- while (new >= fdp->fd_dt->dt_nfiles) {
+ while (newfd >= fdp->fd_dt->dt_nfiles) {
fd_tryexpand(curproc);
}
ff = pool_cache_get(fdfile_cache, PR_WAITOK);
@@ -764,10 +764,10 @@
* XXX Potential for deadlock here?
*/
mutex_enter(&fdp->fd_lock);
- while (fd_isused(fdp, new)) {
+ while (fd_isused(fdp, newfd)) {
mutex_exit(&fdp->fd_lock);
- if (fd_getfile(new) != NULL) {
- (void)fd_close(new);
+ if (fd_getfile(newfd) != NULL) {
+ (void)fd_close(newfd);
} else {
/*
* Crummy, but unlikely to happen.
@@ -779,18 +779,18 @@
mutex_enter(&fdp->fd_lock);
}
dt = fdp->fd_dt;
- if (dt->dt_ff[new] == NULL) {
- KASSERT(new >= NDFDFILE);
- dt->dt_ff[new] = ff;
+ if (dt->dt_ff[newfd] == NULL) {
+ KASSERT(newfd >= NDFDFILE);
+ dt->dt_ff[newfd] = ff;
ff = NULL;
}
- fd_used(fdp, new);
+ fd_used(fdp, newfd);
mutex_exit(&fdp->fd_lock);
- dt->dt_ff[new]->ff_exclose = (flags & O_CLOEXEC) != 0;
+ dt->dt_ff[newfd]->ff_exclose = (flags & O_CLOEXEC) != 0;
fp->f_flag |= flags & FNONBLOCK;
/* Slot is now allocated. Insert copy of the file. */
- fd_affix(curproc, fp, new);
+ fd_affix(curproc, fp, newfd);
if (ff != NULL) {
pool_cache_put(fdfile_cache, ff);
}
@@ -846,8 +846,8 @@
fd_alloc(proc_t *p, int want, int *result)
{
filedesc_t *fdp = p->p_fd;
- int i, lim, last, error;
- u_int off, new;
+ int i, lim, last, error, hi;
+ u_int off;
fdtab_t *dt;
KASSERT(p == curproc || p == &proc0);
@@ -866,21 +866,21 @@
if ((i = want) < fdp->fd_freefile)
i = fdp->fd_freefile;
off = i >> NDENTRYSHIFT;
- new = fd_next_zero(fdp, fdp->fd_himap, off,
+ hi = fd_next_zero(fdp, fdp->fd_himap, off,
(last + NDENTRIES - 1) >> NDENTRYSHIFT);
- if (new == -1)
+ if (hi == -1)
break;
- i = fd_next_zero(fdp, &fdp->fd_lomap[new],
- new > off ? 0 : i & NDENTRYMASK, NDENTRIES);
+ i = fd_next_zero(fdp, &fdp->fd_lomap[hi],
+ hi > off ? 0 : i & NDENTRYMASK, NDENTRIES);
if (i == -1) {
/*
* Free file descriptor in this block was
* below want, try again with higher want.
*/
- want = (new + 1) << NDENTRYSHIFT;
+ want = (hi + 1) << NDENTRYSHIFT;
continue;
}
- i += (new << NDENTRYSHIFT);
+ i += (hi << NDENTRYSHIFT);
if (i >= last) {
break;
}
@@ -1644,7 +1644,7 @@
* Duplicate the specified descriptor to a free descriptor.
*/
int
-fd_dupopen(int old, int *new, int mode, int error)
+fd_dupopen(int old, int *newp, int mode, int error)
{
filedesc_t *fdp;
fdfile_t *ff;
@@ -1682,12 +1682,12 @@
}
/* Copy it. */
- error = fd_dup(fp, 0, new, ff->ff_exclose);
+ error = fd_dup(fp, 0, newp, ff->ff_exclose);
break;
case EMOVEFD:
/* Copy it. */
- error = fd_dup(fp, 0, new, ff->ff_exclose);
+ error = fd_dup(fp, 0, newp, ff->ff_exclose);
if (error != 0) {
break;
}
diff -r bd139c5779f6 -r f79ca26e1ecb sys/kern/kern_event.c
--- a/sys/kern/kern_event.c Fri Sep 05 05:54:48 2014 +0000
+++ b/sys/kern/kern_event.c Fri Sep 05 05:57:21 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_event.c,v 1.80 2014/06/24 14:42:43 maxv Exp $ */
+/* $NetBSD: kern_event.c,v 1.81 2014/09/05 05:57:21 matt Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.80 2014/06/24 14:42:43 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.81 2014/09/05 05:57:21 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -775,7 +775,7 @@
* kevent(2) system call.
*/
int
-kevent_fetch_changes(void *private, const struct kevent *changelist,
+kevent_fetch_changes(void *ctx, const struct kevent *changelist,
struct kevent *changes, size_t index, int n)
{
@@ -783,7 +783,7 @@
}
int
-kevent_put_events(void *private, struct kevent *events,
+kevent_put_events(void *ctx, struct kevent *events,
struct kevent *eventlist, size_t index, int n)
{
diff -r bd139c5779f6 -r f79ca26e1ecb sys/kern/kern_lwp.c
--- a/sys/kern/kern_lwp.c Fri Sep 05 05:54:48 2014 +0000
+++ b/sys/kern/kern_lwp.c Fri Sep 05 05:57:21 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_lwp.c,v 1.177 2013/11/25 16:29:25 christos Exp $ */
+/* $NetBSD: kern_lwp.c,v 1.178 2014/09/05 05:57:21 matt Exp $ */
/*-
* Copyright (c) 2001, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -211,7 +211,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.177 2013/11/25 16:29:25 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.178 2014/09/05 05:57:21 matt Exp $");
#include "opt_ddb.h"
#include "opt_lockdebug.h"
@@ -981,11 +981,11 @@
* previous LWP, at splsched.
*/
void
-lwp_startup(struct lwp *prev, struct lwp *new)
+lwp_startup(struct lwp *prev, struct lwp *new_lwp)
{
- KASSERTMSG(new == curlwp, "l %p curlwp %p prevlwp %p", new, curlwp, prev);
+ KASSERTMSG(new_lwp == curlwp, "l %p curlwp %p prevlwp %p", new_lwp, curlwp, prev);
- SDT_PROBE(proc,,,lwp_start, new, 0,0,0,0);
+ SDT_PROBE(proc,,,lwp_start, new_lwp, 0,0,0,0);
KASSERT(kpreempt_disabled());
if (prev != NULL) {
@@ -998,18 +998,18 @@
membar_exit();
prev->l_ctxswtch = 0;
}
- KPREEMPT_DISABLE(new);
+ KPREEMPT_DISABLE(new_lwp);
spl0();
- if (__predict_true(new->l_proc->p_vmspace))
- pmap_activate(new);
+ if (__predict_true(new_lwp->l_proc->p_vmspace))
+ pmap_activate(new_lwp);
/* Note trip through cpu_switchto(). */
pserialize_switchpoint();
LOCKDEBUG_BARRIER(NULL, 0);
- KPREEMPT_ENABLE(new);
- if ((new->l_pflag & LP_MPSAFE) == 0) {
- KERNEL_LOCK(1, new);
+ KPREEMPT_ENABLE(new_lwp);
+ if ((new_lwp->l_pflag & LP_MPSAFE) == 0) {
+ KERNEL_LOCK(1, new_lwp);
}
}
@@ -1446,13 +1446,13 @@
* Lend a new mutex to an LWP. The old mutex must be held.
*/
void
-lwp_setlock(struct lwp *l, kmutex_t *new)
+lwp_setlock(struct lwp *l, kmutex_t *mtx)
{
KASSERT(mutex_owned(l->l_mutex));
membar_exit();
- l->l_mutex = new;
+ l->l_mutex = mtx;
}
/*
@@ -1460,7 +1460,7 @@
* must be held.
*/
void
-lwp_unlock_to(struct lwp *l, kmutex_t *new)
+lwp_unlock_to(struct lwp *l, kmutex_t *mtx)
{
kmutex_t *old;
@@ -1468,7 +1468,7 @@
old = l->l_mutex;
membar_exit();
- l->l_mutex = new;
+ l->l_mutex = mtx;
mutex_spin_exit(old);
}
diff -r bd139c5779f6 -r f79ca26e1ecb sys/kern/kern_module.c
--- a/sys/kern/kern_module.c Fri Sep 05 05:54:48 2014 +0000
+++ b/sys/kern/kern_module.c Fri Sep 05 05:57:21 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_module.c,v 1.99 2014/08/24 11:36:11 nonaka Exp $ */
+/* $NetBSD: kern_module.c,v 1.100 2014/09/05 05:57:21 matt Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.99 2014/08/24 11:36:11 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.100 2014/09/05 05:57:21 matt Exp $");
#define _MODULE_INTERNAL
@@ -91,7 +91,7 @@
static module_t *module_newmodule(modsrc_t);
static void module_require_force(module_t *);
static int module_do_load(const char *, bool, int, prop_dictionary_t,
- module_t **, modclass_t class, bool);
+ module_t **, modclass_t modclass, bool);
static int module_do_unload(const char *, bool);
static int module_do_builtin(const char *, module_t **, prop_dictionary_t);
static int module_fetch_info(module_t *);
@@ -105,14 +105,14 @@
static void sysctl_module_setup(void);
static int sysctl_module_autotime(SYSCTLFN_PROTO);
-#define MODULE_CLASS_MATCH(mi, class) \
- ((class) == MODULE_CLASS_ANY || (class) == (mi)->mi_class)
+#define MODULE_CLASS_MATCH(mi, modclass) \
Home |
Main Index |
Thread Index |
Old Index