Skip to content

Commit

Permalink
fix in cpp template for algorithm array assign
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18794 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
niklwors committed Jan 27, 2014
1 parent a4e5e4b commit d44efef
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -5041,19 +5041,19 @@ case eqn as SES_ARRAY_CALL_ASSIGN(__) then
//let &preExp += 'cast_integer_array_to_real(&<%expPart%>, &<%tvar%>);<%\n%>'
<<
<%preExp%>
<%cref(eqn.componentRef)%>=<%expPart%>;
<%cref(eqn.componentRef)%>=<%expPart%>;/*test1*/
>>
case "int" then
let tvar = tempDecl("integer_array", &varDecls /*BUFD*/)
//let &preExp += 'cast_integer_array_to_real(&<%expPart%>, &<%tvar%>);<%\n%>'
<<
<%preExp%>
<%cref(eqn.componentRef)%>=<%expPart%>;
<%cref(eqn.componentRef)%>=<%expPart%>;/*test2*/
>>
case "double" then
<<
<%preExp%>
<%cref(eqn.componentRef)%>=<%expPart%>;
<%cref(eqn.componentRef)%>=<%expPart%>;/*test3*/
>>

end equationArrayCallAssign;
Expand Down Expand Up @@ -5143,7 +5143,7 @@ match ty
//let &preExp += 'cast_integer_array_to_real(&<%expPart%>, &<%tvar%>);<%\n%>'
<<
<%preExp%>
copy_integer_array_data_mem(&<%expPart%>, &<%cref(left)%>);<%inlineArray(context,tvar,left)%>
copy_integer_array_data_mem(&<%expPart%>, &<%cref(left)%>);<%inlineArray(context,tvar,left)%>/*test2*/
>>
case "real" then
<<
Expand Down Expand Up @@ -7103,14 +7103,14 @@ case CREF(ty= t as DAE.T_ARRAY(__)) then
assign_array(<%lhsStr%>,<%rhsStr%> );
>>
else
'<%lhsStr%> = <%rhsStr%>;'
'<%lhsStr%> = <%rhsStr%>;'/*test4*/
case UNARY(exp = e as CREF(ty= t as DAE.T_ARRAY(__))) then
let lhsStr = scalarLhsCref(e, context, &preExp /*BUFC*/, &varDecls /*BUFD*/,simCode)
match context
case SIMULATION_CONTEXT(__) then
<<
usub_<%expTypeShort(t)%>_array(&<%rhsStr%>);<%\n%>
copy_<%expTypeShort(t)%>_array_data_mem(&<%rhsStr%>, &<%lhsStr%>);
copy_<%expTypeShort(t)%>_array_data_mem(&<%rhsStr%>, &<%lhsStr%>);/*test1*/
>>
else
'<%lhsStr%> = -<%rhsStr%>;'
Expand Down Expand Up @@ -8673,7 +8673,7 @@ case STMT_ASSIGN_ARR(exp=e, componentRef=cr, type_=t) then
else*/
<<
<%preExp%>
<%arrayCrefStr(cr)%> = <%expPart%>;
assign_array(<%contextArrayCref(cr, context)%>,<%expPart%>);
>>
end algStmtAssignArr;

Expand Down

0 comments on commit d44efef

Please sign in to comment.