]> git.proxmox.com Git - mirror_lxc.git/commitdiff
macro: Adds UINT_TO_PTR and PTR_TO_USHORT helpers
authorThomas Parrott <thomas.parrott@canonical.com>
Mon, 8 Jun 2020 12:24:08 +0000 (13:24 +0100)
committerThomas Parrott <thomas.parrott@canonical.com>
Mon, 8 Jun 2020 12:27:07 +0000 (13:27 +0100)
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
src/lxc/macro.h

index 3a5bb0746422ca92c588722d3117574991ab71bd..7b2ad79edd27af13a642233f819de076079101f3 100644 (file)
@@ -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)