Some fixes for C++
authoretisserant
Tue, 07 Aug 2007 17:18:03 +0200
changeset 251 cab66ef3e68e
parent 250 39e22f84ce6e
child 252 b0dd37421d28
Some fixes for C++
include/data.h
include/unix/canfestival.h
src/dcf.c
--- a/include/data.h	Mon Aug 06 17:59:06 2007 +0200
+++ b/include/data.h	Tue Aug 07 17:18:03 2007 +0200
@@ -20,10 +20,13 @@
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-
 #ifndef __data_h__
 #define __data_h__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* declaration of CO_Data type let us include all necessary headers
  struct struct_CO_Data can then be defined later
  */
@@ -174,6 +177,10 @@
 	1		/*dcf_count_targets*/\
 }
 
+#ifdef __cplusplus
+};
+#endif
+
 #endif /* __data_h__ */
 
 
--- a/include/unix/canfestival.h	Mon Aug 06 17:59:06 2007 +0200
+++ b/include/unix/canfestival.h	Tue Aug 07 17:18:03 2007 +0200
@@ -1,6 +1,10 @@
 #ifndef UNIX_H_
 #define UNIX_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "timerscfg.h"
 #include "can_driver.h"
 #include "data.h"
@@ -19,4 +23,8 @@
 CAN_PORT canOpen(s_BOARD *board, CO_Data * d);
 int canClose(CO_Data * d);
 
+#ifdef __cplusplus
+};
+#endif
+
 #endif /*UNIX_H_*/
--- a/src/dcf.c	Mon Aug 06 17:59:06 2007 +0200
+++ b/src/dcf.c	Tue Aug 07 17:18:03 2007 +0200
@@ -109,7 +109,7 @@
       {
         /* pointer to the DCF string for NodeID */
         target_Index = UNS16_LE(*((UNS16*)(d->dcf_cursor))); d->dcf_cursor += 2;
-        target_Subindex = *((UNS8*)(((UNS8*)d->dcf_cursor)++));
+        target_Subindex = *((UNS8*)((UNS8*)d->dcf_cursor++));
         target_Size = UNS32_LE(*((UNS32*)(d->dcf_cursor))); d->dcf_cursor += 4;
 
         /* printf("Master : ConfigureSlaveNode %2.2x (Concise