MCPcopy Create free account
hub / github.com/git/git / signed_int_fits

Function signed_int_fits

parse-options.c:122–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122static 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
130static enum parse_opt_result do_get_value(struct parse_opt_ctx_t *p,
131 const struct option *opt,

Callers 1

parse_options_checkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected