Skip to content

Commit

Permalink
fix for function signature with no arguments in cpp template
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@21875 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
niklwors committed Aug 14, 2014
1 parent 7f9a891 commit f697953
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -2101,7 +2101,7 @@ match fn
'<%varType1(var,simCode)%> <%crefStr(name)%>/*testfunc*/'
;separator=", ")
<<
void /*RecordTypetest*/ <%fname%>(<%funArgsStr%>,<%fname%>Type &output );
void /*RecordTypetest*/ <%fname%>(<%funArgsStr%><%if funArgs then "," else ""%><%fname%>Type &output );
>>
end functionHeaderRecordConstruct;
Expand Down Expand Up @@ -2201,7 +2201,7 @@ case RECORD_CONSTRUCTOR(__) then


<<
void /*<%retType%>*/ Functions::<%fname%>(<%funArgs |> var as VARIABLE(__) => '<%varType1(var,simCode)%> <%crefStr(name)%>' ;separator=", "%>,<%retType%>& output )
void /*<%retType%>*/ Functions::<%fname%>(<%funArgs |> var as VARIABLE(__) => '<%varType1(var,simCode)%> <%crefStr(name)%>' ;separator=", "%><%if funArgs then "," else ""%><%retType%>& output )
{
<%funArgs |> VARIABLE(__) => '(output.<%crefStr(name)%>) = (<%crefStr(name)%>);' ;separator="\n"%>
//output = <%structVar%>;
Expand Down Expand Up @@ -2236,13 +2236,13 @@ case FUNCTION(outVars=_) then
let fname = underscorePath(name)
<<
/* functionHeaderRegularFunction2 */
void /*<%fname%>RetType*/ <%fname%>(<%functionArguments |> var => funArgDefinition(var,simCode,useFlatArrayNotation) ;separator=", "%>, <%fname%>RetType& output);
void /*<%fname%>RetType*/ <%fname%>(<%functionArguments |> var => funArgDefinition(var,simCode,useFlatArrayNotation) ;separator=", "%><%if functionArguments then "," else ""%> <%fname%>RetType& output);
>>
case EXTERNAL_FUNCTION(outVars=var::_) then
let fname = underscorePath(name)
<<
/* functionHeaderRegularFunction2 */
void /*<%fname%>RetType*/ <%fname%>(<%funArgs |> var => funArgDefinition(var,simCode,useFlatArrayNotation) ;separator=", "%>, <%fname%>RetType output);
void /*<%fname%>RetType*/ <%fname%>(<%funArgs |> var => funArgDefinition(var,simCode,useFlatArrayNotation) ;separator=", "%><%if funArgs then "," else ""%> <%fname%>RetType output);
>>
case EXTERNAL_FUNCTION(outVars={}) then
let fname = underscorePath(name)
Expand Down Expand Up @@ -2314,7 +2314,7 @@ case FUNCTION(__) then
//let boxedFn = if acceptMetaModelicaGrammar() then functionBodyBoxed(fn)
<<
//if outvars missing
void /*<%retType%>*/ Functions::<%fname%>(<%functionArguments |> var => funArgDefinition(var,simCode,useFlatArrayNotation) ;separator=", "%> <%if outVars then ', <%retType%>& output' %> )
void /*<%retType%>*/ Functions::<%fname%>(<%functionArguments |> var => funArgDefinition(var,simCode,useFlatArrayNotation) ;separator=", "%><%if functionArguments then if outVars then "," else ""%><%if outVars then '<%retType%>& output' %> )
{
//functionBodyRegularFunction
<%varDecls%>
Expand Down Expand Up @@ -2370,7 +2370,7 @@ case efn as EXTERNAL_FUNCTION(__) then
)

let fnBody = <<
void /*<%retType%>*/ Functions::<%fname%>(<%funArgs |> var => funArgDefinition(var,simCode,useFlatArrayNotation) ;separator=", "%> <%if retVar then ",<%retType%>& output"%>)/*function2*/
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%>
Expand Down

0 comments on commit f697953

Please sign in to comment.