aboutsummaryrefslogtreecommitdiff
path: root/slirp/cksum.c
diff options
context:
space:
mode:
authorStefan Weil <weil@mail.berlios.de>2010-07-22 22:15:23 +0200
committerAurelien Jarno <aurelien@aurel32.net>2010-07-25 16:59:41 +0200
commitb6dce92e8917762e6bf81e177b20a0b7909a0532 (patch)
tree3281511ec4af76aa696665b655059d15393db22b /slirp/cksum.c
parent1fc3dc29305cfdadc6e57bb21516799dddf9b91e (diff)
downloadqemu-b6dce92e8917762e6bf81e177b20a0b7909a0532.zip
qemu-b6dce92e8917762e6bf81e177b20a0b7909a0532.tar.gz
qemu-b6dce92e8917762e6bf81e177b20a0b7909a0532.tar.bz2
slirp: Replace u_int8_t, u_int16_t, u_int32_t, u_int64_t by standard int types
There is no need to have a second set of integral types. Replace them by the standard types from stdint.h. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'slirp/cksum.c')
-rw-r--r--slirp/cksum.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/slirp/cksum.c b/slirp/cksum.c
index 48a1792..e43867d 100644
--- a/slirp/cksum.c
+++ b/slirp/cksum.c
@@ -47,23 +47,23 @@
int cksum(struct mbuf *m, int len)
{
- register u_int16_t *w;
+ register uint16_t *w;
register int sum = 0;
register int mlen = 0;
int byte_swapped = 0;
union {
- u_int8_t c[2];
- u_int16_t s;
+ uint8_t c[2];
+ uint16_t s;
} s_util;
union {
- u_int16_t s[2];
- u_int32_t l;
+ uint16_t s[2];
+ uint32_t l;
} l_util;
if (m->m_len == 0)
goto cont;
- w = mtod(m, u_int16_t *);
+ w = mtod(m, uint16_t *);
mlen = m->m_len;
@@ -78,8 +78,8 @@ int cksum(struct mbuf *m, int len)
if ((1 & (long) w) && (mlen > 0)) {
REDUCE;
sum <<= 8;
- s_util.c[0] = *(u_int8_t *)w;
- w = (u_int16_t *)((int8_t *)w + 1);
+ s_util.c[0] = *(uint8_t *)w;
+ w = (uint16_t *)((int8_t *)w + 1);
mlen--;
byte_swapped = 1;
}
@@ -111,14 +111,14 @@ int cksum(struct mbuf *m, int len)
REDUCE;
sum <<= 8;
if (mlen == -1) {
- s_util.c[1] = *(u_int8_t *)w;
+ s_util.c[1] = *(uint8_t *)w;
sum += s_util.s;
mlen = 0;
} else
mlen = -1;
} else if (mlen == -1)
- s_util.c[0] = *(u_int8_t *)w;
+ s_util.c[0] = *(uint8_t *)w;
cont:
#ifdef DEBUG