| 182 | } |
| 183 | |
| 184 | static void intsetMoveTail(intset *is, uint32_t from, uint32_t to) { |
| 185 | void *src, *dst; |
| 186 | uint32_t bytes = intrev32ifbe(is->length)-from; |
| 187 | uint32_t encoding = intrev32ifbe(is->encoding); |
| 188 | |
| 189 | if (encoding == INTSET_ENC_INT64) { |
| 190 | src = (int64_t*)is->contents+from; |
| 191 | dst = (int64_t*)is->contents+to; |
| 192 | bytes *= sizeof(int64_t); |
| 193 | } else if (encoding == INTSET_ENC_INT32) { |
| 194 | src = (int32_t*)is->contents+from; |
| 195 | dst = (int32_t*)is->contents+to; |
| 196 | bytes *= sizeof(int32_t); |
| 197 | } else { |
| 198 | src = (int16_t*)is->contents+from; |
| 199 | dst = (int16_t*)is->contents+to; |
| 200 | bytes *= sizeof(int16_t); |
| 201 | } |
| 202 | memmove(dst,src,bytes); |
| 203 | } |
| 204 | |
| 205 | /* Insert an integer in the intset */ |
| 206 | intset *intsetAdd(intset *is, int64_t value, uint8_t *success) { |
no outgoing calls
no test coverage detected