Skip to content

Commit 6e8fbdd

Browse files
committed
Silence -Wsign-compare in src/gpuarray_array.c
1 parent 8e6df64 commit 6e8fbdd

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/gpuarray_array.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ int GpuArray_index_inplace(GpuArray *a, const ssize_t *starts,
280280
return GA_VALUE_ERROR;
281281
}
282282
if (steps[i] == 0 &&
283-
(starts[i] == -1 || starts[i] >= a->dimensions[i])) {
283+
(starts[i] == -1 || starts[i] >= (ssize_t)a->dimensions[i])) {
284284
free(newdims);
285285
free(newstrs);
286286
return GA_VALUE_ERROR;
@@ -663,10 +663,10 @@ int GpuArray_reshape_inplace(GpuArray *a, unsigned int nd,
663663

664664
for (ok = oi; ok < oj - 1; ok++) {
665665
if (ord == GA_F_ORDER) {
666-
if (a->strides[ok+1] != a->dimensions[ok]*a->strides[ok])
666+
if (a->strides[ok+1] != (ssize_t)a->dimensions[ok]*a->strides[ok])
667667
goto need_copy;
668668
} else {
669-
if (a->strides[ok] != a->dimensions[ok+1]*a->strides[ok+1])
669+
if (a->strides[ok] != (ssize_t)a->dimensions[ok+1]*a->strides[ok+1])
670670
goto need_copy;
671671
}
672672
}
@@ -1125,7 +1125,7 @@ int GpuArray_is_c_contiguous(const GpuArray *a) {
11251125
int i;
11261126

11271127
for (i = a->nd - 1; i >= 0; i--) {
1128-
if (a->strides[i] != size) return 0;
1128+
if (a->strides[i] != (ssize_t)size) return 0;
11291129
// We suppose that overflow will not happen since data has to fit in memory
11301130
size *= a->dimensions[i];
11311131
}
@@ -1137,7 +1137,7 @@ int GpuArray_is_f_contiguous(const GpuArray *a) {
11371137
unsigned int i;
11381138

11391139
for (i = 0; i < a->nd; i++) {
1140-
if (a->strides[i] != size) return 0;
1140+
if (a->strides[i] != (ssize_t)size) return 0;
11411141
// We suppose that overflow will not happen since data has to fit in memory
11421142
size *= a->dimensions[i];
11431143
}

0 commit comments

Comments
 (0)