Skip to content

Commit

Permalink
fix in cpp template for external objects
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@22864 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Julian Ophey authored and Julian Ophey committed Oct 22, 2014
1 parent 1144193 commit 1ee2d85
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -2858,7 +2858,7 @@ case efn as EXTERNAL_FUNCTION(extArgs=extArgs) then
void /*<%retType%>*/ Functions::<%fname%>(<%funArgs |> var => funArgDefinition(var,simCode,useFlatArrayNotation) ;separator=", "%><%if funArgs then if outVars then "," else ""%> <%if retVar then '<%retType%>& output' %>)/*function2*/
{
/* functionBodyExternalFunction: varDecls */
<%varDecls%>
<%varDecls%>
/* functionBodyExternalFunction: preExp */
<%preExp%>
<%inputAssign%>
Expand Down Expand Up @@ -3057,7 +3057,7 @@ case SIMEXTARG(outputIndex=oi, isArray=false, type_=ty, cref=c) then
>>
else
<<
_<%fnName%> = <%cr%>;
_<%fnName%> = <%cr%> ;
>>
end match
end extFunCallVarcopy;
Expand All @@ -3077,7 +3077,7 @@ case SIMEXTARG(outputIndex=oi, isArray=false, type_=ty, cref=c) then
let assginEnd = ')'

<<
<%assginBegin%>_<%fnName%>.data<%assginEnd%> = <%cr%>;
<%assginBegin%>_<%fnName%>.data<%assginEnd%> = <%cr%> ;
>>
end extFunCallVarcopyTuple;

Expand Down Expand Up @@ -3144,10 +3144,11 @@ template extCBoolCast(SimExtArg extArg, Text &preExp, Text &varDecls /*BUFP*/, T
<%tmp%>.getData()
<%outputAssignTest(c, contextFunction, tmp, &outputAssign)%>
>>
else
'(<%extType2(t,iI,true)%>)<%name%>.getData() '
end match

else
'(<%extType2(t,iI,true)%>)<%name%>.getData() '

end extCBoolCast;

template inputAssignTest(DAE.ComponentRef cref, Context context, Text tmp, Text &inputAssign /*BUFD*/)
Expand Down Expand Up @@ -3184,15 +3185,15 @@ template extFunCallVardecl(SimExtArg arg, Text &varDecls /*BUFP*/)
match ty case T_STRING(__) then
""
else
let &varDecls += '<%extType2(ty,true,false)%> <%extVarName2(c)%>;<%\n%>'
let &varDecls += '<%extType2(ty,true,false)%> <%extVarName2(c)%>;<%\n%> '
<<
<%extVarName2(c)%> = (<%extType2(ty,true,false)%>)<%contextCref2(c,contextFunction)%>;
>>
case SIMEXTARG(outputIndex=oi, isArray=false, type_=ty, cref=c) then
match oi case 0 then
""
else
let &varDecls += '<%extType2(ty,true,false)%> <%extVarName2(c)%>;<%\n%>'
let &varDecls += '<%extType2(ty,true,false)%> <%extVarName2(c)%>;<%\n%> '
""
end extFunCallVardecl;

Expand Down

0 comments on commit 1ee2d85

Please sign in to comment.