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
diff --git a/slirp/mbuf.c b/slirp/mbuf.c
index 655de41..1d30a63 100644
--- a/slirp/mbuf.c
+++ b/slirp/mbuf.c
@@ -29,7 +29,7 @@
 #define SLIRP_MSIZE (IF_MTU + IF_MAXLINKHDR + sizeof(struct m_hdr ) + 6)
 
 void
-m_init()
+m_init(void)
 {
 	m_freelist.m_next = m_freelist.m_prev = &m_freelist;
 	m_usedlist.m_next = m_usedlist.m_prev = &m_usedlist;
@@ -44,7 +44,7 @@
  * which tells m_free to actually free() it
  */
 struct mbuf *
-m_get()
+m_get(void)
 {
 	register struct mbuf *m;
 	int flags = 0;
@@ -72,16 +72,15 @@
 	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;
+m_free(struct mbuf *m)
 {
 
   DEBUG_CALL("m_free");
@@ -115,8 +114,7 @@
  * an M_EXT data segment
  */
 void
-m_cat(m, n)
-	register struct mbuf *m, *n;
+m_cat(struct mbuf *m, struct mbuf *n)
 {
 	/*
 	 * If there's no room, realloc
@@ -133,9 +131,7 @@
 
 /* make m size bytes large */
 void
-m_inc(m, size)
-        struct mbuf *m;
-        int size;
+m_inc(struct mbuf *m, int size)
 {
 	int datasize;
 
@@ -170,9 +166,7 @@
 
 
 void
-m_adj(m, len)
-	struct mbuf *m;
-	int len;
+m_adj(struct mbuf *m, int len)
 {
 	if (m == NULL)
 		return;
@@ -192,9 +186,7 @@
  * Copy len bytes from m, starting off bytes into n
  */
 int
-m_copy(n, m, off, len)
-	struct mbuf *n, *m;
-	int off, len;
+m_copy(struct mbuf *n, struct mbuf *m, int off, int len)
 {
 	if (len > M_FREEROOM(n))
 		return -1;
@@ -211,8 +203,7 @@
  * Fortunately, it's not used often
  */
 struct mbuf *
-dtom(dat)
-	void *dat;
+dtom(void *dat)
 {
 	struct mbuf *m;