From 160b15cd6f6dd060acd40363a44fb9f0b1ad057a Mon Sep 17 00:00:00 2001 From: phannebohm Date: Wed, 7 Aug 2024 12:57:06 +0200 Subject: [PATCH] Move declaration out of switch (#120) Some C compilers don't like declarations behind labels and `case`s are labels :) --- Project.toml | 2 +- src/templates/special_interface.tpl.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index d4b854a..5dc1b44 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "NonLinearSystemNeuralNetworkFMU" uuid = "cef0780c-fc83-4b94-9c0c-d964a51a3c65" authors = ["AnHeuermann "] -version = "0.5.6" +version = "0.5.7" [deps] BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0" diff --git a/src/templates/special_interface.tpl.c b/src/templates/special_interface.tpl.c index 26daa01..4750b0d 100644 --- a/src/templates/special_interface.tpl.c +++ b/src/templates/special_interface.tpl.c @@ -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);