diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index 6e2779ccdd..b5cb0e760c 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -464,7 +464,7 @@ void Sprite3D::setMaterial(Material *material, int meshIndex) 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()); } diff --git a/cocos/network/WebSocket.cpp b/cocos/network/WebSocket.cpp index ef571822b3..ca04db0530 100644 --- a/cocos/network/WebSocket.cpp +++ b/cocos/network/WebSocket.cpp @@ -668,10 +668,10 @@ void WebSocket::onClientWritable() WsMessage* subThreadMsg = *iter; 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 size_t n = std::min(remaining, c_bufferSize ); + const ssize_t remaining = data->len - data->issued; + const ssize_t n = std::min(remaining, c_bufferSize); WebSocketFrame* frame = nullptr; diff --git a/cocos/physics3d/CCPhysics3DComponent.cpp b/cocos/physics3d/CCPhysics3DComponent.cpp index 39907e98e8..531ad289b7 100644 --- a/cocos/physics3d/CCPhysics3DComponent.cpp +++ b/cocos/physics3d/CCPhysics3DComponent.cpp @@ -100,7 +100,7 @@ void Physics3DComponent::addToPhysicsWorld(Physics3DWorld* world) { auto parent = _owner->getParent(); while (parent) { - for (int i = 0; i < components.size(); i++) { + for (size_t i = 0; i < components.size(); i++) { if (parent == components[i]->getOwner()) { //insert it here diff --git a/cocos/ui/UIRichText.cpp b/cocos/ui/UIRichText.cpp index 36972c9bec..44ead9a89d 100644 --- a/cocos/ui/UIRichText.cpp +++ b/cocos/ui/UIRichText.cpp @@ -1483,7 +1483,7 @@ static int getPrevWord(const std::string& text, int idx) static bool isWrappable(const std::string& text) { - for (int i=0; igetWinSize(); 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]; auto label = Label::createWithTTF(ttfConfig, ttfpaths[i], TextHAlignment::CENTER,0); if( label ) { diff --git a/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp b/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp index c5ccc29eb8..59d318f6ff 100644 --- a/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp +++ b/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp @@ -422,7 +422,7 @@ void Material_parsePerformance::parsingTesting(unsigned int count) { std::clock_t begin = std::clock(); - for(int i=0;i