--- previous/src/slirp/sbuf.c 2018/04/24 19:30:44 1.1 +++ previous/src/slirp/sbuf.c 2018/04/24 19:32:34 1.1.1.2 @@ -16,17 +16,12 @@ * } */ -void -sbfree(sb) - struct sbuf *sb; +void sbfree(struct sbuf *sb) { free(sb->sb_data); } -void -sbdrop(sb, num) - struct sbuf *sb; - int num; +void sbdrop(struct sbuf *sb, u_int num) { /* * We can only drop how much we have @@ -41,10 +36,7 @@ sbdrop(sb, num) } -void -sbreserve(sb, size) - struct sbuf *sb; - int size; +void sbreserve(struct sbuf *sb, size_t size) { if (sb->sb_data) { /* Already alloced, realloc if necessary */ @@ -72,17 +64,14 @@ sbreserve(sb, size) * this prevents an unnecessary copy of the data * (the socket is non-blocking, so we won't hang) */ -void -sbappend(so, m) - struct socket *so; - struct mbuf *m; +void sbappend(struct socket *so, struct mbuf *m) { int ret = 0; DEBUG_CALL("sbappend"); DEBUG_ARG("so = %lx", (long)so); DEBUG_ARG("m = %lx", (long)m); - DEBUG_ARG("m->m_len = %d", m->m_len); + DEBUG_ARG("m->m_len = %zu", m->m_len); /* Shouldn't happen, but... e.g. foreign host closes connection */ if (m->m_len <= 0) { @@ -134,10 +123,7 @@ sbappend(so, m) * Copy the data from m into sb * The caller is responsible to make sure there's enough room */ -void -sbappendsb(sb, m) - struct sbuf *sb; - struct mbuf *m; +void sbappendsb(struct sbuf *sb, struct mbuf *m) { int len, n, nn; @@ -173,12 +159,7 @@ sbappendsb(sb, m) * Don't update the sbuf rptr, this will be * done in sbdrop when the data is acked */ -void -sbcopy(sb, off, len, to) - struct sbuf *sb; - int off; - int len; - char *to; +void sbcopy(struct sbuf *sb, u_int off, u_int len, char *to) { char *from;