pam_wrapper: use uintptr_t as base for const-discarding
authorUri Simchoni <uri@samba.org>
Sun, 19 Nov 2017 13:08:30 +0000 (13:08 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 24 Nov 2017 00:13:15 +0000 (01:13 +0100)
Seems like HAVE_INTPTR_T is not available on FreeBSD. Use
the uintptr_t-base const discarding to avoid picky compiler
warnings (other places in Samba also use uintptr_t).

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(ported from pam_wrapper c611121eec7b5f2c39cab7b1c0295eddefdddb1d)

lib/pam_wrapper/python/pypamtest.c

index a71fd359bff2037613a93b5d079c939f5bd21820..c52e1bce685c04477124f4196e4d42696e049b54 100644 (file)
@@ -24,8 +24,8 @@
 #define PYTHON_MODULE_NAME  "pypamtest"
 
 #ifndef discard_const_p
-#if defined(__intptr_t_defined) || defined(HAVE_INTPTR_T)
-# define discard_const_p(type, ptr) ((type *)((intptr_t)(ptr)))
+#if defined(__intptr_t_defined) || defined(HAVE_UINTPTR_T)
+# define discard_const_p(type, ptr) ((type *)((uintptr_t)(ptr)))
 #else
 # define discard_const_p(type, ptr) ((type *)(ptr))
 #endif