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@20909 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
OpenModelica-Hudson committed May 30, 2014
1 parent 6e0d673 commit 86dc68a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions Compiler/BackEnd/SimCodeUtil.mo
Expand Up @@ -7599,8 +7599,8 @@ algorithm
end match;
end sortSimvars;

public function simVarCompareByCrefSubsAtEndlLexical
"mahge:
public function simVarCompareByCrefSubsAtEndlLexical
"mahge:
Compare two simvars by their name. i.e. component ref.
we use it to make sure elements of a vectorized array stay contagious
sto each other in the correct offest/order.
Expand All @@ -7611,7 +7611,7 @@ public function simVarCompareByCrefSubsAtEndlLexical
output Boolean outBool;
protected
DAE.ComponentRef cr1;
DAE.ComponentRef cr2;
DAE.ComponentRef cr2;
algorithm
cr1 := varName(var1);
cr2 := varName(var2);
Expand Down
42 changes: 21 additions & 21 deletions Compiler/FrontEnd/ComponentReference.mo
Expand Up @@ -764,27 +764,27 @@ end crefSortFunc;

public function crefLexicalGreaterSubsAtEnd
"mahge:
Compares two crefs lexically. Subscripts are treated as if they are
they are at the end of the whole component reference.
e.g. r[1].i is greater than r[2].a.
Compares two crefs lexically. Subscripts are treated as if they are
they are at the end of the whole component reference.
e.g. r[1].i is greater than r[2].a.
returns true if the first cref is greater than the second"
input DAE.ComponentRef cr1;
input DAE.ComponentRef cr2;
output Boolean isGreater;
algorithm
isGreater := crefLexicalCompareubsAtEnd(cr1,cr2) > 0;
isGreater := crefLexicalCompareubsAtEnd(cr1,cr2) > 0;
end crefLexicalGreaterSubsAtEnd;

public function crefLexicalCompareubsAtEnd
"mahge:
Compares two crefs lexically. Subscripts are treated as if they are
they are at the end of the whole component reference.
e.g. r[1].i is greater than r[2].a.
public function crefLexicalCompareubsAtEnd
"mahge:
Compares two crefs lexically. Subscripts are treated as if they are
they are at the end of the whole component reference.
e.g. r[1].i is greater than r[2].a.
returns value is same as C strcmp. 0 if equal, 1 if first is greater, -1 otherwise"
input DAE.ComponentRef cr1;
input DAE.ComponentRef cr2;
output Integer comapred;
protected
protected
String cr1_nosub_str;
String cr2_nosub_str;
list<Integer> subs1;
Expand All @@ -800,7 +800,7 @@ algorithm
end crefLexicalCompareubsAtEnd;

protected function crefLexicalCompareubsAtEnd2
"mahge:
"mahge:
Helper function for crefLexicalCompareubsAtEnd
compares subs. However only if the crefs with out subs are equal.
(i.e. identsCompared is 0)
Expand All @@ -814,44 +814,44 @@ algorithm
local
Integer sub1, sub2;
list<Integer> rest1, rest2;

case (1, _, _)
then 1;

case (-1, _, _)
then -1;

// No subs
case (_, {}, {})
then identsCompared;

// One of them has subs while the nosub crefs are the same
case (0, {}, _)
then -1;

case (0, _, {})
then 1;

case (0, sub1::rest1, sub2::rest2)
equation
true = intEq(sub1,sub2);
then
crefLexicalCompareubsAtEnd2(0, rest1,rest2);

case (0, sub1::rest1, sub2::rest2)
equation
true = intGe(sub1,sub2);
then 1;

case (0, sub1::rest1, sub2::rest2)
then -1;

case (_, _, _)
equation
print("ComponentReference.crefLexicalCompareubsAtEnd2 failed \n");
then
fail();

end matchcontinue;
end crefLexicalCompareubsAtEnd2;

Expand Down
6 changes: 3 additions & 3 deletions Compiler/Template/CodegenC.tpl
Expand Up @@ -1046,7 +1046,7 @@ template globalDataParDefine(SimVar simVar, String arrayName)
#define $P$ATTRIBUTE$P$PRE<%cref(name)%> $P$ATTRIBUTE<%cref(name)%>
#define _<%cref(name)%>(i) <%cref(name)%>
#define <%cref(name)%>__varInfo data->modelData.<%arrayName%>Data[<%index%>].info

>>
case SIMVAR(aliasvar=NOALIAS()) then
<<
Expand All @@ -1056,7 +1056,7 @@ template globalDataParDefine(SimVar simVar, String arrayName)
#define $P$ATTRIBUTE<%cref(name)%> data->modelData.<%arrayName%>Data[<%index%>].attribute
#define $P$ATTRIBUTE$P$PRE<%cref(name)%> $P$ATTRIBUTE<%cref(name)%>
#define <%cref(name)%>__varInfo data->modelData.<%arrayName%>Data[<%index%>].info

>>
end match
end globalDataParDefine;
Expand All @@ -1081,7 +1081,7 @@ template globalDataVarDefine(SimVar simVar, String arrayName, Integer offset) "t
#define $P$ATTRIBUTE$P$PRE<%cref(name)%> $P$ATTRIBUTE<%cref(name)%>
#define <%cref(name)%>__varInfo data->modelData.<%arrayName%>Data[<%intAdd(offset,index)%>].info
#define $P$PRE<%cref(name)%>__varInfo data->modelData.<%arrayName%>Data[<%intAdd(offset,index)%>].info

>>
case SIMVAR(aliasvar=NOALIAS()) then
let tmp = System.tmpTick()
Expand Down

0 comments on commit 86dc68a

Please sign in to comment.