Skip to content

Commit

Permalink
[Janitor mode] Fix whitespace
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23053 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
OpenModelica-Hudson committed Oct 29, 2014
1 parent 2a8f860 commit ddb11c9
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -2915,18 +2915,18 @@ case efn as EXTERNAL_FUNCTION(extArgs=extArgs) then
let _ = match outVars

case {var} then "1"

else
//(List.restOrEmpty(outVars) |> var hasindex i1 fromindex 1 => varOutputTuple(fn, var,i1, &varDecls1, &outVarInits1, &outVarCopy1, &outVarAssign1, simCode, useFlatArrayNotation)
(outVars |> var hasindex i1 fromindex 0 => varOutputTuple(fn, var,i1, &varDecls1, &outVarInits1, &outVarCopy1, &outVarAssign1, simCode, useFlatArrayNotation)
(outVars |> var hasindex i1 fromindex 0 => varOutputTuple(fn, var,i1, &varDecls1, &outVarInits1, &outVarCopy1, &outVarAssign1, simCode, useFlatArrayNotation)
;separator="\n"; empty /* increase the counter! */
)
end match
let functionBodyExternalFunctionreturn = match outVarAssign1
case "" then << <%if retVar then 'output = <%retVar%>;' %> >>
else outVarAssign1


let fnBody = <<
void /*<%retType%>*/ Functions::<%fname%>(<%funArgs |> var => funArgDefinition(var,simCode,useFlatArrayNotation) ;separator=", "%><%if funArgs then if outVars then "," else ""%> <%if retVar then '<%retType%>& output' %>)/*function2*/
{
Expand All @@ -2935,10 +2935,10 @@ case efn as EXTERNAL_FUNCTION(extArgs=extArgs) then
/* functionBodyExternalFunction: preExp */
<%preExp%>
<%inputAssign%>
/* functionBodyExternalFunction: outputAlloc */
<%outVarInits%>
<%outputAllocate%>
<%outputAllocate%>
/* functionBodyExternalFunction: callPart */
<%callPart%>
<%outputAssign%>
Expand Down Expand Up @@ -3118,18 +3118,18 @@ template extFunCallVarcopy(SimExtArg arg, String fnName,Boolean useTuple, SimCod
match arg
case SIMEXTARG(outputIndex=oi, isArray=false, type_=ty, cref=c) then
match oi case 0 then
""
""
else
let cr = '<%extVarName2(c)%>'
match useTuple
case true then
let assginBegin = 'boost::get<<%intAdd(-1,oi)%>>('
let assginEnd = ')'


/* <%assginBegin%> output.data<%assginEnd%> = <%cr%>;*/
<<
<%contextCref(c,contextFunction,simCode,useFlatArrayNotation)%> =(<%expTypeModelica(ty)%>) <%cr%>;
<%contextCref(c,contextFunction,simCode,useFlatArrayNotation)%> =(<%expTypeModelica(ty)%>) <%cr%>;
>>
else
<<
Expand All @@ -3156,7 +3156,7 @@ case SIMEXTARG(outputIndex=oi, isArray=false, type_=ty, cref=c) then
<<
<%assginBegin%>_<%fnName%>.data<%assginEnd%> = <%cr%> ;
>>

end extFunCallVarcopyTuple;

template expTypeModelica(DAE.Type ty)
Expand Down Expand Up @@ -3206,30 +3206,30 @@ template extCBoolCast(SimExtArg extArg, Text &preExp, Text &varDecls /*BUFP*/, T
let name = contextCref2(c,contextFunction)
match type_
case T_ARRAY(__)then
let dimStr = listLength(dims)
let dimStr = listLength(dims)
let dimsStr = checkDimension(dims)

match ty
case T_BOOL(__) then
let tmp = match dimsStr
case "" then tempDecl('DynArrayDim<%listLength(dims)%><int>', &varDecls /*BUFD*/)

case "" then tempDecl('DynArrayDim<%listLength(dims)%><int>', &varDecls /*BUFD*/)
else tempDecl('StatArrayDim<%dimStr%><int,<%dimsStr%> > ', &varDecls /*BUFD*/)
end match
if(iI)
then
let _ = inputAssignTest(c, contextFunction, tmp, &inputAssign)
<<
<<
<%tmp%>.getData()/*TestAusgabe1*/
>>
else
let _ = outputAssignTest(c, contextFunction, tmp, &outputAssign)
let &outputAllocate += '<%tmp%>.setDims(<%name%>.getDims());'
<<
let &outputAllocate += '<%tmp%>.setDims(<%name%>.getDims());'
<<
<%tmp%>.getData()/*TestAusgabe2*/
>>
>>


else
'(<%extType2(t,iI,true)%>)<%name%>.getData() '
end match
Expand All @@ -3242,7 +3242,7 @@ template inputAssignTest(DAE.ComponentRef cref, Context context, Text tmp, Text
::=
let &inputAssign += 'convertBoolToInt(<%contextCref2(cref,context)%>, <%tmp%>); '
""

end inputAssignTest;

template outputAssignTest(DAE.ComponentRef cref, Context context, Text tmp, Text &outputAssign /*BUFD*/)
Expand Down Expand Up @@ -4866,9 +4866,9 @@ case SIMCODE(modelInfo = MODELINFO(__)) then
StatArrayDim2<double,<%size%>,<%size%>,true>* __A; //dense
//b vector
StatArrayDim1<double,<%size%> > __b;
>>
>>
%>
sparse_inserter *__Asparse; //sparse
Expand Down

0 comments on commit ddb11c9

Please sign in to comment.