Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/nfs/xdr_subs.h
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | #define txdr_nfsv4time(f, t) do { \ | ||||
((struct nfsv4_time *)(t))->nfsv4_sec = htonl((f)->tv_sec); \ | ((struct nfsv4_time *)(t))->nfsv4_sec = htonl((f)->tv_sec); \ | ||||
((struct nfsv4_time *)(t))->nfsv4_nsec = htonl((f)->tv_nsec); \ | ((struct nfsv4_time *)(t))->nfsv4_nsec = htonl((f)->tv_nsec); \ | ||||
} while (0) | } while (0) | ||||
#define fxdr_hyper(f) \ | #define fxdr_hyper(f) \ | ||||
((((u_quad_t)ntohl(((u_int32_t *)(f))[0])) << 32) | \ | ((((u_quad_t)ntohl(((u_int32_t *)(f))[0])) << 32) | \ | ||||
(u_quad_t)(ntohl(((u_int32_t *)(f))[1]))) | (u_quad_t)(ntohl(((u_int32_t *)(f))[1]))) | ||||
#define txdr_hyper(f, t) do { \ | static inline void | ||||
((u_int32_t *)(t))[0] = htonl((u_int32_t)((f) >> 32)); \ | txdr_hyper(uint64_t f, uint32_t* t) | ||||
((u_int32_t *)(t))[1] = htonl((u_int32_t)((f) & 0xffffffff)); \ | { | ||||
} while (0) | t[0] = htonl((u_int32_t)(f >> 32)); | ||||
t[1] = htonl((u_int32_t)(f & 0xffffffff)); | |||||
} | |||||
rmacklem: Oh, and I don't know if it matters, but
making inline functions "static" seems to
be the… | |||||
Not Done Inline ActionsYou could take some of the ugly stuff out, Also, there's no need for "f" to be bracketed "(f)". rmacklem: You could take some of the ugly stuff out,
especially on the left side of the assignment.
ie. | |||||
Done Inline ActionsOops, I thought I fixed that, but I forgot that I need to fix it in two places. asomers: Oops, I thought I fixed that, but I forgot that I need to fix it in two places. | |||||
#endif /* _NFS_XDR_SUBS_H_ */ | #endif /* _NFS_XDR_SUBS_H_ */ |
Oh, and I don't know if it matters, but
making inline functions "static" seems to
be the tradition.