fix crash related to not support the z length modifier for size_t on vs

This commit is contained in:
Dhilan007 2014-01-05 11:59:32 +08:00
parent 35246b0810
commit 49d8b76b9e
8 changed files with 10 additions and 10 deletions

View File

@ -932,7 +932,7 @@ void LayerMultiplex::switchToAndReleaseMe(int n)
std::string LayerMultiplex::getDescription() const
{
return StringUtils::format("<LayerMultiplex | Tag = %d, Layers = %zd", _tag, _children.size());
return StringUtils::format("<LayerMultiplex | Tag = %d, Layers = %d", _tag, static_cast<int>(_children.size()));
}
NS_CC_END

View File

@ -380,7 +380,7 @@ void SpriteBatchNode::increaseAtlasCapacity(void)
CCLOG("cocos2d: SpriteBatchNode: resizing TextureAtlas capacity from [%d] to [%d].",
static_cast<int>(_textureAtlas->getCapacity()),
quantity);
static_cast<int>(quantity));
if (! _textureAtlas->resizeCapacity(quantity))
{

View File

@ -247,7 +247,7 @@ Value TMXTiledMap::getPropertiesForGID(int GID) const
std::string TMXTiledMap::getDescription() const
{
return StringUtils::format("<TMXTiledMap | Tag = %d, Layers = %zd", _tag, _children.size());
return StringUtils::format("<TMXTiledMap | Tag = %d, Layers = %d", _tag, static_cast<int>(_children.size()));
}

View File

@ -226,7 +226,7 @@ void TextureAtlas::listenBackToForeground(EventCustom* event)
std::string TextureAtlas::getDescription() const
{
return StringUtils::format("<TextureAtlas | totalQuads = %zd>", _totalQuads);
return StringUtils::format("<TextureAtlas | totalQuads = %d>", static_cast<int>(_totalQuads));
}

View File

@ -89,7 +89,7 @@ void TextureCache::purgeSharedTextureCache()
std::string TextureCache::getDescription() const
{
return StringUtils::format("<TextureCache | Number of textures = %zd>", _textures.size());
return StringUtils::format("<TextureCache | Number of textures = %d>", static_cast<int>(_textures.size()));
}
void TextureCache::addImageAsync(const std::string &path, std::function<void(Texture2D*)> callback)

View File

@ -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<int>(arr->max),
static_cast<int>(arr->max*2));
ccArrayDoubleCapacity(arr);
}

View File

@ -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<int>(pageIdx),static_cast<int>(pageCount));
}
Layout* newPage = createPage();
newPage->addChild(widget);

View File

@ -92,7 +92,7 @@ void UIPageViewTest::pageViewEvent(Object *pSender, PageViewEventType type)
{
PageView* pageView = dynamic_cast<PageView*>(pSender);
_displayValueLabel->setText(StringUtils::format("page = %zd", pageView->getCurPageIndex() + 1));
_displayValueLabel->setText(StringUtils::format("page = %d", static_cast<int>(pageView->getCurPageIndex() + 1)));
}
break;