diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-02-02 00:20:05 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-02-02 00:20:05 +0100 |
commit | b092f2e0f8686d78ceccac07bea4b7d2e327fb67 (patch) | |
tree | 177125633b55881aa5df9a51c64e1de050d31c25 /src/pulsecore/macro.h | |
parent | 55f643d49ea708b2c95a65aedb93dcc38eb9ec4e (diff) |
use uintpr_t when casting between pointers and integers
Diffstat (limited to 'src/pulsecore/macro.h')
-rw-r--r-- | src/pulsecore/macro.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/pulsecore/macro.h b/src/pulsecore/macro.h index f9ce949a..59460012 100644 --- a/src/pulsecore/macro.h +++ b/src/pulsecore/macro.h @@ -187,17 +187,17 @@ typedef int pa_bool_t; abort(); \ } while (FALSE) -#define PA_PTR_TO_UINT(p) ((unsigned int) (unsigned long) (p)) -#define PA_UINT_TO_PTR(u) ((void*) (unsigned long) (u)) +#define PA_PTR_TO_UINT(p) ((unsigned int) ((uintptr_t) (p))) +#define PA_UINT_TO_PTR(u) ((void*) ((uintptr_t) (u))) -#define PA_PTR_TO_UINT32(p) ((uint32_t) PA_PTR_TO_UINT(p)) -#define PA_UINT32_TO_PTR(u) PA_UINT_TO_PTR((uint32_t) u) +#define PA_PTR_TO_UINT32(p) ((uint32_t) ((uintptr_t) (p))) +#define PA_UINT32_TO_PTR(u) ((void*) ((uintptr_t) (u))) -#define PA_PTR_TO_INT(p) ((int) PA_PTR_TO_UINT(p)) -#define PA_INT_TO_PTR(u) PA_UINT_TO_PTR((int) u) +#define PA_PTR_TO_INT(p) ((int) ((intptr_t) (p))) +#define PA_INT_TO_PTR(u) ((void*) ((intptr_t) (u))) -#define PA_PTR_TO_INT32(p) ((int32_t) PA_PTR_TO_UINT(p)) -#define PA_INT32_TO_PTR(u) PA_UINT_TO_PTR((int32_t) u) +#define PA_PTR_TO_INT32(p) ((int32_t) ((intptr_t) (p))) +#define PA_INT32_TO_PTR(u) ((void*) ((intptr_t) (u))) #ifdef OS_IS_WIN32 #define PA_PATH_SEP "\\" |