| 89 | } |
| 90 | |
| 91 | bool json_to_u32(const char *buffer, const jsmntok_t *tok, u32 *num) |
| 92 | { |
| 93 | uint64_t u64; |
| 94 | |
| 95 | if (!json_to_u64(buffer, tok, &u64)) |
| 96 | return false; |
| 97 | *num = u64; |
| 98 | |
| 99 | /* Just in case it doesn't fit. */ |
| 100 | if (*num != u64) |
| 101 | return false; |
| 102 | return true; |
| 103 | } |
| 104 | |
| 105 | bool json_to_bool(const char *buffer, const jsmntok_t *tok, bool *b) |
| 106 | { |