comparison m_struct.h @ 37183:eaa58d991a06

Use intptr_t to cast a pointer. Avoids warnings especially when compiling for 64-bit Windows. Patch by Stephen Sheldon [sfsheldo gmail].
author reimar
date Wed, 17 Sep 2014 16:55:09 +0000
parents fd1feb8ae5fd
children 36d586f37e26
comparison
equal deleted inserted replaced
37182:1c64016edce3 37183:eaa58d991a06
60 /** \param struct_p Pointer to the struct. 60 /** \param struct_p Pointer to the struct.
61 * \param struct_offset Offset of the field in the struct. 61 * \param struct_offset Offset of the field in the struct.
62 * \return Pointer to the struct field. 62 * \return Pointer to the struct field.
63 */ 63 */
64 #define M_ST_MB_P(struct_p, struct_offset) \ 64 #define M_ST_MB_P(struct_p, struct_offset) \
65 ((void *)((char *)(struct_p) + (unsigned long)(struct_offset))) 65 ((void *)((char *)(struct_p) + (intptr_t)(struct_offset)))
66 66
67 /// Access a struct field at a given offset. 67 /// Access a struct field at a given offset.
68 /** \param member_type Type of the field. 68 /** \param member_type Type of the field.
69 * \param struct_p Pointer to the struct. 69 * \param struct_p Pointer to the struct.
70 * \param struct_offset Offset of the field in the struct. 70 * \param struct_offset Offset of the field in the struct.