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:
parent
d93d332481
commit
1e44b62e0d
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user