diff options
author | Alexander Kabaev <kan@FreeBSD.org> | 2004-07-28 06:58:23 +0000 |
---|---|---|
committer | Alexander Kabaev <kan@FreeBSD.org> | 2004-07-28 06:58:23 +0000 |
commit | 766f8c92470efd014392d4018415944f0134bbbd (patch) | |
tree | 7449f744cbf131f25b43e6d01a79db311f3fc8d8 /sys/netipx | |
parent | a0ec13c419e5657ac4d224e581ae808eda9babac (diff) | |
download | src-766f8c92470efd014392d4018415944f0134bbbd.tar.gz src-766f8c92470efd014392d4018415944f0134bbbd.zip |
Avoid casts as lvalues. Declare local variable as u_char * instead of
declaring it as u_short * and casting it back to uchar * all over the place.
Notes
Notes:
svn path=/head/; revision=132779
Diffstat (limited to 'sys/netipx')
-rw-r--r-- | sys/netipx/ipx_cksum.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netipx/ipx_cksum.c b/sys/netipx/ipx_cksum.c index 09f6fccd9ad6..b63b807a5e72 100644 --- a/sys/netipx/ipx_cksum.c +++ b/sys/netipx/ipx_cksum.c @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); u_short ipx_cksum(struct mbuf *m, int len) { u_int32_t sum = 0; - u_short *w; + u_char *w; u_char oldtc; int mlen, words; struct ipx *ipx; @@ -62,7 +62,7 @@ ipx_cksum(struct mbuf *m, int len) { ipx = mtod(m, struct ipx*); oldtc = ipx->ipx_tc; ipx->ipx_tc = 0; - w = &ipx->ipx_len; + w = (u_char *)&ipx->ipx_len; len -= 2; mlen = 2; @@ -83,7 +83,7 @@ ipx_cksum(struct mbuf *m, int len) { break; mlen &= 1; if (mlen) { - buf.b[0] = *(u_char*)w; + buf.b[0] = *w; if (--len == 0) { buf.b[1] = 0; sum += buf.w; @@ -93,11 +93,11 @@ ipx_cksum(struct mbuf *m, int len) { m = m->m_next; if (m == NULL) break; - w = mtod(m, u_short*); + w = mtod(m, u_char *); if (mlen) { - buf.b[1] = *(u_char*)w; + buf.b[1] = *w; sum += buf.w; - ((u_char*)w)++; + w++; if (--len == 0) break; } |