aboutsummaryrefslogtreecommitdiff
path: root/sbuf.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-07 15:32:56 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-07 15:32:56 +0000
commit5b0221f02c31cdba31f9f41cdf4e3a4f601b085e (patch)
tree429a6322b9bf65f6d8652d2f9bf16a50d59b6ac3 /sbuf.c
parent6b3fa17afdbbf844287750380fae74ebfeff73e8 (diff)
downloadslirp-5b0221f02c31cdba31f9f41cdf4e3a4f601b085e.zip
slirp-5b0221f02c31cdba31f9f41cdf4e3a4f601b085e.tar.gz
slirp-5b0221f02c31cdba31f9f41cdf4e3a4f601b085e.tar.bz2
Sparse fixes: NULL use, header order, ANSI prototypes, static
Fix Sparse warnings: * use NULL instead of plain 0 * rearrange header include order to avoid redefining types accidentally * ANSIfy SLIRP * avoid "restrict" keyword * add static git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6736 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'sbuf.c')
-rw-r--r--sbuf.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/sbuf.c b/sbuf.c
index ab6d270..7e4e772 100644
--- a/sbuf.c
+++ b/sbuf.c
@@ -17,13 +17,12 @@ static void sbappendsb(struct sbuf *sb, struct mbuf *m);
* }
*/
-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, int num)
{
/*
* We can only drop how much we have
@@ -37,8 +36,7 @@ int num;
sb->sb_rptr -= sb->sb_datalen;
}
-void sbreserve(sb, size) struct sbuf *sb;
-int size;
+void sbreserve(struct sbuf *sb, int size)
{
if (sb->sb_data) {
/* Already alloced, realloc if necessary */
@@ -67,8 +65,7 @@ int 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;
@@ -166,10 +163,7 @@ static void sbappendsb(struct sbuf *sb, struct mbuf *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, int off, int len, char *to)
{
char *from;