MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / ToInt64

Method ToInt64

externals/tinyxml2/tinyxml2.cpp:672–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

670
671
672bool XMLUtil::ToInt64(const char* str, int64_t* value)
673{
674 if (IsPrefixHex(str)) {
675 unsigned long long v = 0; // horrible syntax trick to make the compiler happy about %llx
676 if (TIXML_SSCANF(str, "%llx", &v) == 1) {
677 *value = static_cast<int64_t>(v);
678 return true;
679 }
680 }
681 else {
682 long long v = 0; // horrible syntax trick to make the compiler happy about %lld
683 if (TIXML_SSCANF(str, "%lld", &v) == 1) {
684 *value = static_cast<int64_t>(v);
685 return true;
686 }
687 }
688 return false;
689}
690
691
692bool XMLUtil::ToUnsigned64(const char* str, uint64_t* value) {

Callers

nothing calls this directly

Calls 1

IsPrefixHexFunction · 0.85

Tested by

no test coverage detected