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

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

include/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 |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/copperplate/heapobj.h b/include/copperplate/heapobj.h
index 1f52555..38deb89 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 0bf6903..8a8942d 100644
--- a/include/copperplate/threadobj.h
+++ b/include/copperplate/threadobj.h
@@ -282,7 +282,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