Skip to content

Commit

Permalink
- fix call of modelica_real_to_modelica_string() in C runtime
Browse files Browse the repository at this point in the history
-> makes ModelicaTest.Blocks.Continuous_InitialOutput compile

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@15993 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Henning Kiel committed May 7, 2013
1 parent 7d2a529 commit 56ff5f1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Compiler/Template/CodegenC.tpl
Expand Up @@ -1100,7 +1100,7 @@ template functionNonLinearResiduals(list<SimEqSystem> allEquations)
<%body_initializeStaticNLSData%>
}

void residualFunc<%index%>(void* dataIn, double* xloc, double* res, int* iflag)
void residualFunc<%index%>(void* dataIn, double* xloc, double* res, integer* iflag)
{
DATA* data = (DATA*) dataIn;
state mem_state;
Expand Down Expand Up @@ -7397,8 +7397,14 @@ template daeExpCall(Exp call, Context context, Text &preExp /*BUFP*/, Text &varD
let minlenExp = daeExp(minlen, context, &preExp /*BUFC*/, &varDecls /*BUFD*/)
let leftjustExp = daeExp(leftjust, context, &preExp /*BUFC*/, &varDecls /*BUFD*/)
let typeStr = expTypeFromExpModelica(s)
let &preExp += '<%tvar%> = <%typeStr%>_to_modelica_string(<%sExp%>, <%minlenExp%>, <%leftjustExp%>);<%\n%>'
'<%tvar%>'
match typeStr
case "modelica_real" then
let &preExp += '<%tvar%> = <%typeStr%>_to_modelica_string(<%sExp%>, <%minlenExp%>, <%leftjustExp%>, 6);<%\n%>'
'<%tvar%>'
else
let &preExp += '<%tvar%> = <%typeStr%>_to_modelica_string(<%sExp%>, <%minlenExp%>, <%leftjustExp%>);<%\n%>'
'<%tvar%>'
end match

case CALL(path=IDENT(name="String"), expLst={s, minlen, leftjust, signdig}) then
let tvar = tempDecl("modelica_string", &varDecls /*BUFD*/)
Expand Down

0 comments on commit 56ff5f1

Please sign in to comment.