Skip to content

Commit 4107942

Browse files
JohnCoconutminggo
authored andcommitted
fix Wformat warnings (#19893)
1 parent a096ac8 commit 4107942

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

cocos/base/ccCArray.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ void ccArrayEnsureExtraCapacity(ccArray *arr, ssize_t extra)
7272
{
7373
while (arr->max < arr->num + extra)
7474
{
75-
CCLOGINFO("cocos2d: ccCArray: resizing ccArray capacity from [%d] to [%d].",
76-
static_cast<int>(arr->max),
77-
static_cast<int>(arr->max*2));
75+
CCLOGINFO("cocos2d: ccCArray: resizing ccArray capacity from [%zd] to [%zd].",
76+
arr->max,
77+
arr->max*2);
7878

7979
ccArrayDoubleCapacity(arr);
8080
}

cocos/scripting/js-bindings/manual/network/XMLHTTPRequest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ MinXmlHttpRequest::EncodingType MinXmlHttpRequest::_getEncodingType() const
240240
}
241241
else
242242
{
243-
CCLOG("[error] bad unrecongized Content-Encoding value ", encodingTypeStr.c_str(), ", use \"identity\" as default");
243+
CCLOG("[error] unrecongized Content-Encoding value %s, %s", encodingTypeStr.c_str(), "use \"identity\" as default");
244244
return EncodingType::IDENTITY;
245245
}
246246
}

tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,7 @@ void TestListFiles::onEnter()
14131413
std::vector<std::string> list = FileUtils::getInstance()->listFiles (defaultPath);
14141414

14151415
char cntBuffer[200] = { 0 };
1416-
snprintf(cntBuffer, 200, "'fonts/' %d, $defaultResourceRootPath %d",listFonts.size(), list.size());
1416+
snprintf(cntBuffer, 200, "'fonts/' %zu, $defaultResourceRootPath %zu",listFonts.size(), list.size());
14171417

14181418
for(int i=0;i<listFonts.size();i++)
14191419
{

0 commit comments

Comments
 (0)