summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2001-12-10 05:51:45 +0000
committerobrien <obrien@FreeBSD.org>2001-12-10 05:51:45 +0000
commit330a1032c131a6a964d3f1a8a0c5add73d765307 (patch)
tree5b308df4fd67d0bb0e6fe811cf399562e8f2580d
parentcca4f7b2d999a916e664b1331f20c754d454eb95 (diff)
downloadFreeBSD-src-330a1032c131a6a964d3f1a8a0c5add73d765307.zip
FreeBSD-src-330a1032c131a6a964d3f1a8a0c5add73d765307.tar.gz
Update to C99, s/__FUNCTION__/__func__/.
-rw-r--r--sys/kern/kern_condvar.c22
-rw-r--r--sys/kern/kern_sx.c6
-rw-r--r--sys/kern/subr_bus.c2
-rw-r--r--sys/kern/subr_mchain.c4
-rw-r--r--sys/kern/subr_sbuf.c12
-rw-r--r--sys/kern/uipc_mbuf.c4
6 files changed, 25 insertions, 25 deletions
diff --git a/sys/kern/kern_condvar.c b/sys/kern/kern_condvar.c
index 4e2957d..14ed213 100644
--- a/sys/kern/kern_condvar.c
+++ b/sys/kern/kern_condvar.c
@@ -47,10 +47,10 @@
* Common sanity checks for cv_wait* functions.
*/
#define CV_ASSERT(cvp, mp, td) do { \
- KASSERT((td) != NULL, ("%s: curthread NULL", __FUNCTION__)); \
- KASSERT((td)->td_proc->p_stat == SRUN, ("%s: not SRUN", __FUNCTION__)); \
- KASSERT((cvp) != NULL, ("%s: cvp NULL", __FUNCTION__)); \
- KASSERT((mp) != NULL, ("%s: mp NULL", __FUNCTION__)); \
+ KASSERT((td) != NULL, ("%s: curthread NULL", __func__)); \
+ KASSERT((td)->td_proc->p_stat == SRUN, ("%s: not SRUN", __func__)); \
+ KASSERT((cvp) != NULL, ("%s: cvp NULL", __func__)); \
+ KASSERT((mp) != NULL, ("%s: mp NULL", __func__)); \
mtx_assert((mp), MA_OWNED | MA_NOTRECURSED); \
} while (0)
@@ -65,13 +65,13 @@
* same mutex. \
*/ \
KASSERT((cvp)->cv_mtx == (mp), \
- ("%s: Multiple mutexes", __FUNCTION__)); \
+ ("%s: Multiple mutexes", __func__)); \
} \
} while (0)
#define CV_SIGNAL_VALIDATE(cvp) do { \
if (!TAILQ_EMPTY(&(cvp)->cv_waitq)) { \
KASSERT(mtx_owned((cvp)->cv_mtx), \
- ("%s: Mutex not owned", __FUNCTION__)); \
+ ("%s: Mutex not owned", __func__)); \
} \
} while (0)
#else
@@ -101,7 +101,7 @@ void
cv_destroy(struct cv *cvp)
{
- KASSERT(cv_waitq_empty(cvp), ("%s: cv_waitq non-empty", __FUNCTION__));
+ KASSERT(cv_waitq_empty(cvp), ("%s: cv_waitq non-empty", __func__));
}
/*
@@ -471,8 +471,8 @@ cv_wakeup(struct cv *cvp)
mtx_assert(&sched_lock, MA_OWNED);
td = TAILQ_FIRST(&cvp->cv_waitq);
- KASSERT(td->td_wchan == cvp, ("%s: bogus wchan", __FUNCTION__));
- KASSERT(td->td_flags & TDF_CVWAITQ, ("%s: not on waitq", __FUNCTION__));
+ KASSERT(td->td_wchan == cvp, ("%s: bogus wchan", __func__));
+ KASSERT(td->td_flags & TDF_CVWAITQ, ("%s: not on waitq", __func__));
TAILQ_REMOVE(&cvp->cv_waitq, td, td_slpq);
td->td_flags &= ~TDF_CVWAITQ;
td->td_wchan = 0;
@@ -507,7 +507,7 @@ void
cv_signal(struct cv *cvp)
{
- KASSERT(cvp != NULL, ("%s: cvp NULL", __FUNCTION__));
+ KASSERT(cvp != NULL, ("%s: cvp NULL", __func__));
mtx_lock_spin(&sched_lock);
if (!TAILQ_EMPTY(&cvp->cv_waitq)) {
CV_SIGNAL_VALIDATE(cvp);
@@ -524,7 +524,7 @@ void
cv_broadcast(struct cv *cvp)
{
- KASSERT(cvp != NULL, ("%s: cvp NULL", __FUNCTION__));
+ KASSERT(cvp != NULL, ("%s: cvp NULL", __func__));
mtx_lock_spin(&sched_lock);
CV_SIGNAL_VALIDATE(cvp);
while (!TAILQ_EMPTY(&cvp->cv_waitq))
diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c
index 3de64a2..38136a1 100644
--- a/sys/kern/kern_sx.c
+++ b/sys/kern/kern_sx.c
@@ -85,7 +85,7 @@ sx_destroy(struct sx *sx)
LOCK_LOG_DESTROY(&sx->sx_object, 0);
KASSERT((sx->sx_cnt == 0 && sx->sx_shrd_wcnt == 0 && sx->sx_excl_wcnt ==
- 0), ("%s (%s): holders or waiters\n", __FUNCTION__,
+ 0), ("%s (%s): holders or waiters\n", __func__,
sx->sx_object.lo_name));
sx->sx_lock = NULL;
@@ -101,7 +101,7 @@ _sx_slock(struct sx *sx, const char *file, int line)
mtx_lock(sx->sx_lock);
KASSERT(sx->sx_xholder != curthread,
- ("%s (%s): slock while xlock is held @ %s:%d\n", __FUNCTION__,
+ ("%s (%s): slock while xlock is held @ %s:%d\n", __func__,
sx->sx_object.lo_name, file, line));
/*
@@ -154,7 +154,7 @@ _sx_xlock(struct sx *sx, const char *file, int line)
* INVARIANTS.
*/
KASSERT(sx->sx_xholder != curthread,
- ("%s (%s): xlock already held @ %s:%d", __FUNCTION__,
+ ("%s (%s): xlock already held @ %s:%d", __func__,
sx->sx_object.lo_name, file, line));
/* Loop in case we lose the race for lock acquisition. */
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index 9b76956..7e0e86f 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -49,7 +49,7 @@ static int bus_debug = 1;
SYSCTL_INT(_debug, OID_AUTO, bus_debug, CTLFLAG_RW, &bus_debug, 0,
"Debug bus code");
-#define PDEBUG(a) if (bus_debug) {printf(__FUNCTION__ ":%d: ", __LINE__), printf a, printf("\n");}
+#define PDEBUG(a) if (bus_debug) {printf("%s:%d: ", __func__, __LINE__), printf a, printf("\n");}
#define DEVICENAME(d) ((d)? device_get_name(d): "no device")
#define DRIVERNAME(d) ((d)? d->name : "no driver")
#define DEVCLANAME(d) ((d)? d->name : "no devclass")
diff --git a/sys/kern/subr_mchain.c b/sys/kern/subr_mchain.c
index 3020f56..d78b37f 100644
--- a/sys/kern/subr_mchain.c
+++ b/sys/kern/subr_mchain.c
@@ -44,10 +44,10 @@
MODULE_VERSION(libmchain, 1);
-#define MBERROR(format, args...) printf("%s(%d): "format, __FUNCTION__ , \
+#define MBERROR(format, args...) printf("%s(%d): "format, __func__ , \
__LINE__ ,## args)
-#define MBPANIC(format, args...) printf("%s(%d): "format, __FUNCTION__ , \
+#define MBPANIC(format, args...) printf("%s(%d): "format, __func__ , \
__LINE__ ,## args)
/*
diff --git a/sys/kern/subr_sbuf.c b/sys/kern/subr_sbuf.c
index 330c556..ed04ad5 100644
--- a/sys/kern/subr_sbuf.c
+++ b/sys/kern/subr_sbuf.c
@@ -93,8 +93,8 @@ _assert_sbuf_state(char *fun, struct sbuf *s, int state)
("%s called with %sfinished or corrupt sbuf", fun,
(state ? "un" : "")));
}
-#define assert_sbuf_integrity(s) _assert_sbuf_integrity(__FUNCTION__, (s))
-#define assert_sbuf_state(s, i) _assert_sbuf_state(__FUNCTION__, (s), (i))
+#define assert_sbuf_integrity(s) _assert_sbuf_integrity(__func__, (s))
+#define assert_sbuf_state(s, i) _assert_sbuf_state(__func__, (s), (i))
#else /* _KERNEL && INVARIANTS */
#define assert_sbuf_integrity(s) do { } while (0)
#define assert_sbuf_state(s, i) do { } while (0)
@@ -111,7 +111,7 @@ sbuf_new(struct sbuf *s, char *buf, int length, int flags)
KASSERT(length >= 0,
("attempt to create an sbuf of negative length (%d)", length));
KASSERT(flags == 0,
- (__FUNCTION__ " called with non-zero flags"));
+ ("%s called with non-zero flags", __func__));
if (s == NULL) {
s = (struct sbuf *)SBMALLOC(sizeof *s);
@@ -145,9 +145,9 @@ struct sbuf *
sbuf_uionew(struct sbuf *s, struct uio *uio, int *error)
{
KASSERT(uio != NULL,
- (__FUNCTION__ " called with NULL uio pointer"));
+ ("%s called with NULL uio pointer", __func__));
KASSERT(error != NULL,
- (__FUNCTION__ " called with NULL error pointer"));
+ ("%s called with NULL error pointer", __func__));
s = sbuf_new(s, NULL, uio->uio_resid + 1, 0);
if (s == NULL) {
@@ -337,7 +337,7 @@ sbuf_printf(struct sbuf *s, const char *fmt, ...)
assert_sbuf_state(s, 0);
KASSERT(fmt != NULL,
- (__FUNCTION__ " called with a NULL format string"));
+ ("%s called with a NULL format string", __func__));
if (SBUF_HASOVERFLOWED(s))
return (-1);
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 9944227..015634d 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -341,7 +341,7 @@ m_dup(struct mbuf *m, int how)
/* Sanity check */
if (m == NULL)
return (NULL);
- KASSERT((m->m_flags & M_PKTHDR) != 0, ("%s: !PKTHDR", __FUNCTION__));
+ KASSERT((m->m_flags & M_PKTHDR) != 0, ("%s: !PKTHDR", __func__));
/* While there's more data, get a new mbuf, tack it on, and fill it */
remain = m->m_pkthdr.len;
@@ -389,7 +389,7 @@ m_dup(struct mbuf *m, int how)
/* Check correct total mbuf length */
KASSERT((remain > 0 && m != NULL) || (remain == 0 && m == NULL),
- ("%s: bogus m_pkthdr.len", __FUNCTION__));
+ ("%s: bogus m_pkthdr.len", __func__));
}
return (top);
OpenPOWER on IntegriCloud