Fix C4267 and C4309 warnings when compiling for Windows 10 UWP

This commit is contained in:
mogemimi 2016-05-29 14:43:28 +09:00
parent 74fe77a367
commit c647a95656
3 changed files with 4 additions and 5 deletions

View File

@ -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;

View File

@ -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] == '\\')
{

View File

@ -321,8 +321,7 @@ Concurrency::task<Platform::Array<byte>^> 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);