| 1239 | } |
| 1240 | |
| 1241 | size_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 | |
| 1259 | int cmp_uint8_t(const uint8_t *a, const uint8_t *b) { |
| 1260 | return *a == *b ? 0 : (*a < *b ? -1 : 1); |
no outgoing calls
no test coverage detected