Skip to content

Commit

Permalink
add const qualifiers to data arguments of array constructors
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25725 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
rfranke committed Apr 24, 2015
1 parent f23c302 commit e2e7326
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions SimulationRuntime/cpp/Include/Core/Math/Array.h
Expand Up @@ -176,7 +176,7 @@ class RefArray : public BaseArray<T>
* Constuctor for reference array
* it uses data from simvars memory
*/
RefArray(T* data)
RefArray(const T* data)
:BaseArray<T>(true, true)
{
std::transform(data, data + nelems,
Expand All @@ -187,7 +187,7 @@ class RefArray : public BaseArray<T>
* Constuctor for reference array
* intialize array with reference data from simvars memory
*/
RefArray(T** ref_data)
RefArray(const T** ref_data)
:BaseArray<T>(true, true)
{
T **refs = _ref_array.c_array();
Expand Down Expand Up @@ -306,13 +306,13 @@ class RefArrayDim1 : public RefArray<T, size>
* Constuctor for one dimensional reference array
* it uses data from simvars memory
*/
RefArrayDim1(T* data) : RefArray<T,size>(data) { }
RefArrayDim1(const T* data) : RefArray<T, size>(data) {}

/**
* Constuctor for one dimensional reference array
* intialize array with reference data from simvars memory
*/
RefArrayDim1(T** ref_data) : RefArray<T,size>(ref_data) { }
RefArrayDim1(const T** ref_data) : RefArray<T, size>(ref_data) {}

/**
* Index operator to access array element
Expand Down Expand Up @@ -373,13 +373,13 @@ class RefArrayDim2 : public RefArray<T, size1*size2>
* Constuctor for two dimensional reference array
* it uses data from simvars memory
*/
RefArrayDim2(T* data) : RefArray<T,size1*size2>(data) { }
RefArrayDim2(const T* data) : RefArray<T, size1*size2>(data) {}

/**
* Constuctor for two dimensional reference array
* intialize array with reference data from simvars memory
*/
RefArrayDim2(T** ref_data) : RefArray<T,size1*size2>(ref_data) { }
RefArrayDim2(const T** ref_data) : RefArray<T, size1*size2>(ref_data) {}

/**
* Index operator to access array element
Expand Down Expand Up @@ -452,13 +452,13 @@ class RefArrayDim3 : public RefArray<T, size1*size2*size3>
* Constuctor for three dimensional reference array
* it uses data from simvars memory
*/
RefArrayDim3(T* data) : RefArray<T,size1*size2*size3>(data) { }
RefArrayDim3(const T* data) : RefArray<T, size1*size2*size3>(data) {}

/**
* Constuctor for three dimensional reference array
* intialize array with reference data from simvars memory
*/
RefArrayDim3(T** ref_data) : RefArray<T,size1*size2*size3>(ref_data) { }
RefArrayDim3(const T** ref_data) : RefArray<T, size1*size2*size3>(ref_data) {}

/**
* Return sizes of dimensions
Expand Down Expand Up @@ -534,7 +534,7 @@ class StatArray : public BaseArray<T>
* if reference array it uses data from simvars memory
* else it copies data in array memory
*/
StatArray(T* data)
StatArray(const T* data)
:BaseArray<T>(true, false)
{
memcpy(_array_data.begin(), data, nelems*sizeof(T));
Expand Down Expand Up @@ -660,7 +660,7 @@ class StatArrayDim1 : public StatArray<T, size>
* if reference array it uses data from simvars memory
* else it copies data in array memory
*/
StatArrayDim1(T* data)
StatArrayDim1(const T* data)
:StatArray<T, size>(data) {}

/**
Expand Down Expand Up @@ -986,7 +986,7 @@ class StatArrayDim2 : public StatArray<T, size1*size2>
* if reference array it uses data from simvars memory
* else it copies data in array memory
*/
StatArrayDim2(T* data)
StatArrayDim2(const T* data)
:StatArray<T, size1*size2>(data) {}

/**
Expand Down Expand Up @@ -1317,7 +1317,7 @@ class StatArrayDim3 : public StatArray<T, size1*size2*size3>
* if reference array it uses data from simvars memory
* else it copies data in array memory
*/
StatArrayDim3(T* data)
StatArrayDim3(const T* data)
:StatArray<T, size1*size2*size3>(data) {}

/**
Expand Down

0 comments on commit e2e7326

Please sign in to comment.