From b064967de852a0bc463df16f88ea7b749d737fe5 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 23 Aug 2019 14:15:41 -0400 Subject: [PATCH] DNACommon: Replace platform-specific string conversion functions with standard facilities These can be replaced with std::strtoull and std::wcstoull, eliminating a platform-specific ifdef. --- DataSpec/DNACommon/DNACommon.hpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/DataSpec/DNACommon/DNACommon.hpp b/DataSpec/DNACommon/DNACommon.hpp index 4dc5c961a..4eede33b3 100644 --- a/DataSpec/DNACommon/DNACommon.hpp +++ b/DataSpec/DNACommon/DNACommon.hpp @@ -246,23 +246,15 @@ public: UniqueID64(const hecl::ProjectPath& path) { *this = path; } UniqueID64(const char* hexStr) { char copy[17]; - strncpy(copy, hexStr, 16); + std::strncpy(copy, hexStr, 16); copy[16] = '\0'; -#if _WIN32 - assign(_strtoui64(copy, nullptr, 16)); -#else - assign(strtouq(copy, nullptr, 16)); -#endif + assign(std::strtoull(copy, nullptr, 16)); } UniqueID64(const wchar_t* hexStr) { wchar_t copy[17]; - wcsncpy(copy, hexStr, 16); + std::wcsncpy(copy, hexStr, 16); copy[16] = L'\0'; -#if _WIN32 - assign(_wcstoui64(copy, nullptr, 16)); -#else - assign(wcstoull(copy, nullptr, 16)); -#endif + assign(std::wcstoull(copy, nullptr, 16)); } static constexpr size_t BinarySize() { return 8; }