diff --git a/cocos/2d/CCSpriteFrameCache.cpp b/cocos/2d/CCSpriteFrameCache.cpp index b86d6054c8..c3bbd003de 100644 --- a/cocos/2d/CCSpriteFrameCache.cpp +++ b/cocos/2d/CCSpriteFrameCache.cpp @@ -212,7 +212,7 @@ void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist, Texture void SpriteFrameCache::addSpriteFramesWithFileContent(const std::string& plist_content, Texture2D *texture) { - ValueMap dict = FileUtils::getInstance()->getValueMapFromData(plist_content.c_str(), plist_content.size()); + ValueMap dict = FileUtils::getInstance()->getValueMapFromData(plist_content.c_str(), static_cast(plist_content.size())); addSpriteFramesWithDictionary(dict, texture); } @@ -365,7 +365,7 @@ void SpriteFrameCache::removeSpriteFramesFromFile(const std::string& plist) void SpriteFrameCache::removeSpriteFramesFromFileContent(const std::string& plist_content) { - ValueMap dict = FileUtils::getInstance()->getValueMapFromData(plist_content.data(), plist_content.size()); + ValueMap dict = FileUtils::getInstance()->getValueMapFromData(plist_content.data(), static_cast(plist_content.size())); if (dict.empty()) { CCLOG("cocos2d:SpriteFrameCache:removeSpriteFramesFromFileContent: create dict by fail."); diff --git a/cocos/editor-support/cocostudio/CCActionManagerEx.cpp b/cocos/editor-support/cocostudio/CCActionManagerEx.cpp index 76a15e0bba..c935863e6f 100644 --- a/cocos/editor-support/cocostudio/CCActionManagerEx.cpp +++ b/cocos/editor-support/cocostudio/CCActionManagerEx.cpp @@ -159,8 +159,8 @@ void ActionManagerEx::releaseActions() for (iter = _actionDic.begin(); iter != _actionDic.end(); iter++) { cocos2d::Vector objList = iter->second; - int listCount = objList.size(); - for (int i = 0; i < listCount; i++) { + ssize_t listCount = objList.size(); + for (ssize_t i = 0; i < listCount; i++) { ActionObject* action = objList.at(i); if (action != nullptr) { action->stop(); diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp index d86f04c166..a4359e8604 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -781,7 +781,7 @@ void WidgetPropertiesReader0250::setPropsForCheckBoxFromJsonDictionary(Widget*wi { checkBox->loadTextures(backGroundFileName_tp, backGroundSelectedFileName_tp, frontCrossFileName_tp,backGroundDisabledFileName_tp,frontCrossDisabledFileName_tp); } - checkBox->setSelectedState(DICTOOL->getBooleanValue_json(options, "selectedState")); + checkBox->setSelected(DICTOOL->getBooleanValue_json(options, "selectedState")); setColorPropsForWidgetFromJsonDictionary(widget,options); } diff --git a/cocos/renderer/CCPrimitive.cpp b/cocos/renderer/CCPrimitive.cpp index 8d0d27f63d..357e61fa43 100644 --- a/cocos/renderer/CCPrimitive.cpp +++ b/cocos/renderer/CCPrimitive.cpp @@ -93,7 +93,8 @@ void Primitive::draw() { GLenum type = (_indices->getType() == IndexBuffer::IndexType::INDEX_TYPE_SHORT_16) ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT; glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indices->getVBO()); - glDrawElements((GLenum)_type, _count, type, (GLvoid*)(_start * _indices->getSizePerIndex())); + size_t offet = _start * _indices->getSizePerIndex(); + glDrawElements((GLenum)_type, _count, type, (GLvoid*)offet); } else { diff --git a/cocos/renderer/CCVertexIndexData.cpp b/cocos/renderer/CCVertexIndexData.cpp index 068230e455..cbad4d76ea 100644 --- a/cocos/renderer/CCVertexIndexData.cpp +++ b/cocos/renderer/CCVertexIndexData.cpp @@ -124,8 +124,9 @@ void VertexData::use() { //glEnableVertexAttribArray((GLint)element.second._stream._semantic); glBindBuffer(GL_ARRAY_BUFFER, element.second._buffer->getVBO()); + size_t offet = element.second._stream._offset; glVertexAttribPointer(GLint(element.second._stream._semantic),element.second._stream._size, - element.second._stream._type,element.second._stream._normalize, element.second._buffer->getSizePerVertex(), (GLvoid*)element.second._stream._offset); + element.second._stream._type,element.second._stream._normalize, element.second._buffer->getSizePerVertex(), (GLvoid*)offet); } } diff --git a/cocos/ui/UICheckBox.cpp b/cocos/ui/UICheckBox.cpp index a16d4be64a..9f2d933b0c 100644 --- a/cocos/ui/UICheckBox.cpp +++ b/cocos/ui/UICheckBox.cpp @@ -118,7 +118,7 @@ bool CheckBox::init(const std::string& backGround, break; } - setSelectedState(false); + setSelected(false); loadTextures(backGround, backGroundSeleted, cross, backGroundDisabled, frontCrossDisabled,texType); } while (0); return ret; @@ -128,7 +128,7 @@ bool CheckBox::init() { if (Widget::init()) { - setSelectedState(false); + setSelected(false); return true; } return false; @@ -300,12 +300,12 @@ void CheckBox::releaseUpEvent() Widget::releaseUpEvent(); if (_isSelected){ - setSelectedState(false); + setSelected(false); unSelectedEvent(); } else { - setSelectedState(true); + setSelected(true); selectedEvent(); } } @@ -590,7 +590,7 @@ void CheckBox::copySpecialProperties(Widget *widget) loadTextureFrontCross(checkBox->_frontCrossFileName, checkBox->_frontCrossTexType); loadTextureBackGroundDisabled(checkBox->_backGroundDisabledFileName, checkBox->_backGroundDisabledTexType); loadTextureFrontCrossDisabled(checkBox->_frontCrossDisabledFileName, checkBox->_frontCrossDisabledTexType); - setSelectedState(checkBox->_isSelected); + setSelected(checkBox->_isSelected); _checkBoxEventListener = checkBox->_checkBoxEventListener; _checkBoxEventSelector = checkBox->_checkBoxEventSelector; _checkBoxEventCallback = checkBox->_checkBoxEventCallback; diff --git a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp index 6f0eda505a..be0263bdcc 100644 --- a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp +++ b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp @@ -125,7 +125,7 @@ void DrawLine3D::onDraw(const Mat4 &transform, uint32_t flags) glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V3F_C4B), &(_buffer[0].colors)); - glDrawArrays(GL_LINES, 0, _buffer.size()); + glDrawArrays(GL_LINES, 0, static_cast(_buffer.size())); glDisable(GL_DEPTH_TEST); }