Use correct type for dimension iteration
This commit is contained in:
parent
8b2f0f7557
commit
6aeb79a384
@ -286,7 +286,7 @@ namespace CosmoTool {
|
|||||||
|
|
||||||
template<typename ArrayType>
|
template<typename ArrayType>
|
||||||
void hdf5_check_array(ArrayType& data, std::vector<hsize_t>& dims) {
|
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]) {
|
if (data.shape()[i] != dims[i]) {
|
||||||
throw InvalidDimensions();
|
throw InvalidDimensions();
|
||||||
}
|
}
|
||||||
@ -295,7 +295,7 @@ namespace CosmoTool {
|
|||||||
|
|
||||||
template<typename ArrayType>
|
template<typename ArrayType>
|
||||||
void hdf5_weak_check_array(ArrayType& data, std::vector<hsize_t>& dims) {
|
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) {
|
if (data.index_bases()[i] < 0) {
|
||||||
// Negative indexes are not supported right now.
|
// Negative indexes are not supported right now.
|
||||||
throw InvalidDimensions();
|
throw InvalidDimensions();
|
||||||
|
Loading…
Reference in New Issue
Block a user