forked from Imagelibrary/rtems
Patch from D. V. Henkel-Wallace <gumby@zembu.com> to use puts and have prototype.
This commit is contained in:
@@ -9,6 +9,8 @@
|
|||||||
* $Id$
|
* $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h> /* for puts */
|
||||||
|
|
||||||
#undef ADDCARRY
|
#undef ADDCARRY
|
||||||
#define ADDCARRY(x) if ((x) > 0xffff) (x) -= 0xffff
|
#define ADDCARRY(x) if ((x) > 0xffff) (x) -= 0xffff
|
||||||
#define REDUCE {sum = (sum & 0xffff) + (sum >> 16); ADDCARRY(sum);}
|
#define REDUCE {sum = (sum & 0xffff) + (sum >> 16); ADDCARRY(sum);}
|
||||||
@@ -186,7 +188,7 @@ in_cksum(m, len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (len)
|
if (len)
|
||||||
printf("cksum: out of data\n");
|
puts("cksum: out of data");
|
||||||
if (mlen == -1) {
|
if (mlen == -1) {
|
||||||
/* The last mbuf has odd # of bytes. Follow the
|
/* The last mbuf has odd # of bytes. Follow the
|
||||||
standard (the odd byte is shifted left by 8 bits) */
|
standard (the odd byte is shifted left by 8 bits) */
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
* $Id$
|
* $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h> /* for puts */
|
||||||
|
|
||||||
#undef ADDCARRY
|
#undef ADDCARRY
|
||||||
#define ADDCARRY(x) if ((x) > 0xffff) (x) -= 0xffff
|
#define ADDCARRY(x) if ((x) > 0xffff) (x) -= 0xffff
|
||||||
#define REDUCE {sum = (sum & 0xffff) + (sum >> 16); ADDCARRY(sum);}
|
#define REDUCE {sum = (sum & 0xffff) + (sum >> 16); ADDCARRY(sum);}
|
||||||
@@ -186,7 +188,7 @@ in_cksum(m, len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (len)
|
if (len)
|
||||||
printf("cksum: out of data\n");
|
puts("cksum: out of data");
|
||||||
if (mlen == -1) {
|
if (mlen == -1) {
|
||||||
/* The last mbuf has odd # of bytes. Follow the
|
/* The last mbuf has odd # of bytes. Follow the
|
||||||
standard (the odd byte is shifted left by 8 bits) */
|
standard (the odd byte is shifted left by 8 bits) */
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
* $Id$
|
* $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h> /* for puts */
|
||||||
|
|
||||||
#undef ADDCARRY
|
#undef ADDCARRY
|
||||||
#define ADDCARRY(x) if ((x) > 0xffff) (x) -= 0xffff
|
#define ADDCARRY(x) if ((x) > 0xffff) (x) -= 0xffff
|
||||||
#define REDUCE {sum = (sum & 0xffff) + (sum >> 16); ADDCARRY(sum);}
|
#define REDUCE {sum = (sum & 0xffff) + (sum >> 16); ADDCARRY(sum);}
|
||||||
@@ -186,7 +188,7 @@ in_cksum(m, len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (len)
|
if (len)
|
||||||
printf("cksum: out of data\n");
|
puts("cksum: out of data");
|
||||||
if (mlen == -1) {
|
if (mlen == -1) {
|
||||||
/* The last mbuf has odd # of bytes. Follow the
|
/* The last mbuf has odd # of bytes. Follow the
|
||||||
standard (the odd byte is shifted left by 8 bits) */
|
standard (the odd byte is shifted left by 8 bits) */
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
* $Id$
|
* $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h> /* for puts */
|
||||||
|
|
||||||
#undef ADDCARRY
|
#undef ADDCARRY
|
||||||
#define ADDCARRY(x) if ((x) > 0xffff) (x) -= 0xffff
|
#define ADDCARRY(x) if ((x) > 0xffff) (x) -= 0xffff
|
||||||
#define REDUCE {sum = (sum & 0xffff) + (sum >> 16); ADDCARRY(sum);}
|
#define REDUCE {sum = (sum & 0xffff) + (sum >> 16); ADDCARRY(sum);}
|
||||||
@@ -186,7 +188,7 @@ in_cksum(m, len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (len)
|
if (len)
|
||||||
printf("cksum: out of data\n");
|
puts("cksum: out of data");
|
||||||
if (mlen == -1) {
|
if (mlen == -1) {
|
||||||
/* The last mbuf has odd # of bytes. Follow the
|
/* The last mbuf has odd # of bytes. Follow the
|
||||||
standard (the odd byte is shifted left by 8 bits) */
|
standard (the odd byte is shifted left by 8 bits) */
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
* $Id$
|
* $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h> /* for puts */
|
||||||
|
|
||||||
#undef ADDCARRY
|
#undef ADDCARRY
|
||||||
#define ADDCARRY(x) if ((x) > 0xffff) (x) -= 0xffff
|
#define ADDCARRY(x) if ((x) > 0xffff) (x) -= 0xffff
|
||||||
#define REDUCE {sum = (sum & 0xffff) + (sum >> 16); ADDCARRY(sum);}
|
#define REDUCE {sum = (sum & 0xffff) + (sum >> 16); ADDCARRY(sum);}
|
||||||
@@ -186,7 +188,7 @@ in_cksum(m, len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (len)
|
if (len)
|
||||||
printf("cksum: out of data\n");
|
puts("cksum: out of data");
|
||||||
if (mlen == -1) {
|
if (mlen == -1) {
|
||||||
/* The last mbuf has odd # of bytes. Follow the
|
/* The last mbuf has odd # of bytes. Follow the
|
||||||
standard (the odd byte is shifted left by 8 bits) */
|
standard (the odd byte is shifted left by 8 bits) */
|
||||||
|
|||||||
Reference in New Issue
Block a user