From 0d9cd9784b5caddb8a2a64d5020cd648aa7e609b Mon Sep 17 00:00:00 2001 From: signmotion Date: Sat, 23 Nov 2013 07:23:06 +0200 Subject: [PATCH] * Fixed warnings in VS2012: C4018 (signed/unsigned mismatch) and C4244 (conversion from 'double' to 'float'). --- cocos/gui/UIListView.cpp | 3 ++- cocos/network/SocketIO.cpp | 2 +- .../TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cocos/gui/UIListView.cpp b/cocos/gui/UIListView.cpp index 8e45662c3e..dbc2a1f840 100644 --- a/cocos/gui/UIListView.cpp +++ b/cocos/gui/UIListView.cpp @@ -301,7 +301,8 @@ void UIListView::removeLastItem() UIWidget* UIListView::getItem(unsigned int index) { - if ((int)index < 0 || index >= _items->count()) + // @todo Signed/unsigned mishmash. Index is must be unsigned int always. Yes? + if ( ((int)index < 0) || ((int)index >= _items->count()) ) { return nullptr; } diff --git a/cocos/network/SocketIO.cpp b/cocos/network/SocketIO.cpp index bb9acff3e1..d4d66ac137 100644 --- a/cocos/network/SocketIO.cpp +++ b/cocos/network/SocketIO.cpp @@ -367,7 +367,7 @@ void SIOClientImpl::onOpen(WebSocket* ws) c->onOpen(); } - Director::getInstance()->getScheduler()->scheduleSelector(schedule_selector(SIOClientImpl::heartbeat), this, (_heartbeat * .9), false); + Director::getInstance()->getScheduler()->scheduleSelector(schedule_selector(SIOClientImpl::heartbeat), this, (_heartbeat * .9f), false); log("SIOClientImpl::onOpen socket connected!"); } diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp index ccf4ca602d..fd7fd7e042 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp @@ -519,7 +519,7 @@ void SpriteMainScene::onEnter() auto director = Director::getInstance(); auto sched = director->getScheduler(); - sched->scheduleSelector(SEL_SCHEDULE(&SpriteMainScene::updateAutoTest), this, 0.2, false); + sched->scheduleSelector(SEL_SCHEDULE(&SpriteMainScene::updateAutoTest), this, 0.2f, false); } }