From cdf592ff891888785c83c768101ff6c75e353fde Mon Sep 17 00:00:00 2001 From: Richard Powell Date: Sun, 22 Nov 2015 12:34:21 -0800 Subject: [PATCH] Fixing up signed math warnings. --- include/string_span.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/string_span.h b/include/string_span.h index 250c528..769e2ed 100644 --- a/include/string_span.h +++ b/include/string_span.h @@ -109,26 +109,26 @@ inline basic_string_span ensure_z(T* const & sz, std::ptrdiff_ // TODO (neilmac) there is probably a better template-magic way to get the const and non-const overloads to share an implementation inline basic_string_span ensure_z(char* const& sz, std::ptrdiff_t max) { - auto len = strnlen(sz, max); + auto len = strnlen(sz, static_cast(max)); Ensures(sz[len] == 0); return{ sz, static_cast(len) }; } inline basic_string_span ensure_z(const char* const& sz, std::ptrdiff_t max) { - auto len = strnlen(sz, max); + auto len = strnlen(sz, static_cast(max)); Ensures(sz[len] == 0); return{ sz, static_cast(len) }; } inline basic_string_span ensure_z(wchar_t* const& sz, std::ptrdiff_t max) { - auto len = wcsnlen(sz, max); + auto len = wcsnlen(sz, static_cast(max)); Ensures(sz[len] == 0); return{ sz, static_cast(len) }; } inline basic_string_span ensure_z(const wchar_t* const& sz, std::ptrdiff_t max) { - auto len = wcsnlen(sz, max); + auto len = wcsnlen(sz, static_cast(max)); Ensures(sz[len] == 0); return{ sz, static_cast(len) }; }