mirror of
https://github.com/openharmony/utils_native_lite.git
synced 2026-07-19 14:33:34 -04:00
Fix type warning in offset macros
On 64bit systems the address and hence the offset will not be unsigned int. To fix that issue, use generic pointer size type uintptr_t. Signed-off-by: Zbigniew Bodek <zbigniew.bodek@huawei.com> Change-Id: I69298b48c4676c5935fa2170e23c32586c18de06
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#define _UTILS_LIST_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "ohos_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -377,7 +378,7 @@ static inline void UtilsListHeadInsertList(UTILS_DL_LIST *oldList, UTILS_DL_LIST
|
||||
* <ul><li>utils_list.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see
|
||||
*/
|
||||
#define OFFSET_OF_FIELD(type, field) ((unsigned int)&((type *)0)->field)
|
||||
#define OFFSET_OF_FIELD(type, field) ((uintptr_t)&((type *)0)->field)
|
||||
|
||||
/*
|
||||
* @ingroup utils_list
|
||||
@@ -398,7 +399,7 @@ static inline void UtilsListHeadInsertList(UTILS_DL_LIST *oldList, UTILS_DL_LIST
|
||||
* <ul><li>utils_list.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see
|
||||
*/
|
||||
#define UTILS_OFF_SET_OF(type, member) ((unsigned int)&((type *)0)->member)
|
||||
#define UTILS_OFF_SET_OF(type, member) ((uintptr_t)&((type *)0)->member)
|
||||
|
||||
/*
|
||||
* @ingroup utils_list
|
||||
|
||||
Reference in New Issue
Block a user