| 1451 | } |
| 1452 | return (int)v; |
| 1453 | } |
| 1454 | |
| 1455 | static uint64_t parse_u64_arg(const char *s, const char *opt) { |
| 1456 | char *end = NULL; |
| 1457 | unsigned long long v = strtoull(s, &end, 10); |
| 1458 | if (s[0] == '\0' || *end != '\0' || v == 0) { |
| 1459 | fprintf(stderr, "ds4-eval: invalid value for %s: %s\n", opt, s); |
| 1460 | exit(2); |
| 1461 | } |
| 1462 | return (uint64_t)v; |
| 1463 | } |
| 1464 |