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
This commit is contained in:
blueswir1 2009-03-07 15:32:56 +00:00
parent c276471991
commit 511d2b140f
35 changed files with 214 additions and 286 deletions

View file

@ -53,9 +53,7 @@ u_int16_t ip_id;
* The mbuf opt, if present, will not be freed.
*/
int
ip_output(so, m0)
struct socket *so;
struct mbuf *m0;
ip_output(struct socket *so, struct mbuf *m0)
{
register struct ip *ip;
register struct mbuf *m = m0;
@ -135,7 +133,7 @@ ip_output(so, m0)
for (off = hlen + len; off < (u_int16_t)ip->ip_len; off += len) {
register struct ip *mhip;
m = m_get();
if (m == 0) {
if (m == NULL) {
error = -1;
STAT(ipstat.ips_odropped++);
goto sendorfree;
@ -185,7 +183,7 @@ ip_output(so, m0)
sendorfree:
for (m = m0; m; m = m0) {
m0 = m->m_nextpkt;
m->m_nextpkt = 0;
m->m_nextpkt = NULL;
if (error == 0)
if_output(so, m);
else