There is no reason to be cute with ntohl(). Just call it directly rather

than use a macro that tries to do conversions in place.

Compile tested on:	sparc64
This commit is contained in:
David E. O'Brien 2003-02-23 22:26:39 +00:00
parent d93d332481
commit 1e44b62e0d
5 changed files with 8 additions and 22 deletions

View File

@ -282,20 +282,6 @@ typedef void KTimeout_ret;
#endif /* _KERNEL */
#ifndef NTOHL
#if BYTE_ORDER == BIG_ENDIAN
#define NTOHL(x) (x)
#define NTOHS(x) (x)
#define HTONL(x) (x)
#define HTONS(x) (x)
#else
#define NTOHL(x) (x) = ntohl((u_long)(x))
#define NTOHS(x) (x) = ntohs((u_short)(x))
#define HTONL(x) (x) = htonl((u_long)(x))
#define HTONS(x) (x) = htons((u_short)(x))
#endif
#endif /* NTOHL */
#ifndef MAX
#define MAX(a,b) max((a),(b))
#endif

View File

@ -1729,7 +1729,7 @@ sscop_poll_ready(sop, m, trlr)
struct poll_pdu *pp = (struct poll_pdu *)trlr;
sscop_seq nps;
NTOHL(pp->poll_ns);
pp->poll_ns = ntohl(pp->poll_ns);
/*
* If the poll sequence number is less than highest number

View File

@ -1395,7 +1395,7 @@ sscop_poll_ready(sop, m, trlr)
struct poll_pdu *pp = (struct poll_pdu *)trlr;
sscop_seq nps;
NTOHL(pp->poll_ns);
pp->poll_ns = ntohl(pp->poll_ns);
/*
* If the poll sequence number is less than highest number

View File

@ -1756,9 +1756,9 @@ sscop_stat_ready(sop, m, trlr)
sscop_seq seq1, seq2, opa;
int cnt = 0;
NTOHL(sp->stat_nps);
NTOHL(sp->stat_nmr);
NTOHL(sp->stat_nr);
sp->stat_nps = ntohl(sp->stat_nps);
sp->stat_nmr = ntohl(sp->stat_nmr);
sp->stat_nr = ntohl(sp->stat_nr);
/*
* Validate peer's received poll sequence number
@ -2144,8 +2144,8 @@ sscop_ustat_ready(sop, m, trlr)
struct pdu_hdr *php;
sscop_seq seq1, seq2;
NTOHL(up->ustat_nmr);
NTOHL(up->ustat_nr);
up->ustat_nmr = ntohl(up->ustat_nmr);
up->ustat_nr = ntohl(up->ustat_nr);
/*
* Validate peer's current receive data sequence number

View File

@ -147,7 +147,7 @@ sscop_stat_getelem(m, pelem)
/*
* Put element (sequence number) into host order
*/
NTOHL(*pelem);
*pelem = ntohl(*pelem);
/*
* Get pointers set for next call