aboutsummaryrefslogtreecommitdiff
path: root/mbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbuf.c')
-rw-r--r--mbuf.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/mbuf.c b/mbuf.c
index 32e5397..50ff112 100644
--- a/mbuf.c
+++ b/mbuf.c
@@ -28,7 +28,7 @@ int mbuf_max = 0;
*/
#define SLIRP_MSIZE (IF_MTU + IF_MAXLINKHDR + sizeof(struct m_hdr) + 6)
-void m_init()
+void m_init(void)
{
m_freelist.m_next = m_freelist.m_prev = &m_freelist;
m_usedlist.m_next = m_usedlist.m_prev = &m_usedlist;
@@ -42,7 +42,7 @@ void m_init()
* free old mbufs, we mark all mbufs above mbuf_thresh as M_DOFREE,
* which tells m_free to actually free() it
*/
-struct mbuf *m_get()
+struct mbuf *m_get(void)
{
register struct mbuf *m;
int flags = 0;
@@ -71,14 +71,14 @@ struct mbuf *m_get()
m->m_size = SLIRP_MSIZE - sizeof(struct m_hdr);
m->m_data = m->m_dat;
m->m_len = 0;
- m->m_nextpkt = 0;
- m->m_prevpkt = 0;
+ m->m_nextpkt = NULL;
+ m->m_prevpkt = NULL;
end_error:
DEBUG_ARG("m = %lx", (long)m);
return m;
}
-void m_free(m) struct mbuf *m;
+void m_free(struct mbuf *m)
{
DEBUG_CALL("m_free");
DEBUG_ARG("m = %lx", (long)m);
@@ -110,7 +110,7 @@ void m_free(m) struct mbuf *m;
* the other.. if result is too big for one mbuf, malloc()
* an M_EXT data segment
*/
-void m_cat(m, n) register struct mbuf *m, *n;
+void m_cat(struct mbuf *m, struct mbuf *n)
{
/*
* If there's no room, realloc
@@ -126,8 +126,7 @@ void m_cat(m, n) register struct mbuf *m, *n;
/* make m size bytes large */
-void m_inc(m, size) struct mbuf *m;
-int size;
+void m_inc(struct mbuf *m, int size)
{
int datasize;
@@ -160,8 +159,7 @@ int size;
}
-void m_adj(m, len) struct mbuf *m;
-int len;
+void m_adj(struct mbuf *m, int len)
{
if (m == NULL)
return;
@@ -180,8 +178,7 @@ int len;
/*
* Copy len bytes from m, starting off bytes into n
*/
-int m_copy(n, m, off, len) struct mbuf *n, *m;
-int off, len;
+int m_copy(struct mbuf *n, struct mbuf *m, int off, int len)
{
if (len > M_FREEROOM(n))
return -1;
@@ -197,7 +194,7 @@ int off, len;
* XXX This is a kludge, I should eliminate the need for it
* Fortunately, it's not used often
*/
-struct mbuf *dtom(dat) void *dat;
+struct mbuf *dtom(void *dat)
{
struct mbuf *m;