| 120 | } |
| 121 | |
| 122 | static int signed_int_fits(intmax_t value, size_t precision) |
| 123 | { |
| 124 | size_t bits = precision * CHAR_BIT; |
| 125 | intmax_t upper_bound = INTMAX_MAX >> (bitsizeof(intmax_t) - bits); |
| 126 | intmax_t lower_bound = -upper_bound - 1; |
| 127 | return lower_bound <= value && value <= upper_bound; |
| 128 | } |
| 129 | |
| 130 | static enum parse_opt_result do_get_value(struct parse_opt_ctx_t *p, |
| 131 | const struct option *opt, |
no outgoing calls
no test coverage detected