Selaa lähdekoodia

Merge pull request #247 from Yakindu/issue_245

intptr_t should be mapped in sc_types #245
Andreas Mülder 9 vuotta sitten
vanhempi
commit
f4362afba5

+ 2 - 2
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/StatemachineC.xtend

@@ -183,8 +183,8 @@ class StatemachineC {
 	def raiseTimeEventFunction(ExecutionFlow it) '''
 		«IF timed»
 			void «raiseTimeEventFctID»(const «type»* handle, sc_eventid evid) {
-				if ( ((intptr_t)evid) >= ((intptr_t)&(«scHandle»->timeEvents))
-					&&  ((intptr_t)evid) < ((intptr_t)&(«scHandle»->timeEvents)) + sizeof(«timeEventScope.type»)) {
+				if ( ((sc_intptr_t)evid) >= ((sc_intptr_t)&(«scHandle»->timeEvents))
+					&&  ((sc_intptr_t)evid) < ((sc_intptr_t)&(«scHandle»->timeEvents)) + sizeof(«timeEventScope.type»)) {
 					*(sc_boolean*)evid = bool_true;
 				}		
 			}

+ 2 - 0
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/Types.xtend

@@ -72,6 +72,8 @@ class Types {
 		
 		typedef void*			sc_eventid;
 		
+		typedef intptr_t		sc_intptr_t;
+		
 		#ifdef __cplusplus
 		}
 		#endif