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. */
| 496 | If the value is negative, return SIZE_MAX. |
| 497 | If the value is too large, return SIZE_MAX - 1. */ |
| 498 | static size_t |
| 499 | getsize (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. */ |