MCPcopy Create free account
hub / github.com/chen3feng/toft / ParseVoidPtr

Function ParseVoidPtr

base/string/format/scan_arg.cpp:40–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40int 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
53int ScanValueParser<bool>::Parse(const char* str, const ScanSpecification& spec, bool* value)
54{

Callers 1

ParseMethod · 0.85

Calls 1

SpecifierMatchMethod · 0.80

Tested by

no test coverage detected