MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / ParseInt64

Function ParseInt64

src/utilstrencodings.cpp:292–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292bool ParseInt64(const std::string& str, int64_t *out)
293{
294 if (!ParsePrechecks(str))
295 return false;
296 char *endp = nullptr;
297 errno = 0; // strtoll will not set errno if valid
298 long long int n = strtoll(str.c_str(), &endp, 10);
299 if(out) *out = (int64_t)n;
300 // Note that strtoll returns a *long long int*, so even if strtol doesn't report an over/underflow
301 // we still have to check that the returned value is within the range of an *int64_t*.
302 return endp && *endp == 0 && !errno &&
303 n >= std::numeric_limits<int64_t>::min() &&
304 n <= std::numeric_limits<int64_t>::max();
305}
306
307bool ParseUInt32(const std::string& str, uint32_t *out)
308{

Callers 7

MutateTxVersionFunction · 0.70
MutateTxLocktimeFunction · 0.70
MutateTxRBFOptInFunction · 0.70
MutateTxAddInputFunction · 0.70
MutateTxDelInputFunction · 0.70
MutateTxDelOutputFunction · 0.70

Calls 2

maxFunction · 0.85
ParsePrechecksFunction · 0.70

Tested by

no test coverage detected