Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 70f05e5

Browse files
lochelOpenModelica-Hudson
authored andcommitted
Define vrStates iff states are available
Belonging to [master]: - #2091
1 parent aee683c commit 70f05e5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

SimulationRuntime/fmi/export/fmi2/fmu2_model_interface.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static fmi2String logCategoriesNames[] = {"logEvents", "logSingularLinearSystems
6060
logCategoriesNames[categoryIndex], message, ##__VA_ARGS__);
6161

6262
// array of value references of states
63-
#if NUMBER_OF_REALS>0
63+
#if NUMBER_OF_STATES>0
6464
fmi2ValueReference vrStates[NUMBER_OF_STATES] = STATES;
6565
fmi2ValueReference vrStatesDerivatives[NUMBER_OF_STATES] = STATESDERIVATIVES;
6666
#endif
@@ -1019,7 +1019,7 @@ fmi2Status fmi2SetContinuousStates(fmi2Component c, const fmi2Real x[], size_t n
10191019
return fmi2Error;
10201020
if (nullPointer(comp, "fmi2SetContinuousStates", "x[]", x))
10211021
return fmi2Error;
1022-
#if NUMBER_OF_REALS>0
1022+
#if NUMBER_OF_STATES>0
10231023
for (i = 0; i < nx; i++) {
10241024
fmi2ValueReference vr = vrStates[i];
10251025
FILTERED_LOG(comp, fmi2OK, LOG_FMI2_CALL, "fmi2SetContinuousStates: #r%d# = %.16g", vr, x[i])
@@ -1117,7 +1117,7 @@ fmi2Status fmi2GetContinuousStates(fmi2Component c, fmi2Real x[], size_t nx)
11171117
return fmi2Error;
11181118
if (nullPointer(comp, "fmi2GetContinuousStates", "states[]", x))
11191119
return fmi2Error;
1120-
#if NUMBER_OF_REALS>0
1120+
#if NUMBER_OF_STATES>0
11211121
for (i = 0; i < nx; i++) {
11221122
fmi2ValueReference vr = vrStates[i];
11231123
x[i] = getReal(comp, vr); // to be implemented by the includer of this file

0 commit comments

Comments
 (0)