diff --git a/cocos/2d/CCLayer.cpp b/cocos/2d/CCLayer.cpp index 46f7a2ee57..488dbc3d1a 100644 --- a/cocos/2d/CCLayer.cpp +++ b/cocos/2d/CCLayer.cpp @@ -932,7 +932,7 @@ void LayerMultiplex::switchToAndReleaseMe(int n) std::string LayerMultiplex::getDescription() const { - return StringUtils::format("(_children.size())); } NS_CC_END diff --git a/cocos/2d/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp index 049934f31c..092137bb47 100644 --- a/cocos/2d/CCSpriteBatchNode.cpp +++ b/cocos/2d/CCSpriteBatchNode.cpp @@ -380,7 +380,7 @@ void SpriteBatchNode::increaseAtlasCapacity(void) CCLOG("cocos2d: SpriteBatchNode: resizing TextureAtlas capacity from [%d] to [%d].", static_cast(_textureAtlas->getCapacity()), - quantity); + static_cast(quantity)); if (! _textureAtlas->resizeCapacity(quantity)) { diff --git a/cocos/2d/CCTMXTiledMap.cpp b/cocos/2d/CCTMXTiledMap.cpp index 259f36585f..5cd4bba307 100644 --- a/cocos/2d/CCTMXTiledMap.cpp +++ b/cocos/2d/CCTMXTiledMap.cpp @@ -247,7 +247,7 @@ Value TMXTiledMap::getPropertiesForGID(int GID) const std::string TMXTiledMap::getDescription() const { - return StringUtils::format("(_children.size())); } diff --git a/cocos/2d/CCTextureAtlas.cpp b/cocos/2d/CCTextureAtlas.cpp index c687288d3d..83dce8b3c1 100644 --- a/cocos/2d/CCTextureAtlas.cpp +++ b/cocos/2d/CCTextureAtlas.cpp @@ -226,7 +226,7 @@ void TextureAtlas::listenBackToForeground(EventCustom* event) std::string TextureAtlas::getDescription() const { - return StringUtils::format("", _totalQuads); + return StringUtils::format("", static_cast(_totalQuads)); } diff --git a/cocos/2d/CCTextureCache.cpp b/cocos/2d/CCTextureCache.cpp index 686f1ef760..ecfb1c75fb 100644 --- a/cocos/2d/CCTextureCache.cpp +++ b/cocos/2d/CCTextureCache.cpp @@ -89,7 +89,7 @@ void TextureCache::purgeSharedTextureCache() std::string TextureCache::getDescription() const { - return StringUtils::format("", _textures.size()); + return StringUtils::format("", static_cast(_textures.size())); } void TextureCache::addImageAsync(const std::string &path, std::function callback) diff --git a/cocos/2d/ccCArray.cpp b/cocos/2d/ccCArray.cpp index dc89fbb93e..d9ea0ac11d 100644 --- a/cocos/2d/ccCArray.cpp +++ b/cocos/2d/ccCArray.cpp @@ -72,9 +72,9 @@ void ccArrayEnsureExtraCapacity(ccArray *arr, ssize_t extra) { while (arr->max < arr->num + extra) { - CCLOG("cocos2d: ccCArray: resizing ccArray capacity from [%zd] to [%zd].", - arr->max, - arr->max*2); + CCLOG("cocos2d: ccCArray: resizing ccArray capacity from [%d] to [%d].", + static_cast(arr->max), + static_cast(arr->max*2)); ccArrayDoubleCapacity(arr); } diff --git a/cocos/gui/UIPageView.cpp b/cocos/gui/UIPageView.cpp index b41242b32d..5e11a88918 100644 --- a/cocos/gui/UIPageView.cpp +++ b/cocos/gui/UIPageView.cpp @@ -96,7 +96,7 @@ void PageView::addWidgetToPage(Widget *widget, ssize_t pageIdx, bool forceCreate { if (pageIdx > pageCount) { - CCLOG("pageIdx is %zd, it will be added as page id [%zd]",pageIdx,pageCount); + CCLOG("pageIdx is %d, it will be added as page id [%d]",static_cast(pageIdx),static_cast(pageCount)); } Layout* newPage = createPage(); newPage->addChild(widget); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp index 1ba703a1bd..a2f43dd5af 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp @@ -92,7 +92,7 @@ void UIPageViewTest::pageViewEvent(Object *pSender, PageViewEventType type) { PageView* pageView = dynamic_cast(pSender); - _displayValueLabel->setText(StringUtils::format("page = %zd", pageView->getCurPageIndex() + 1)); + _displayValueLabel->setText(StringUtils::format("page = %d", static_cast(pageView->getCurPageIndex() + 1))); } break;