MCPcopy Create free account
hub / github.com/IoLanguage/io / UArray_wrapPos_

Function UArray_wrapPos_

libs/basekit/source/UArray.c:1241–1257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1239}
1240
1241size_t UArray_wrapPos_(const UArray *self, long pos) {
1242 long size = self->size;
1243
1244 if (pos > size - 1) {
1245 return size;
1246 }
1247
1248 if (pos < 0) {
1249 pos = size + pos;
1250
1251 if (pos < 0) {
1252 pos = 0;
1253 }
1254 }
1255
1256 return pos;
1257}
1258
1259int cmp_uint8_t(const uint8_t *a, const uint8_t *b) {
1260 return *a == *b ? 0 : (*a < *b ? -1 : 1);

Callers 3

UArray_stackSliceFunction · 0.85
IoSeq_immutable.cFile · 0.85
IoSeq_mutable.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected