Lines Matching refs:ptr
162 #define IS_ARRAY_ELEMENT(array, ptr) \ argument
163 ((ptr) && POINTER_TO_UINT(array) <= POINTER_TO_UINT(ptr) && \
164 POINTER_TO_UINT(ptr) < POINTER_TO_UINT(&(array)[ARRAY_SIZE(array)]) && \
165 (POINTER_TO_UINT(ptr) - POINTER_TO_UINT(array)) % sizeof((array)[0]) == 0)
181 #define ARRAY_INDEX(array, ptr) \ argument
183 __ASSERT_NO_MSG(IS_ARRAY_ELEMENT(array, ptr)); \
184 (__typeof__((array)[0]) *)(ptr) - (array); \
197 #define PART_OF_ARRAY(array, ptr) \ argument
198 ((ptr) && POINTER_TO_UINT(array) <= POINTER_TO_UINT(ptr) && \
199 POINTER_TO_UINT(ptr) < POINTER_TO_UINT(&(array)[ARRAY_SIZE(array)]))
218 #define ARRAY_INDEX_FLOOR(array, ptr) \ argument
220 __ASSERT_NO_MSG(PART_OF_ARRAY(array, ptr)); \
221 (POINTER_TO_UINT(ptr) - POINTER_TO_UINT(array)) / sizeof((array)[0]); \
238 #define ARRAY_FOR_EACH_PTR(array, ptr) \ argument
239 for (__typeof__(*(array)) *ptr = (array); (size_t)((ptr) - (array)) < ARRAY_SIZE(array); \
240 ++(ptr))
255 #define CONTAINER_OF_VALIDATE(ptr, type, field) \ argument
256 BUILD_ASSERT(SAME_TYPE(*(ptr), ((type *)0)->field) || \
257 SAME_TYPE(*(ptr), void), \
260 #define CONTAINER_OF_VALIDATE(ptr, type, field)
284 #define CONTAINER_OF(ptr, type, field) \ argument
286 CONTAINER_OF_VALIDATE(ptr, type, field) \
287 ((type *)(((char *)(ptr)) - offsetof(type, field))); \
317 #define IS_ALIGNED(ptr, align) (((uintptr_t)(ptr)) % (align) == 0) argument