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@24668 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
OpenModelica-Hudson committed Feb 20, 2015
1 parent b010bab commit 0e6a26a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions Compiler/BackEnd/CommonSubExpression.mo
Expand Up @@ -480,23 +480,23 @@ algorithm
(expLst, i) = List.mapFold(typeLst, createReturnExp, inUniqueCSEIndex);
value = DAE.TUPLE(expLst);
then (value, i+1);
// Expanding.

// Expanding.
case DAE.T_ARRAY(ty=tp, dims=dims) equation
str = "$CSE" + intString(inUniqueCSEIndex);
cr = DAE.CREF_IDENT(str, inType, {});
crefs = ComponentReference.expandCref(cr, false);
expLst = List.map(crefs, Expression.crefExp);
value = DAE.ARRAY(inType, true, expLst);
then (value, inUniqueCSEIndex + 1);
// // Not expanding Arrays

// // Not expanding Arrays
// case DAE.T_ARRAY(ty=tp, dims=dims) equation
// str = "$CSE" + intString(inUniqueCSEIndex);
// cr = DAE.CREF_IDENT(str, inType,{});
// value = DAE.CREF(cr, inType);
// then (value, inUniqueCSEIndex + 1);


// record types
case DAE.T_COMPLEX(varLst=varLst,complexClassType=ClassInf.RECORD(path),source=tpSource) equation
Expand Down
14 changes: 7 additions & 7 deletions Compiler/FrontEnd/ComponentReference.mo
Expand Up @@ -1522,14 +1522,14 @@ end containWholeDim3;
/***************************************************/

public function crefArrayGetFirstCref
"mahge: This function is used to get the first element in
"mahge: This function is used to get the first element in
an array cref if the cref was to be expanded. e.g.
(a->nonarray, b->array) given a.b[1] return a.b[1].
(a->nonarray, b->array) given a.b return a.b[1].
(a->nonarray, b->array) given a.b return a.b[1].
(a->array, b->array) given a[1].b return a[1].b[1]
(a->array, b->array) given a[2].b return a[2].b[1]
i.e essentially filling the missing subs with 1.
"
"
input DAE.ComponentRef inComponentRef;
output DAE.ComponentRef outComponentRef;
algorithm
Expand All @@ -1541,17 +1541,17 @@ algorithm
Integer diff;
DAE.Type ty;
DAE.Ident i;
case DAE.CREF_IDENT(i, ty, subs)

case DAE.CREF_IDENT(i, ty, subs)
algorithm
dims := Types.getDimensions(ty);
diff := listLength(dims) - listLength(subs);
newsubs := List.fill(DAE.INDEX(DAE.ICONST(1)), diff);
subs := List.appendNoCopy(subs,newsubs);
then
DAE.CREF_IDENT(i, ty, subs);
case DAE.CREF_QUAL(i, ty, subs, cr)

case DAE.CREF_QUAL(i, ty, subs, cr)
algorithm
dims := Types.getDimensions(ty);
diff := listLength(dims) - listLength(subs);
Expand Down
6 changes: 3 additions & 3 deletions Compiler/FrontEnd/Types.mo
Expand Up @@ -1899,7 +1899,7 @@ algorithm
end liftArrayListDims;

public function liftTypeWithDims "
mahge: This function turns a type into an array of that type
mahge: This function turns a type into an array of that type
by appening the new dimension at the end. "
input DAE.Type inType;
input DAE.Dimensions inDims;
Expand All @@ -1920,10 +1920,10 @@ algorithm
algorithm
dims := List.appendNoCopy(dims, inDims);
then DAE.T_ARRAY(ty, dims, src);

else
DAE.T_ARRAY(inType, inDims, DAE.emptyTypeSource);

end match;
end liftTypeWithDims;

Expand Down
2 changes: 1 addition & 1 deletion Compiler/Template/SimCodeTV.mo
Expand Up @@ -2806,7 +2806,7 @@ package ComponentReference
input DAE.ComponentRef inCref;
output Boolean isScalar;
end crefIsScalarWithVariableSubs;

function crefArrayGetFirstCref
input DAE.ComponentRef inComponentRef;
output DAE.ComponentRef outComponentRef;
Expand Down
4 changes: 2 additions & 2 deletions SimulationRuntime/c/util/integer_array.c
Expand Up @@ -430,7 +430,7 @@ void index_alloc_integer_array(const integer_array_t * source,
assert(base_array_ok(source));
assert(index_spec_ok(source_spec));
assert(index_spec_fit_base_array(source_spec,source));


for(i = 0, j = 0; i < source_spec->ndims; ++i) {
if(source_spec->dim_size[i] != 0) { /* is 'W' or 'A' */
Expand All @@ -451,7 +451,7 @@ void index_alloc_integer_array(const integer_array_t * source,
++j;
}
}

alloc_integer_array_data(dest);
index_integer_array(source, source_spec, dest);
}
Expand Down

0 comments on commit 0e6a26a

Please sign in to comment.