cvs commit: src/sys/dev/ep if_ep.c
M. Warner Losh
imp at bsdimp.com
Thu Oct 23 00:37:34 PDT 2003
In message: <xzpfzhkh10t.fsf at dwp.des.no>
des at des.no (Dag-Erling Smørgrav) writes:
: "M. Warner Losh" <imp at bsdimp.com> writes:
: > caddr_t is right: it is a character pointer. uintptr_t is something
: > else. caddr_t is what was used before.
:
: caddr_t is never right. If it's a character pointer, use char *.
Why not? The rest of the driver uses it heavily, and the data type of
the underlying mbufs is caddr_t:
#define mtod(m, t) ((t)((m)->m_data))
struct m_hdr {
struct mbuf *mh_next; /* next buffer in chain */
struct mbuf *mh_nextpkt; /* next chain in queue/record */
caddr_t mh_data; /* location of data */
int mh_len; /* amount of data in this mbuf */
int mh_flags; /* flags; see below */
short mh_type; /* type of data in this mbuf */
};
struct mbuf {
struct m_hdr m_hdr;
...
#define m_data m_hdr.mh_data
...
Warner
More information about the cvs-src
mailing list