From 0e007d27243b1f736290f824ffd1f7d9bd70817b Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Mon, 10 Apr 2023 18:56:05 -0700 Subject: [PATCH] StringConv: Convert to conversion functions that don't use std::string `std::stoul` and `std::stroull` take a std::string which was converting the string_view to a std::string first. Causing glibc fault testing to catch this since not much uses this. These will be added to the documentation. --- External/FEXCore/Source/Common/StringConv.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/External/FEXCore/Source/Common/StringConv.h b/External/FEXCore/Source/Common/StringConv.h index b994ca518..112b10f75 100644 --- a/External/FEXCore/Source/Common/StringConv.h +++ b/External/FEXCore/Source/Common/StringConv.h @@ -7,32 +7,32 @@ namespace FEXCore::StrConv { [[maybe_unused]] static bool Conv(std::string_view Value, bool *Result) { - *Result = std::stoull(Value.data(), nullptr, 0); + *Result = std::strtoull(Value.data(), nullptr, 0); return true; } [[maybe_unused]] static bool Conv(std::string_view Value, uint8_t *Result) { - *Result = std::stoul(Value.data(), nullptr, 0); + *Result = std::strtoul(Value.data(), nullptr, 0); return true; } [[maybe_unused]] static bool Conv(std::string_view Value, uint16_t *Result) { - *Result = std::stoul(Value.data(), nullptr, 0); + *Result = std::strtoul(Value.data(), nullptr, 0); return true; } [[maybe_unused]] static bool Conv(std::string_view Value, uint32_t *Result) { - *Result = std::stoul(Value.data(), nullptr, 0); + *Result = std::strtoul(Value.data(), nullptr, 0); return true; } [[maybe_unused]] static bool Conv(std::string_view Value, int32_t *Result) { - *Result = std::stol(Value.data(), nullptr, 0); + *Result = std::strtol(Value.data(), nullptr, 0); return true; } [[maybe_unused]] static bool Conv(std::string_view Value, uint64_t *Result) { - *Result = std::stoull(Value.data(), nullptr, 0); + *Result = std::strtoull(Value.data(), nullptr, 0); return true; } template