Skip to content

Commit

Permalink
- Changed argument order of Util.listMap01 to conform to the map(list…
Browse files Browse the repository at this point in the history
…, function,

  extra args) convention.


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@9811 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
perost committed Sep 14, 2011
1 parent f4cc8a7 commit f61b7df
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendDAEOptimize.mo
Expand Up @@ -3142,7 +3142,7 @@ algorithm
tmp := listArray(rs);
tmp2 := Util.listMap(Util.listFill(tmp,size),arrayCopy);
valarr := listArray(tmp2);
Util.listMap01(jac,valarr,evaluateConstantJacobian2);
Util.listMap01(jac,evaluateConstantJacobian2,valarr);
tmp2 := arrayList(valarr);
vals := Util.listMap(tmp2,arrayList);
end evaluateConstantJacobian;
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/InnerOuter.mo
Expand Up @@ -1028,7 +1028,7 @@ protected function checkMissingInnerDecl1
input DAE.DAElist innerVarsDae;
input DAE.DAElist outerVarsDae;
algorithm
Util.listMap01(DAEUtil.daeElements(outerVarsDae),DAEUtil.daeElements(innerVarsDae),checkMissingInnerDecl2);
Util.listMap01(DAEUtil.daeElements(outerVarsDae),checkMissingInnerDecl2,DAEUtil.daeElements(innerVarsDae));
end checkMissingInnerDecl1;

protected function checkMissingInnerDecl2
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Inst.mo
Expand Up @@ -11497,7 +11497,7 @@ algorithm
invars := checkExternalDeclInputUsed(invars,decl);
invars := Util.listSelect1(invars,vars,checkVarBindingsInputUsed);
(_,invars) := DAEUtil.traverseDAE2(algs,checkExpInputUsed,invars);
Util.listMap01(invars,name,warnUnusedFunctionVar);
Util.listMap01(invars,warnUnusedFunctionVar,name);
end checkFunctionInputUsed;

protected function warnUnusedFunctionVar
Expand Down
10 changes: 5 additions & 5 deletions Compiler/FrontEnd/SCodeDependency.mo
Expand Up @@ -425,10 +425,10 @@ algorithm
annotationLst = annl, comment = cmt), _, _, _, _)
equation
Util.listMap02(el, analyseElement, inEnv, inRestriction);
Util.listMap01(nel, inEnv, analyseEquation);
Util.listMap01(iel, inEnv, analyseEquation);
Util.listMap01(nal, inEnv, analyseAlgorithm);
Util.listMap01(ial, inEnv, analyseAlgorithm);
Util.listMap01(nel, analyseEquation, inEnv);
Util.listMap01(iel, analyseEquation, inEnv);
Util.listMap01(nal, analyseAlgorithm, inEnv);
Util.listMap01(ial, analyseAlgorithm, inEnv);
analyseExternalDecl(ext_decl, inEnv, inInfo);
Util.listMap02(annl, analyseAnnotation, inEnv, inInfo);
analyseComment(cmt, inEnv, inInfo);
Expand Down Expand Up @@ -1445,7 +1445,7 @@ protected
list<SCode.Statement> stmts;
algorithm
SCode.ALGORITHM(stmts) := inAlgorithm;
Util.listMap01(stmts, inEnv, analyseStatement);
Util.listMap01(stmts, analyseStatement, inEnv);
end analyseAlgorithm;

protected function analyseStatement
Expand Down
4 changes: 2 additions & 2 deletions Compiler/FrontEnd/Types.mo
Expand Up @@ -7051,7 +7051,7 @@ algorithm
equation
verifyExpressionType2(ety1, inType);
ty = unliftArray(inType);
Util.listMap01(expl, ty, verifyExpressionType);
Util.listMap01(expl, verifyExpressionType, ty);
then
();
case (DAE.MATRIX(ty = ety1), _)
Expand All @@ -7078,7 +7078,7 @@ algorithm
();
case (DAE.TUPLE(PR = expl), _)
equation
Util.listMap01(expl, inType, verifyExpressionType);
Util.listMap01(expl, verifyExpressionType, inType);
then
();
case (DAE.CAST(ty = ety1), _)
Expand Down
30 changes: 16 additions & 14 deletions Compiler/Util/Util.mo
Expand Up @@ -2643,27 +2643,29 @@ end listMap0;
public function listMap01 "
See listMap0
"
input list<Type_a> inTypeALst;
input Type_b b;
input FuncTypeType_aTo inFuncTypeTypeATo;
input list<Type_a> inList;
input FuncType inFunc;
input Type_b inArg;

replaceable type Type_a subtypeof Any;
replaceable type Type_b subtypeof Any;
partial function FuncTypeType_aTo
input Type_a inTypeA;
input Type_b b;
end FuncTypeType_aTo;

partial function FuncType
input Type_a inElement;
input Type_b inArg;
end FuncType;
algorithm
_:=
match (inTypeALst,b,inFuncTypeTypeATo)
match (inList, inFunc, inArg)
local
Type_a f;
list<Type_a> r;
FuncTypeType_aTo fn;
Type_a e;
list<Type_a> rest_e;

case ({},_,_) then ();
case ((f :: r),b,fn)
case ((e :: rest_e), _, _)
equation
fn(f,b);
listMap01(r, b,fn);
inFunc(e, inArg);
listMap01(rest_e, inFunc, inArg);
then
();
end match;
Expand Down

0 comments on commit f61b7df

Please sign in to comment.