From 61bf25ac6a0457cdee126dd89a501cea80f34ec6 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 22 Dec 2023 10:19:51 +0100 Subject: [PATCH] string: switch from intptr_t to ptrdiff_t at strtoi() strtoi() is complementary to strtoui() returning size_t. But, intptr_t is complementary to uintptr_t, and ptrdiff_t is complementary to size_t. I know it doesn't matter on flat-memory platforms, but nevertheless, we try to keep things organized in a portable way. Signed-off-by: Simon Rozman --- include/stdex/string.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/stdex/string.hpp b/include/stdex/string.hpp index c6688ef5e..1b7e64e28 100644 --- a/include/stdex/string.hpp +++ b/include/stdex/string.hpp @@ -2020,15 +2020,15 @@ namespace stdex /// \return Binary integer value /// template - inline intptr_t strtoi( + inline ptrdiff_t strtoi( _In_reads_or_z_opt_(count) const T* str, _In_ size_t count, _Out_opt_ size_t* end, _In_ int radix) { #if defined(_WIN64) || defined(__LP64__) - return static_cast(strto64(str, count, end, radix)); + return static_cast(strto64(str, count, end, radix)); #else - return static_cast(strto32(str, count, end, radix)); + return static_cast(strto32(str, count, end, radix)); #endif } @@ -2043,7 +2043,7 @@ namespace stdex /// \return Binary integer value /// template - inline intptr_t strtoi( + inline ptrdiff_t strtoi( _In_ const T (&str)[N], _Out_opt_ size_t* end, _In_ int radix)