MCPcopy Create free account
hub / github.com/coreutils/coreutils / getsize

Function getsize

src/expr.c:498–510  ·  view source on GitHub ↗

Extract a size_t value from an integer value I. If the value is negative, return SIZE_MAX. If the value is too large, return SIZE_MAX - 1. */

Source from the content-addressed store, hash-verified

496 If the value is negative, return SIZE_MAX.
497 If the value is too large, return SIZE_MAX - 1. */
498static size_t
499getsize (mpz_t i)
500{
501 if (mpz_sgn (i) < 0)
502 return SIZE_MAX;
503 if (mpz_fits_ulong_p (i))
504 {
505 unsigned long int ul = mpz_get_ui (i);
506 if (ul < SIZE_MAX)
507 return ul;
508 }
509 return SIZE_MAX - 1;
510}
511
512/* Return true and advance if the next token matches STR exactly.
513 STR must not be null. */

Callers 1

eval6Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected