diff --git a/cocos/network/CCDownloader-curl.cpp b/cocos/network/CCDownloader-curl.cpp index 61218485dc..9f9a01eebd 100644 --- a/cocos/network/CCDownloader-curl.cpp +++ b/cocos/network/CCDownloader-curl.cpp @@ -108,7 +108,7 @@ namespace cocos2d { namespace network { do { string dir; - unsigned long found = _tempFileName.find_last_of("/\\"); + size_t found = _tempFileName.find_last_of("/\\"); if (found == string::npos) { _errCode = DownloadTask::ERROR_INVALID_PARAMS; diff --git a/cocos/platform/winrt/CCFileUtilsWinRT.cpp b/cocos/platform/winrt/CCFileUtilsWinRT.cpp index cd2d2df330..5827a0cc31 100644 --- a/cocos/platform/winrt/CCFileUtilsWinRT.cpp +++ b/cocos/platform/winrt/CCFileUtilsWinRT.cpp @@ -36,8 +36,8 @@ static std::string s_pszResourcePath; static inline std::string convertPathFormatToUnixStyle(const std::string& path) { std::string ret = path; - int len = ret.length(); - for (int i = 0; i < len; ++i) + size_t len = ret.length(); + for (size_t i = 0; i < len; ++i) { if (ret[i] == '\\') { diff --git a/cocos/platform/winrt/CCWinRTUtils.cpp b/cocos/platform/winrt/CCWinRTUtils.cpp index c1e0352b04..64895b84d5 100644 --- a/cocos/platform/winrt/CCWinRTUtils.cpp +++ b/cocos/platform/winrt/CCWinRTUtils.cpp @@ -321,8 +321,7 @@ Concurrency::task^> ReadDataAsync(Platform::String^ path) std::string computeHashForFile(const std::string& filePath) { std::string ret = filePath; - int pos = std::string::npos; - pos = ret.find_last_of('/'); + size_t pos = ret.find_last_of('/'); if (pos != std::string::npos) { ret = ret.substr(pos);