Return the value at pos, given an encoding. */
| 54 | |
| 55 | /* Return the value at pos, given an encoding. */ |
| 56 | static int64_t _intsetGetEncoded(intset *is, int pos, uint8_t enc) { |
| 57 | int64_t v64; |
| 58 | int32_t v32; |
| 59 | int16_t v16; |
| 60 | |
| 61 | if (enc == INTSET_ENC_INT64) { |
| 62 | memcpy(&v64,((int64_t*)is->contents)+pos,sizeof(v64)); |
| 63 | memrev64ifbe(&v64); |
| 64 | return v64; |
| 65 | } else if (enc == INTSET_ENC_INT32) { |
| 66 | memcpy(&v32,((int32_t*)is->contents)+pos,sizeof(v32)); |
| 67 | memrev32ifbe(&v32); |
| 68 | return v32; |
| 69 | } else { |
| 70 | memcpy(&v16,((int16_t*)is->contents)+pos,sizeof(v16)); |
| 71 | memrev16ifbe(&v16); |
| 72 | return v16; |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | /* Return the value at pos, using the configured encoding. */ |
| 77 | static int64_t _intsetGet(intset *is, int pos) { |
no outgoing calls
no test coverage detected