Update to C99, s/__FUNCTION__/__func__/.

This commit is contained in:
obrien 2001-12-10 05:51:45 +00:00
parent cca4f7b2d9
commit 330a1032c1
6 changed files with 25 additions and 25 deletions

View File

@ -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))

View File

@ -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. */

View File

@ -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")

View File

@ -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)
/*

View File

@ -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);

View File

@ -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);