Skip to content

Commit

Permalink
fix some abnormalities from static code check
Browse files Browse the repository at this point in the history
ticket:3954
  • Loading branch information
hkiel committed Jun 8, 2016
1 parent bb33335 commit f5d4c26
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 deletions.
9 changes: 4 additions & 5 deletions Compiler/BackEnd/BackendDAEOptimize.mo
Expand Up @@ -752,7 +752,7 @@ algorithm
true = intEq(0,numrepl);
then (globalKnownVars,repl);

case(numrepl,globalKnownVars,repl)
case(_,globalKnownVars,repl)
equation
(globalKnownVars1, (repl1,numrepl)) = BackendVariable.traverseBackendDAEVarsWithUpdate(globalKnownVars,replaceFinalVarTraverser,(repl,0));
(globalKnownVars2, repl2) = replaceFinalVars(numrepl,globalKnownVars1,repl1);
Expand Down Expand Up @@ -877,7 +877,7 @@ algorithm
case syst as BackendDAE.EQSYSTEM(orderedVars=vars, orderedEqs=eqns)
algorithm
lsteqns := BackendEquation.equationList(eqns);
(lsteqns, b) := BackendVarTransform.replaceEquations(BackendEquation.equationList(eqns), repl, NONE());
(lsteqns, b) := BackendVarTransform.replaceEquations(lsteqns, repl, NONE());
if b then
syst.orderedEqs := BackendEquation.listEquation(lsteqns);
syst := BackendDAEUtil.clearEqSyst(syst);
Expand Down Expand Up @@ -1212,7 +1212,7 @@ algorithm
local
DAE.Exp exp;
BackendDAE.Variables vars,vars1;
case (exp,(vars,vars1))
case (exp,(vars,_))
equation
(_,(_,vars1)) = Expression.traverseExpBottomUp(exp,checkUnusedParameterExp,inTpl);
then (exp,(vars,vars1));
Expand Down Expand Up @@ -4268,7 +4268,6 @@ algorithm
end match;

for syst in inDAE.eqs loop
indRemove := {};
BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns) := syst;
BackendDAE.EQUATION_ARRAY(numberOfElement = n) := eqns;
update := false;
Expand Down Expand Up @@ -4435,7 +4434,7 @@ function simplifyComplexFunction2
input DAE.Exp e1;
output list<DAE.Exp> out_lst_e1 = {};
protected
list<DAE.Exp> lst_e = {};
list<DAE.Exp> lst_e;
algorithm
try
if Expression.isArray(e1) or Expression.isArrayType(Expression.typeof(e1)) then
Expand Down
3 changes: 0 additions & 3 deletions Compiler/BackEnd/BackendDAEUtil.mo
Expand Up @@ -3510,10 +3510,7 @@ public function getIncidenceMatrix "this function returns the incidence matrix,
output BackendDAE.EqSystem outEqSystem;
output BackendDAE.IncidenceMatrix outM;
output BackendDAE.IncidenceMatrix outMT;
protected
BackendDAE.EquationArray eq;
algorithm
BackendDAE.EQSYSTEM(orderedEqs=eq) := inEqSystem;
(outM, outMT) := incidenceMatrix(inEqSystem, inIndxType, functionTree);
outEqSystem := BackendDAEUtil.setEqSystMatrices(inEqSystem, SOME(outM), SOME(outMT));
end getIncidenceMatrix;
Expand Down
3 changes: 1 addition & 2 deletions Compiler/BackEnd/BackendInline.mo
Expand Up @@ -1147,12 +1147,11 @@ protected
DAE.Type tp;
list<tuple<DAE.ComponentRef, DAE.Exp>> argmap;
HashTableCG.HashTable checkcr;
list<DAE.ComponentRef> tmpOutput = {};
DAE.ComponentRef cr;
BackendDAE.Var var;
BackendDAE.IncidenceMatrix m;
array<Integer> ass1, ass2;
list<BackendDAE.Equation> eqlst = {};
list<BackendDAE.Equation> eqlst;
algorithm
if Flags.isSet(Flags.DUMPBACKENDINLINE_VERBOSE) then
print("\ncreate EqnSys from function: "+funcname);
Expand Down
2 changes: 0 additions & 2 deletions Compiler/BackEnd/BackendVarTransform.mo
Expand Up @@ -256,8 +256,6 @@ public function performReplacementsEqSystem
input VariableReplacements inRepl;
output BackendDAE.EqSystem outEqs = inEqs;
protected
list<BackendDAE.Equation> eqnslst = {};
Boolean b1 = false;
BackendDAE.EquationArray eqArr;
algorithm
eqArr := inEqs.orderedEqs;
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/ResolveLoops.mo
Expand Up @@ -2552,7 +2552,7 @@ algorithm
end qrDecomposition2;

protected function qrDecomposition3
"for debuge"
"for debug"
input array<DAE.Exp> A;
input Integer sizeA;
input Boolean isMat;
Expand Down
4 changes: 2 additions & 2 deletions Compiler/FrontEnd/Absyn.mo
Expand Up @@ -3582,7 +3582,7 @@ algorithm
l1 = getCrefFromExp(e1,includeSubs,includeFunctions);
l2 = getCrefFromExp(e2,includeSubs,includeFunctions);
l2 = listAppend(l1, l2);
l2 = getCrefFromExp(e3,includeSubs,includeFunctions);
l1 = getCrefFromExp(e3,includeSubs,includeFunctions);
res = listAppend(l1, l2);
then
res;
Expand Down Expand Up @@ -5630,7 +5630,7 @@ algorithm
// make sure we don't have not initial()
case (UNARY(NOT(), _) , _) then (inExp,inBool);
// we have initial
case (e , b)
case (e , _)
equation
b = isInitial(e);
then (e, b);
Expand Down

0 comments on commit f5d4c26

Please sign in to comment.