RTE_SET_USED(unused);
- if (RTE_PTR_ADD(SMALLER, PTR_DIFF) != BIGGER)
+ if ((uintptr_t)RTE_PTR_ADD(SMALLER, PTR_DIFF) != BIGGER)
FAIL_MACRO(RTE_PTR_ADD);
- if (RTE_PTR_SUB(BIGGER, PTR_DIFF) != SMALLER)
+ if ((uintptr_t)RTE_PTR_SUB(BIGGER, PTR_DIFF) != SMALLER)
FAIL_MACRO(RTE_PTR_SUB);
if (RTE_PTR_DIFF(BIGGER, SMALLER) != PTR_DIFF)
FAIL_MACRO(RTE_PTR_DIFF);
/**
* add a byte-value offset from a pointer
*/
-#define RTE_PTR_ADD(ptr, x) ((typeof(ptr))((uintptr_t)(ptr) + (x)))
+#define RTE_PTR_ADD(ptr, x) ((void*)((uintptr_t)(ptr) + (x)))
/**
* subtract a byte-value offset from a pointer
*/
-#define RTE_PTR_SUB(ptr, x) ((typeof(ptr))((uintptr_t)ptr - (x)))
+#define RTE_PTR_SUB(ptr, x) ((void*)((uintptr_t)ptr - (x)))
/**
* get the difference between two pointer values, i.e. how far apart
* must be a power-of-two value.
*/
#define RTE_PTR_ALIGN_CEIL(ptr, align) \
- RTE_PTR_ALIGN_FLOOR(RTE_PTR_ADD(ptr, (align) - 1), align)
+ RTE_PTR_ALIGN_FLOOR((typeof(ptr))RTE_PTR_ADD(ptr, (align) - 1), align)
/**
* Macro to align a value to a given power-of-two. The resultant value