فهرست منبع

Change maxOrthogonalStates, maxHistoryStates consistently to sc_ushort type (#1845)

Rene Beckmann 7 سال پیش
والد
کامیت
acbf90ffeb

+ 3 - 3
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/StatemachineHeader.xtend

@@ -255,10 +255,10 @@ class StatemachineHeader extends org.yakindu.sct.generator.c.StatemachineHeader
 
 	override statemachineTypeDecl(ExecutionFlow it) '''
 		//! the maximum number of orthogonal states defines the dimension of the state configuration vector.
-		static const sc_integer «orthogonalStatesConst» = «stateVector.size»;
+		static const sc_ushort «orthogonalStatesConst» = «stateVector.size»;
 		«IF hasHistory»
-			//! dimension of the state configuration vector for history states
-		static const sc_integer «historyStatesConst» = «historyVector.size»;«ENDIF»
+		//! dimension of the state configuration vector for history states
+		static const sc_ushort «historyStatesConst» = «historyVector.size»;«ENDIF»
 		
 		«IF timed»
 			«timerInterface»* «timerInstance»;

+ 3 - 3
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/StatemachineImplementation.xtend

@@ -137,7 +137,7 @@ class StatemachineImplementation implements IContentTemplate {
 	protected def CharSequence constructorBody(ExecutionFlow it)
 		'''
 		«IF hasHistory»
-			for (int i = 0; i < «historyStatesConst»; ++i)
+			for (sc_ushort i = 0; i < «historyStatesConst»; ++i)
 				historyVector[i] = «null_state»;
 				
 		«ENDIF»
@@ -157,11 +157,11 @@ class StatemachineImplementation implements IContentTemplate {
 			sc_errorCode errorCode = 0;
 			
 			«unimplementedOCBErrors»«ENDIF»
-			for (int i = 0; i < «orthogonalStatesConst»; ++i)
+			for (sc_ushort i = 0; i < «orthogonalStatesConst»; ++i)
 				stateConfVector[i] = «null_state»;
 			
 			«IF hasHistory»
-			for (int i = 0; i < «historyStatesConst»; ++i)
+			for (sc_ushort i = 0; i < «historyStatesConst»; ++i)
 				historyVector[i] = «null_state»;
 			
 			«ENDIF»