diff --git a/src/cw/cw.h b/src/cw/cw.h index 9b5c3acf..7a84cff5 100644 --- a/src/cw/cw.h +++ b/src/cw/cw.h @@ -98,8 +98,13 @@ /* macros to acces transport header values */ #define cw_get_hdr_preamble(th) (th[0]) -#define cw_get_hdr_fragid(th) ((ntohl((((uint32_t*)th)[1]) >> 16) & 0xffff)) -#define cw_get_hdr_fragoffset(th) ((ntohl((((uint32_t*)th)[1]) >> 3) & 0x1fff)) + +#define cw_get_hdr_fragid(th)\ + (((ntohl(*(((uint32_t*)(th))+1))) >> 16) & 0xffff) + +#define cw_get_hdr_fragoffset(th)\ + (((ntohl(*(((uint32_t*)(th))+1))) >> 3) & 0x1fff) + #define cw_get_hdr_rid(th) ((ntohl((((uint32_t*)th)[0]) >> 14) & 0x1f)) #define cw_get_hdr_wbid(th) ((ntohl(((uint32_t*)th)[0]) >> 9) & 0x1f) #define cw_get_hdr_hlen(th) ((ntohl(((uint32_t*)th)[0]) >> 19) & 0x1f)