From: Thomas Parrott Date: Mon, 8 Jun 2020 12:24:08 +0000 (+0100) Subject: macro: Adds UINT_TO_PTR and PTR_TO_USHORT helpers X-Git-Tag: lxc-5.0.0~422^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=372adece8bf59c24696462a211b53ace3c93c0e8;p=thirdparty%2Flxc.git macro: Adds UINT_TO_PTR and PTR_TO_USHORT helpers Signed-off-by: Thomas Parrott --- diff --git a/src/lxc/macro.h b/src/lxc/macro.h index 3a5bb0746..7b2ad79ed 100644 --- a/src/lxc/macro.h +++ b/src/lxc/macro.h @@ -433,6 +433,9 @@ enum { #define PTR_TO_UINT64(p) ((uint64_t)((intptr_t)(p))) +#define UINT_TO_PTR(u) ((void *) ((uintptr_t) (u))) +#define PTR_TO_USHORT(p) ((unsigned short)((uintptr_t)(p))) + #define LXC_INVALID_UID ((uid_t)-1) #define LXC_INVALID_GID ((gid_t)-1)