changeset 24409:b525feae6534

12100 libadutils: cast between incompatible function types Reviewed by: Andy Fiddaman <andy@omniosce.org> Reviewed by: C Fraire <cfraire@me.com> Reviewed by: Matthias Scheler <mscheler@tintri.com> Approved by: Robert Mustacchi <rm@fingolfin.org>
author Toomas Soome <tsoome@me.com>
date Tue, 27 Nov 2018 09:59:55 +0200
parents f6f9e7acc4db
children d6bd3a8cd85e 76500f2fab5a
files usr/src/lib/libadutils/common/adutils_threadfuncs.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/lib/libadutils/common/adutils_threadfuncs.c	Mon Nov 26 00:10:27 2018 +0200
+++ b/usr/src/lib/libadutils/common/adutils_threadfuncs.c	Tue Nov 27 09:59:55 2018 +0200
@@ -46,6 +46,7 @@
 	char *le_errmsg;
 };
 
+static void *adutils_threadid(void);
 static void *adutils_mutex_alloc(void);
 static void adutils_mutex_free(void *mutexp);
 static int adutils_get_errno(void);
@@ -70,10 +71,9 @@
 };
 
 struct ldap_extra_thread_fns extra_thread_fns = {
-	.ltf_threadid_fn = (void * (*)(void))pthread_self
+	.ltf_threadid_fn = adutils_threadid
 };
 
-
 /*
  * Set up thread management functions for the specified LDAP session.
  * Returns either LDAP_SUCCESS or -1.
@@ -112,6 +112,12 @@
 	return (rc);
 }
 
+static void *
+adutils_threadid(void)
+{
+	return ((void *)(uintptr_t)pthread_self());
+}
+
 /*
  * Allocate a mutex.
  */