Skip to content

Commit

Permalink
Merge pull request cocos2d#12894 from zilongshanren/fixXcode5Warning
Browse files Browse the repository at this point in the history
fix xcode 5.1.1 warnings
  • Loading branch information
zilongshanren committed Jul 17, 2015
2 parents 309b563 + 8c31d70 commit 22ef262
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,11 @@ void TestIsDirectoryExist::onEnter()

Label* label = nullptr;
std::string dir;
char msg[512];
auto getMsg = [&dir, &msg](bool b)->const char *
auto getMsg = [&dir](bool b)-> std::string
{
char msg[512];
snprintf((char *)msg, 512, "%s for dir: \"%s\"", b ? "success" : "failed", dir.c_str());
return msg;
return std::string(msg);
};

dir = "Images";
Expand Down Expand Up @@ -873,13 +873,13 @@ void TestUnicodePath::onEnter()

std::string dir = "中文路径/";
std::string filename = "测试文件.test";

std::string act;
char msg[512];
auto getMsg = [&act, &msg](bool b, const std::string& path)->const char *
auto getMsg = [&act](bool b, const std::string& path)-> std::string
{
char msg[512];
snprintf((char *)msg, 512, "%s for %s path: \"%s\"", b ? "success" : "failed", act.c_str(), path.c_str());
return msg;
return std::string(msg);
};

// Check whether unicode dir should be create or not
Expand Down

0 comments on commit 22ef262

Please sign in to comment.