Skip to content

Commit

Permalink
Further append underscores to Modelica names
Browse files Browse the repository at this point in the history
- append undersores to initRecordMembers, see e.g.:
  Modelica.Media.Examples.R134a.R134a1

- don't append underscores to function refs, see e.g.:
  Modelica.Math.Nonlinear.Examples.quadratureLobatto3
  • Loading branch information
rfranke authored and OpenModelica-Hudson committed Feb 1, 2017
1 parent 815cea3 commit c55d310
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -5396,9 +5396,9 @@ case var as VARIABLE(__) then
let recordInit = initRecordMembers(var, &preExp, &varDecls, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation)
let &varInits += if recordInit then
<<
//initRecordMembers <%varName%>
<%preExp%>
<%recordInit%>
//initRecordMembers <%varName%>
<%preExp%>
<%recordInit%>
>>
let instDimsInit = (instDims |> exp => daeExp(exp, contextFunction, &varInits , &varDecls,simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation);separator=",")

Expand Down Expand Up @@ -5452,7 +5452,7 @@ template recordMemberInit(Var v, Text varName, Text &preExp /*BUFP*/, Text &varD
::=
match v
case TYPES_VAR(__) then
let vn = '<%varName%>.<%name%>'
let vn = '<%varName%>.<%name%>_'
let defaultValue =
match binding
case VALBOUND(valBound = val) then
Expand Down
4 changes: 2 additions & 2 deletions Compiler/Template/CodegenCppCommon.tpl
Expand Up @@ -337,8 +337,8 @@ template daeExpCrefRhs(Exp exp, Context context, Text &preExp, Text &varDecls, S
daeExpRecordCrefRhs(t, cr, context, &preExp, &varDecls, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation)
case CREF(ty = T_FUNCTION_REFERENCE_FUNC(functionType=t)) then
functionClosure(underscorePath(crefToPathIgnoreSubs(componentRef)), "", t, t, context, &extraFuncsDecl)
case CREF(componentRef = cr, ty = T_FUNCTION_REFERENCE_VAR(__)) then
crefStr(cr)
case CREF(componentRef = CREF_IDENT(ident=ident), ty = T_FUNCTION_REFERENCE_VAR(__)) then
contextFunName(ident, context)
else
daeExpCrefRhs2(exp, context, &preExp, &varDecls, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation)
end daeExpCrefRhs;
Expand Down

0 comments on commit c55d310

Please sign in to comment.