Use correct type for dimension iteration

This commit is contained in:
Guilhem Lavaux 2016-12-11 14:47:44 +01:00
parent 8b2f0f7557
commit 6aeb79a384

View File

@ -286,7 +286,7 @@ namespace CosmoTool {
template<typename ArrayType>
void hdf5_check_array(ArrayType& data, std::vector<hsize_t>& dims) {
for (long i = 0; i < data.num_dimensions(); i++) {
for (size_t i = 0; i < data.num_dimensions(); i++) {
if (data.shape()[i] != dims[i]) {
throw InvalidDimensions();
}
@ -295,7 +295,7 @@ namespace CosmoTool {
template<typename ArrayType>
void hdf5_weak_check_array(ArrayType& data, std::vector<hsize_t>& dims) {
for (long i = 0; i < data.num_dimensions(); i++) {
for (size_t i = 0; i < data.num_dimensions(); i++) {
if (data.index_bases()[i] < 0) {
// Negative indexes are not supported right now.
throw InvalidDimensions();