Skip to content

Commit

Permalink
Move declaration out of switch (#120)
Browse files Browse the repository at this point in the history
Some C compilers don't like declarations behind labels and `case`s are
labels :)
  • Loading branch information
phannebohm authored Aug 7, 2024
1 parent 82eb027 commit 160b15c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "NonLinearSystemNeuralNetworkFMU"
uuid = "cef0780c-fc83-4b94-9c0c-d964a51a3c65"
authors = ["AnHeuermann <[email protected]>"]
version = "0.5.6"
version = "0.5.7"

[deps]
BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0"
Expand Down
6 changes: 4 additions & 2 deletions src/templates/special_interface.tpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,14 @@ fmi2Status myfmi2EvaluateJacobian(fmi2Component c, const size_t sysNumber, doubl
DATA* data = comp->fmuData;
threadData_t *threadData = comp->threadData;
NONLINEAR_SYSTEM_DATA* nlsSystem = &(data->simulationInfo->nonlinearSystemData[sysNumber]);
DATA_HOMOTOPY* solverData;
int status;

switch(nlsSystem->nlsMethod)
{
case NLS_HOMOTOPY:
DATA_HOMOTOPY* solverData = (DATA_HOMOTOPY*) nlsSystem->solverData;
int status = getAnalyticalJacobianHomotopy(solverData, jac);
solverData = (DATA_HOMOTOPY*) nlsSystem->solverData;
status = getAnalyticalJacobianHomotopy(solverData, jac);
break;
default:
printf("Unknown NLS method %d in myfmi2GetJac\n", (int)nlsSystem->nlsMethod);
Expand Down

0 comments on commit 160b15c

Please sign in to comment.