diff options
| author | Tyge Løvset <[email protected]> | 2023-02-08 12:18:59 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-02-08 12:18:59 +0100 |
| commit | 673dd5319a488d4b702b94dd9aeda4e497ae4fbc (patch) | |
| tree | 03f3f96388ba1829eed3203ae8c7838a7110b0a1 /include | |
| parent | 1353117ffc5a26709b1a00995cc6be49e1eab7ab (diff) | |
| download | STC-modified-673dd5319a488d4b702b94dd9aeda4e497ae4fbc.tar.gz STC-modified-673dd5319a488d4b702b94dd9aeda4e497ae4fbc.zip | |
Minors.
Diffstat (limited to 'include')
| -rw-r--r-- | include/stc/cspan.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/include/stc/cspan.h b/include/stc/cspan.h index 6c7bb273..62de174a 100644 --- a/include/stc/cspan.h +++ b/include/stc/cspan.h @@ -211,13 +211,12 @@ STC_API intptr_t _cspan_slice(int32_t odim[], int32_t ostri[], int* orank, STC_DEF intptr_t _cspan_idxN(int rank, const int32_t shape[], const int32_t stri[], const int32_t a[]) { intptr_t off = a[0]; - bool ok = c_LTu(a[0], shape[0]); + c_ASSERT(c_LTu(a[0], shape[0])); for (int i = 1; i < rank; ++i) { off *= stri[i]; off += a[i]; - ok &= c_LTu(a[i], shape[i]); + c_ASSERT(c_LTu(a[i], shape[i])); } - c_ASSERT(ok); return off; } @@ -237,23 +236,22 @@ STC_DEF intptr_t _cspan_slice(int32_t odim[], int32_t ostri[], int* orank, const int32_t shape[], const int32_t stri[], int rank, const int32_t a[][2]) { intptr_t off = 0; - int i = 0, j = 0, ok = true; + int i = 0, j = 0; int32_t t, s = 1; for (; i < rank; ++i) { off *= stri[i]; off += a[i][0]; switch (a[i][1]) { - case 0: s *= stri[i]; ok &= c_LTu(a[i][0], shape[i]); continue; + case 0: s *= stri[i]; c_ASSERT(c_LTu(a[i][0], shape[i])); continue; case -1: t = shape[i]; break; default: t = a[i][1]; break; } odim[j] = t - a[i][0]; ostri[j] = s*stri[i]; - ok &= c_LTu(0, odim[j]) & !c_LTu(shape[i], t); + c_ASSERT(c_LTu(0, odim[j]) & !c_LTu(shape[i], t)); s = 1; ++j; } *orank = j; - c_ASSERT(ok); return off; } #endif |
