Commit 13ce79fd authored by Kenneth Leiter's avatar Kenneth Leiter

ENH: Fix up some minor const-correctness issues.

parent c4b66df6
...@@ -26,7 +26,7 @@ public: ...@@ -26,7 +26,7 @@ public:
class XdmfArray::CopyArrayValues : public boost::static_visitor <void> { class XdmfArray::CopyArrayValues : public boost::static_visitor <void> {
public: public:
CopyArrayValues(int startIndex, int valuesStartIndex, int numValues, int arrayStride, int valuesStride) : CopyArrayValues(const int startIndex, const int valuesStartIndex, const int numValues, const int arrayStride, const int valuesStride) :
mStartIndex(startIndex), mStartIndex(startIndex),
mValuesStartIndex(valuesStartIndex), mValuesStartIndex(valuesStartIndex),
mNumValues(numValues), mNumValues(numValues),
...@@ -55,11 +55,11 @@ public: ...@@ -55,11 +55,11 @@ public:
private: private:
int mStartIndex; const int mStartIndex;
int mValuesStartIndex; const int mValuesStartIndex;
int mNumValues; const int mNumValues;
int mArrayStride; const int mArrayStride;
int mValuesStride; const int mValuesStride;
}; };
class XdmfArray::GetHDF5Type : public boost::static_visitor <hid_t> { class XdmfArray::GetHDF5Type : public boost::static_visitor <hid_t> {
......
...@@ -57,7 +57,7 @@ public: ...@@ -57,7 +57,7 @@ public:
* @param arrayStride number of values to stride in this array between each copy. * @param arrayStride number of values to stride in this array between each copy.
* @param valuesStride number of values to stride in the XdmfArray between each copy. * @param valuesStride number of values to stride in the XdmfArray between each copy.
*/ */
void copyValues(int startIndex, boost::shared_ptr<XdmfArray> values, int valuesStartIndex= 0, int numValues = 1, int arrayStride = 1, int valuesStride = 1); void copyValues(const int startIndex, const boost::shared_ptr<XdmfArray> values, const int valuesStartIndex= 0, const int numValues = 1, const int arrayStride = 1, const int valuesStride = 1);
/** /**
* Copy values from an array into this array. * Copy values from an array into this array.
...@@ -69,7 +69,7 @@ public: ...@@ -69,7 +69,7 @@ public:
* @param valuesStride number of values to stride in the pointer between each copy. * @param valuesStride number of values to stride in the pointer between each copy.
*/ */
template<typename T> template<typename T>
void copyValues(int startIndex, T * valuesPointer, int numValues = 1, int arrayStride = 1, int valuesStride = 1); void copyValues(const int startIndex, const T * const valuesPointer, const int numValues = 1, const int arrayStride = 1, const int valuesStride = 1);
/** /**
* Remove all values from this array * Remove all values from this array
......
...@@ -5,7 +5,7 @@ template<typename T> ...@@ -5,7 +5,7 @@ template<typename T>
class XdmfArray::CopyValues : public boost::static_visitor <void> { class XdmfArray::CopyValues : public boost::static_visitor <void> {
public: public:
CopyValues(int startIndex, T * valuesPointer, int numValues = 1, int arrayStride = 1, int valuesStride = 1) : CopyValues(const int startIndex, const T * const valuesPointer, const int numValues, const int arrayStride, const int valuesStride) :
mStartIndex(startIndex), mStartIndex(startIndex),
mValuesPointer(valuesPointer), mValuesPointer(valuesPointer),
mNumValues(numValues), mNumValues(numValues),
...@@ -34,11 +34,11 @@ public: ...@@ -34,11 +34,11 @@ public:
private: private:
int mStartIndex; const int mStartIndex;
T* mValuesPointer; const T * const mValuesPointer;
int mNumValues; const int mNumValues;
int mArrayStride; const int mArrayStride;
int mValuesStride; const int mValuesStride;
}; };
struct XdmfArray::NullDeleter struct XdmfArray::NullDeleter
...@@ -49,7 +49,7 @@ struct XdmfArray::NullDeleter ...@@ -49,7 +49,7 @@ struct XdmfArray::NullDeleter
}; };
template<typename T> template<typename T>
void XdmfArray::copyValues(int startIndex, T * valuesPointer, int numValues, int arrayStride, int valuesStride) void XdmfArray::copyValues(const int startIndex, const T * const valuesPointer, const int numValues, const int arrayStride, const int valuesStride)
{ {
if(!mInitialized) if(!mInitialized)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment