Skip to content

Commit 0b7320e

Browse files
author
Roberto Di Remigio
committed
Correct a comparison of integers of different signs warning.
1 parent d705a6c commit 0b7320e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/cnpy.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ namespace cnpy
103103
assert(tmp_dims == ndims);
104104
}
105105

106-
for (int i = 1; i < ndims; i++) {
106+
for (size_t i = 1; i < ndims; i++) {
107107
if (shape[i] != tmp_shape[i]) {
108108
std::cout <<"libnpy error: npy_save attempting to append misshaped data to " << fname
109109
<< "\n";
@@ -125,7 +125,7 @@ namespace cnpy
125125
}
126126

127127
unsigned int nels = 1;
128-
for (int i = 0; i < ndims; ++i) nels *= shape[i];
128+
for (size_t i = 0; i < ndims; ++i) nels *= shape[i];
129129

130130
fwrite(data, sizeof(T), nels, fp);
131131
fclose(fp);

0 commit comments

Comments
 (0)