summaryrefslogtreecommitdiff
path: root/lib/ovs-thread.h
diff options
context:
space:
mode:
authorShireesh Singh <shireeshcse07@gmail.com>2017-12-15 16:58:57 -0800
committerBen Pfaff <blp@ovn.org>2017-12-19 14:23:25 -0800
commit8bfc3c105de4c190190d762fa04948ee20e92e58 (patch)
tree6ddd4bcaf2ec5d4f0eafb6ac33ca52fa703ab85c /lib/ovs-thread.h
parent538372329b4caef36c8706cb90107a557cfce2ae (diff)
downloadopenvswitch-8bfc3c105de4c190190d762fa04948ee20e92e58.tar.gz
lib: Adding explicit typecasts to fix C++ compilation issues
C++ does not allow implicit conversion from void pointer to a specific pointer type. This change adds explicit typecasts to appropriate types wherever needed. Signed-off-by: Shireesh Kumar Singh <shireeshkum@vmware.com> Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Co-authored-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib/ovs-thread.h')
-rw-r--r--lib/ovs-thread.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ovs-thread.h b/lib/ovs-thread.h
index 55e51a4ed..03fd80439 100644
--- a/lib/ovs-thread.h
+++ b/lib/ovs-thread.h
@@ -260,7 +260,7 @@ void xpthread_join(pthread_t, void **);
static inline NAME##_type * \
NAME##_get_unsafe(void) \
{ \
- return &NAME##_var; \
+ return (NAME##_type *)&NAME##_var; \
} \
\
static inline NAME##_type * \
@@ -316,7 +316,7 @@ void xpthread_join(pthread_t, void **);
static inline NAME##_type * \
NAME##_get_unsafe(void) \
{ \
- return pthread_getspecific(NAME##_key); \
+ return (NAME##_type *)pthread_getspecific(NAME##_key); \
} \
\
NAME##_type *NAME##_get(void);