Return the required encoding for the provided value. */
| 44 | |
| 45 | /* Return the required encoding for the provided value. */ |
| 46 | static uint8_t _intsetValueEncoding(int64_t v) { |
| 47 | if (v < INT32_MIN || v > INT32_MAX) |
| 48 | return INTSET_ENC_INT64; |
| 49 | else if (v < INT16_MIN || v > INT16_MAX) |
| 50 | return INTSET_ENC_INT32; |
| 51 | else |
| 52 | return INTSET_ENC_INT16; |
| 53 | } |
| 54 | |
| 55 | /* Return the value at pos, given an encoding. */ |
| 56 | static int64_t _intsetGetEncoded(intset *is, int pos, uint8_t enc) { |
no outgoing calls
no test coverage detected