Skip to content

Commit

Permalink
fix for start index for array creation in cpp template
Browse files Browse the repository at this point in the history
  • Loading branch information
niklwors committed Sep 21, 2015
1 parent a59dc08 commit f49a665
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Compiler/Template/CodegenCppCommon.tpl
Expand Up @@ -1440,8 +1440,6 @@ case ARRAY(array=_::_, ty = arraytype) then
else
let &varDecls += '<%ArrayType%> <%arrayVar%>;'
daeExpArray3(array, arrayVar, ArrayType, context, preExp, varDecls, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation)

let &preExp += '<%arrayassign%>'
arrayVar
case ARRAY(__) then
let arrayTypeStr = expTypeArray(ty)
Expand All @@ -1461,7 +1459,7 @@ template daeExpArray3(list<Exp> array, String arrayVar, String ArrayType, Conte
Text &varDecls, SimCode simCode, Text& extraFuncs, Text& extraFuncsDecl, Text extraFuncsNamespace, Text stateDerVectorName /*=__zDot*/, Boolean useFlatArrayNotation)
"Generates code for an array expression."
::=
let arraycreate = (array |> e hasindex i0 =>
let arraycreate = (array |> e hasindex i0 fromindex 1 =>
let subArraycall = daeExp(e, context, &preExp, &varDecls, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation)
<<
<%arrayVar%>.append(<%i0%>, <%subArraycall%>);
Expand Down

0 comments on commit f49a665

Please sign in to comment.