mirror of https://github.com/AxioDL/metaforce.git
Merge pull request #45 from lioncash/str
DNACommon: Replace platform-specific string conversion functions with standard facilities
This commit is contained in:
commit
52667b2069
|
@ -246,23 +246,15 @@ public:
|
||||||
UniqueID64(const hecl::ProjectPath& path) { *this = path; }
|
UniqueID64(const hecl::ProjectPath& path) { *this = path; }
|
||||||
UniqueID64(const char* hexStr) {
|
UniqueID64(const char* hexStr) {
|
||||||
char copy[17];
|
char copy[17];
|
||||||
strncpy(copy, hexStr, 16);
|
std::strncpy(copy, hexStr, 16);
|
||||||
copy[16] = '\0';
|
copy[16] = '\0';
|
||||||
#if _WIN32
|
assign(std::strtoull(copy, nullptr, 16));
|
||||||
assign(_strtoui64(copy, nullptr, 16));
|
|
||||||
#else
|
|
||||||
assign(strtouq(copy, nullptr, 16));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
UniqueID64(const wchar_t* hexStr) {
|
UniqueID64(const wchar_t* hexStr) {
|
||||||
wchar_t copy[17];
|
wchar_t copy[17];
|
||||||
wcsncpy(copy, hexStr, 16);
|
std::wcsncpy(copy, hexStr, 16);
|
||||||
copy[16] = L'\0';
|
copy[16] = L'\0';
|
||||||
#if _WIN32
|
assign(std::wcstoull(copy, nullptr, 16));
|
||||||
assign(_wcstoui64(copy, nullptr, 16));
|
|
||||||
#else
|
|
||||||
assign(wcstoull(copy, nullptr, 16));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr size_t BinarySize() { return 8; }
|
static constexpr size_t BinarySize() { return 8; }
|
||||||
|
|
Loading…
Reference in New Issue