Skip to content

Commit

Permalink
fix for cpnvertBoolToInt in cpp runtime
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@24875 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
niklwors committed Mar 3, 2015
1 parent 3dfe5c9 commit 0aab849
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions SimulationRuntime/cpp/Core/Math/ArrayOperations.cpp
Expand Up @@ -294,16 +294,14 @@ void convertBoolToInt(BaseArray<bool>& a, BaseArray<int>& b)
{
b.setDims(a.getDims());
int numEle = a.getNumElems();
for (int i = 0; i <= numEle; i++)
const bool* source_data = a.getData();
int* dest_data = b.getData();
for (int i = 0; (numEle > 0) && (i <= numEle); i++)
{
if (a(i))
{
b(i) = 1;
}
else
{
b(i) = 0;
}
if(source_data[i])
dest_data[i]=1;
else
dest_data[i]=0;
}
}

Expand Down

0 comments on commit 0aab849

Please sign in to comment.