Fix warnings about signed/unsigned mismatch

This commit is contained in:
mogemimi 2016-04-22 12:20:05 +09:00
parent 16c7a594c8
commit a3ad4cddf8
6 changed files with 8 additions and 8 deletions

View File

@ -464,7 +464,7 @@ void Sprite3D::setMaterial(Material *material, int meshIndex)
if (meshIndex == -1) if (meshIndex == -1)
{ {
for (size_t i = 0; i < _meshes.size(); i++) for (ssize_t i = 0; i < _meshes.size(); i++)
{ {
_meshes.at(i)->setMaterial(i == 0 ? material : material->clone()); _meshes.at(i)->setMaterial(i == 0 ? material : material->clone());
} }

View File

@ -668,10 +668,10 @@ void WebSocket::onClientWritable()
WsMessage* subThreadMsg = *iter; WsMessage* subThreadMsg = *iter;
Data* data = (Data*)subThreadMsg->obj; Data* data = (Data*)subThreadMsg->obj;
const size_t c_bufferSize = WS_RX_BUFFER_SIZE; const ssize_t c_bufferSize = WS_RX_BUFFER_SIZE;
const size_t remaining = data->len - data->issued; const ssize_t remaining = data->len - data->issued;
const size_t n = std::min(remaining, c_bufferSize ); const ssize_t n = std::min(remaining, c_bufferSize);
WebSocketFrame* frame = nullptr; WebSocketFrame* frame = nullptr;

View File

@ -100,7 +100,7 @@ void Physics3DComponent::addToPhysicsWorld(Physics3DWorld* world)
{ {
auto parent = _owner->getParent(); auto parent = _owner->getParent();
while (parent) { while (parent) {
for (int i = 0; i < components.size(); i++) { for (size_t i = 0; i < components.size(); i++) {
if (parent == components[i]->getOwner()) if (parent == components[i]->getOwner())
{ {
//insert it here //insert it here

View File

@ -1483,7 +1483,7 @@ static int getPrevWord(const std::string& text, int idx)
static bool isWrappable(const std::string& text) static bool isWrappable(const std::string& text)
{ {
for (int i=0; i<text.length(); ++i) for (size_t i = 0; i < text.length(); ++i)
{ {
if (!std::isalnum(text[i], std::locale())) if (!std::isalnum(text[i], std::locale()))
return true; return true;

View File

@ -1034,7 +1034,7 @@ LabelTTFFontsTestNew::LabelTTFFontsTestNew()
auto size = Director::getInstance()->getWinSize(); auto size = Director::getInstance()->getWinSize();
TTFConfig ttfConfig(ttfpaths[0],20, GlyphCollection::NEHE); TTFConfig ttfConfig(ttfpaths[0],20, GlyphCollection::NEHE);
for (size_t i = 0; i < fontCount; ++i) { for (int i = 0; i < fontCount; ++i) {
ttfConfig.fontFilePath = ttfpaths[i]; ttfConfig.fontFilePath = ttfpaths[i];
auto label = Label::createWithTTF(ttfConfig, ttfpaths[i], TextHAlignment::CENTER,0); auto label = Label::createWithTTF(ttfConfig, ttfpaths[i], TextHAlignment::CENTER,0);
if( label ) { if( label ) {

View File

@ -422,7 +422,7 @@ void Material_parsePerformance::parsingTesting(unsigned int count)
{ {
std::clock_t begin = std::clock(); std::clock_t begin = std::clock();
for(int i=0;i<count;i++) for (unsigned int i = 0; i < count; i++)
{ {
Material::createWithFilename("Materials/2d_effects.material"); Material::createWithFilename("Materials/2d_effects.material");
Material::createWithFilename("Materials/3d_effects.material"); Material::createWithFilename("Materials/3d_effects.material");