From 027328d3a6f00f8aba2ec84b479c81a1e834bc8c Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Thu, 29 Jan 2015 16:10:37 +0100 Subject: [PATCH] Windows Integration: Don't use size_t in StringUtil, it's unsigned --- shell_integration/windows/OCUtil/StringUtil.cpp | 8 ++++---- shell_integration/windows/OCUtil/StringUtil.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/shell_integration/windows/OCUtil/StringUtil.cpp b/shell_integration/windows/OCUtil/StringUtil.cpp index beb32505a..7c4a24a92 100644 --- a/shell_integration/windows/OCUtil/StringUtil.cpp +++ b/shell_integration/windows/OCUtil/StringUtil.cpp @@ -17,19 +17,19 @@ #include "StringUtil.h" -std::string StringUtil::toUtf8(const wchar_t *utf16, size_t len) +std::string StringUtil::toUtf8(const wchar_t *utf16, int len) { if (len < 0) { - len = wcslen(utf16); + len = (int) wcslen(utf16); } std::wstring_convert > converter; return converter.to_bytes(utf16, utf16+len); } -std::wstring StringUtil::toUtf16(const char *utf8, size_t len) +std::wstring StringUtil::toUtf16(const char *utf8, int len) { if (len < 0) { - len = strlen(utf8); + len = (int) strlen(utf8); } std::wstring_convert > converter; return converter.from_bytes(utf8, utf8+len); diff --git a/shell_integration/windows/OCUtil/StringUtil.h b/shell_integration/windows/OCUtil/StringUtil.h index ac1ff8e8f..d64eda7e5 100644 --- a/shell_integration/windows/OCUtil/StringUtil.h +++ b/shell_integration/windows/OCUtil/StringUtil.h @@ -20,8 +20,8 @@ class __declspec(dllexport) StringUtil { public: - static std::string toUtf8(const wchar_t* utf16, size_t len = -1); - static std::wstring toUtf16(const char* utf8, size_t len = -1); + static std::string toUtf8(const wchar_t* utf16, int len = -1); + static std::wstring toUtf16(const char* utf8, int len = -1); template static bool begins_with(const T& input, const T& match)