| 38 | } |
| 39 | |
| 40 | int ParseVoidPtr(const char* str, const ScanSpecification& spec, void** value) |
| 41 | { |
| 42 | if (!spec.SpecifierMatch('p')) { |
| 43 | LOG(DFATAL) << "Invalid scan specifier '" << spec.specifier |
| 44 | << "' for pointer type"; |
| 45 | return 0; |
| 46 | } |
| 47 | char* endptr; |
| 48 | unsigned long n = strtoul(str, &endptr, 16); |
| 49 | *value = reinterpret_cast<void*>(n); |
| 50 | return endptr - str; |
| 51 | } |
| 52 | |
| 53 | int ScanValueParser<bool>::Parse(const char* str, const ScanSpecification& spec, bool* value) |
| 54 | { |