Module: xenomai-jki
Branch: for-forge
Commit: b202c018332568d8b7fb3236ad38d76240c32a3e
URL:    
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=b202c018332568d8b7fb3236ad38d76240c32a3e

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Tue Feb  4 16:16:03 2014 +0100

copperplate: Fix inclusion into C++ programs

C++ requires explicit type casts and forbids arithmetic on void
pointers.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 include/copperplate/heapobj.h   |    2 +-
 include/copperplate/threadobj.h |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/copperplate/heapobj.h b/include/copperplate/heapobj.h
index 21cd44e..377f748 100644
--- a/include/copperplate/heapobj.h
+++ b/include/copperplate/heapobj.h
@@ -129,7 +129,7 @@ static inline char *pvstrdup(const char *ptr)
 {
        char *str;
 
-       str = pvmalloc(strlen(ptr) + 1);
+       str = (char *)pvmalloc(strlen(ptr) + 1);
        if (str == NULL)
                return NULL;
 
diff --git a/include/copperplate/threadobj.h b/include/copperplate/threadobj.h
index 3529ca1..d7ec60a 100644
--- a/include/copperplate/threadobj.h
+++ b/include/copperplate/threadobj.h
@@ -227,7 +227,7 @@ static inline void threadobj_set_current(struct threadobj 
*thobj)
 
 static inline struct threadobj *threadobj_current(void)
 {
-       return pthread_getspecific(threadobj_tskey);
+       return (struct threadobj *)pthread_getspecific(threadobj_tskey);
 }
 
 #endif /* !HAVE_TLS */
@@ -276,7 +276,7 @@ void *__threadobj_alloc(size_t tcb_struct_size,
 
 static inline void threadobj_free(struct threadobj *thobj)
 {
-       xnfree((void *)thobj - thobj->core_offset);
+       xnfree((unsigned char *)thobj - thobj->core_offset);
 }
 
 void threadobj_init(struct threadobj *thobj,


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to