From 1591c7edc8ebf8aefac07603d7b2831ef1c46c26 Mon Sep 17 00:00:00 2001 From: liswei Date: Fri, 10 Jun 2011 17:51:37 +0800 Subject: [PATCH] fixed #512 fix warnings in /Wall flag --- cocos2dx/Android.mk | 2 +- cocos2dx/CCConfiguration.cpp | 18 +++---- cocos2dx/CCDirector.cpp | 2 + cocos2dx/CCScheduler.cpp | 17 +++--- cocos2dx/actions/CCAction.cpp | 3 ++ cocos2dx/actions/CCActionGrid3D.cpp | 2 + cocos2dx/actions/CCActionInstant.cpp | 2 + cocos2dx/actions/CCActionInterval.cpp | 2 + cocos2dx/actions/CCActionManager.cpp | 6 +-- cocos2dx/actions/CCActionTiledGrid.cpp | 2 + cocos2dx/base_nodes/CCAtlasNode.cpp | 8 +-- cocos2dx/base_nodes/CCNode.cpp | 54 +++++++++---------- cocos2dx/cocoa/CCData.cpp | 2 + cocos2dx/cocoa/CCNS.cpp | 12 ++--- cocos2dx/cocoa/CCObject.cpp | 1 + cocos2dx/effects/CCGrabber.cpp | 2 + cocos2dx/effects/CCGrid.cpp | 20 +++---- cocos2dx/include/CCAccelerometerDelegate.h | 2 +- cocos2dx/include/CCAction.h | 6 +-- cocos2dx/include/CCActionCamera.h | 18 +++---- cocos2dx/include/CCActionInstant.h | 6 +-- cocos2dx/include/CCIMEDelegate.h | 10 ++-- cocos2dx/include/CCLabelBMFont.h | 8 +-- cocos2dx/include/CCLayer.h | 2 +- cocos2dx/include/CCMenu.h | 4 +- cocos2dx/include/CCMenuItem.h | 10 ++-- cocos2dx/include/CCMotionStreak.h | 8 +-- cocos2dx/include/CCProtocols.h | 4 +- cocos2dx/include/CCRibbon.h | 4 +- cocos2dx/include/CCTextFieldTTF.h | 9 ++++ cocos2dx/include/CCTouch.h | 4 +- cocos2dx/include/CCTouchDelegateProtocol.h | 32 +++++------ cocos2dx/include/CCTouchDispatcher.h | 7 +-- cocos2dx/include/selector_protocol.h | 12 ++--- cocos2dx/label_nodes/CCLabelBMFont.cpp | 2 +- cocos2dx/label_nodes/CCLabelTTF.cpp | 6 +-- .../CCLayer.cpp | 6 ++- .../CCTransition.cpp | 1 + cocos2dx/menu_nodes/CCMenu.cpp | 12 +++-- cocos2dx/misc_nodes/CCRenderTexture.cpp | 3 ++ cocos2dx/particle_nodes/CCParticleSystem.cpp | 2 + cocos2dx/platform/CCFileUtils.cpp | 14 +++-- cocos2dx/platform/CCImage.cpp | 7 +-- cocos2dx/platform/CCImage.h | 2 +- cocos2dx/platform/CCPlatformConfig.h | 2 +- cocos2dx/platform/CCPlatformMacros.h | 9 ++-- cocos2dx/platform/CCSAXParser.cpp | 1 + .../platform/android/CCEGLView_android.cpp | 6 +-- cocos2dx/platform/android/Cocos2dJni.cpp | 2 +- cocos2dx/platform/platform.cpp | 1 + .../platform/win32/CCAccelerometer_win32.h | 4 +- cocos2dx/platform/win32/CCEGLView_win32.cpp | 2 +- cocos2dx/platform/win32/CCFileUtils_win32.cpp | 2 + cocos2dx/platform/win32/CCImage_win32.cpp | 6 +-- cocos2dx/sprite_nodes/CCSprite.cpp | 3 ++ cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp | 2 +- cocos2dx/sprite_nodes/CCSpriteFrame.cpp | 1 + cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp | 10 ++-- cocos2dx/support/data_support/ccCArray.h | 10 ++-- cocos2dx/text_input_node/CCTextFieldTTF.cpp | 6 +-- cocos2dx/textures/CCTexture2D.cpp | 13 ++--- cocos2dx/textures/CCTextureAtlas.cpp | 16 +++--- cocos2dx/textures/CCTextureCache.cpp | 4 +- .../tileMap_parallax_nodes/CCParallaxNode.cpp | 3 ++ .../tileMap_parallax_nodes/CCTMXLayer.cpp | 13 +++-- .../CCTMXObjectGroup.cpp | 4 +- .../tileMap_parallax_nodes/CCTMXTiledMap.cpp | 4 +- .../tileMap_parallax_nodes/CCTMXXMLParser.cpp | 29 +++++----- .../tileMap_parallax_nodes/CCTileMapAtlas.cpp | 4 +- .../touch_dispatcher/CCTouchDispatcher.cpp | 2 + 70 files changed, 294 insertions(+), 221 deletions(-) diff --git a/cocos2dx/Android.mk b/cocos2dx/Android.mk index 394737a90c..b3e308ac92 100644 --- a/cocos2dx/Android.mk +++ b/cocos2dx/Android.mk @@ -139,6 +139,6 @@ LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/platform/third_party/android/l -lskia # define the macro to compile through support/zip_support/ioapi.c -LOCAL_CFLAGS := -DUSE_FILE32API +LOCAL_CFLAGS := -DUSE_FILE32API -Wno-unused-value include $(BUILD_SHARED_LIBRARY) diff --git a/cocos2dx/CCConfiguration.cpp b/cocos2dx/CCConfiguration.cpp index 8b3be61b37..1f0695f958 100644 --- a/cocos2dx/CCConfiguration.cpp +++ b/cocos2dx/CCConfiguration.cpp @@ -36,14 +36,14 @@ static CCConfiguration g_SharedConfiguration; static char *g_pGlExtensions; CCConfiguration::CCConfiguration(void) -: m_bSupportsBGRA8888(false) -, m_bSupportsDiscardFramebuffer(false) -, m_bSupportsNPOT(false) -, m_bSupportsPVRTC(false) +:m_nMaxTextureSize(0) , m_nMaxModelviewStackDepth(0) -, m_nMaxSamplesAllowed(0) -, m_nMaxTextureSize(0) +, m_bSupportsPVRTC(false) +, m_bSupportsNPOT(false) +, m_bSupportsBGRA8888(false) +, m_bSupportsDiscardFramebuffer(false) , m_uOSVersion(0) +, m_nMaxSamplesAllowed(0) { } @@ -90,15 +90,15 @@ CCGlesVersion CCConfiguration::getGlesVersion() { // To get the Opengl ES version std::string strVersion((char *)glGetString(GL_VERSION)); - if (strVersion.find("1.0") != -1) + if ((int)strVersion.find("1.0") != -1) { return GLES_VER_1_0; } - else if (strVersion.find("1.1") != -1) + else if ((int)strVersion.find("1.1") != -1) { return GLES_VER_1_1; } - else if (strVersion.find("2.0") != -1) + else if ((int)strVersion.find("2.0") != -1) { return GLES_VER_2_0; } diff --git a/cocos2dx/CCDirector.cpp b/cocos2dx/CCDirector.cpp index f1532716ea..66d6d272be 100644 --- a/cocos2dx/CCDirector.cpp +++ b/cocos2dx/CCDirector.cpp @@ -479,6 +479,7 @@ CCSize CCDirector::getDisplaySizeInPixels(void) void CCDirector::reshapeProjection(CCSize newWindowSize) { + CC_UNUSED_PARAM(newWindowSize); m_obWinSizeInPoints = m_pobOpenGLView->getSize(); m_obWinSizeInPixels = CCSizeMake(m_obWinSizeInPoints.width * m_fContentScaleFactor, m_obWinSizeInPoints.height * m_fContentScaleFactor); @@ -748,6 +749,7 @@ tPixelFormat CCDirector::getPiexFormat(void) bool CCDirector::setDirectorType(ccDirectorType obDirectorType) { + CC_UNUSED_PARAM(obDirectorType); // we only support CCDisplayLinkDirector CCDirector::sharedDirector(); diff --git a/cocos2dx/CCScheduler.cpp b/cocos2dx/CCScheduler.cpp index 09d4437e0e..14d081880f 100644 --- a/cocos2dx/CCScheduler.cpp +++ b/cocos2dx/CCScheduler.cpp @@ -128,14 +128,14 @@ void CCTimer::update(ccTime dt) static CCScheduler *pSharedScheduler; CCScheduler::CCScheduler(void) -: m_bCurrentTargetSalvaged(false) -, m_fTimeScale(0.0) -, m_pCurrentTarget(NULL) -, m_pHashForSelectors(NULL) -, m_pHashForUpdates(NULL) -, m_pUpdates0List(NULL) +: m_fTimeScale(0.0) , m_pUpdatesNegList(NULL) +, m_pUpdates0List(NULL) , m_pUpdatesPosList(NULL) +, m_pHashForUpdates(NULL) +, m_pHashForSelectors(NULL) +, m_pCurrentTarget(NULL) +, m_bCurrentTargetSalvaged(false) { assert(pSharedScheduler == NULL); } @@ -191,12 +191,15 @@ void CCScheduler::removeHashElement(_hashSelectorEntry *pElement) void CCScheduler::scheduleTimer(CCTimer *pTimer) { + CC_UNUSED_PARAM(pTimer); assert(false); } void CCScheduler::unscheduleTimer(CCTimer *pTimer) { - assert(false); + //CC_UNUSED_PARAM(pTimer); + pTimer = NULL; + assert(false); } void CCScheduler::unscheduleAllTimers() diff --git a/cocos2dx/actions/CCAction.cpp b/cocos2dx/actions/CCAction.cpp index 711cc985ef..be9782c527 100644 --- a/cocos2dx/actions/CCAction.cpp +++ b/cocos2dx/actions/CCAction.cpp @@ -94,11 +94,13 @@ bool CCAction::isDone() void CCAction::step(ccTime dt) { + CC_UNUSED_PARAM(dt); CCLOG("[Action step]. override me"); } void CCAction::update(ccTime time) { + CC_UNUSED_PARAM(time); CCLOG("[Action update]. override me"); } @@ -291,6 +293,7 @@ CCObject *CCFollow::copyWithZone(CCZone *pZone) } void CCFollow::step(ccTime dt) { + CC_UNUSED_PARAM(dt); #define CLAMP(x,y,z) MIN(MAX(x,y),z) if(m_bBoundarySet) diff --git a/cocos2dx/actions/CCActionGrid3D.cpp b/cocos2dx/actions/CCActionGrid3D.cpp index 2d490569f6..f182644b93 100644 --- a/cocos2dx/actions/CCActionGrid3D.cpp +++ b/cocos2dx/actions/CCActionGrid3D.cpp @@ -411,6 +411,7 @@ namespace cocos2d void CCLens3D::update(cocos2d::ccTime time) { + CC_UNUSED_PARAM(time); if (m_bDirty) { int i, j; @@ -601,6 +602,7 @@ namespace cocos2d void CCShaky3D::update(cocos2d::ccTime time) { + CC_UNUSED_PARAM(time); int i, j; for (i = 0; i < (m_sGridSize.x+1); ++i) diff --git a/cocos2dx/actions/CCActionInstant.cpp b/cocos2dx/actions/CCActionInstant.cpp index 98c368c26f..6b1aad7e39 100644 --- a/cocos2dx/actions/CCActionInstant.cpp +++ b/cocos2dx/actions/CCActionInstant.cpp @@ -57,10 +57,12 @@ namespace cocos2d { } void CCActionInstant::step(ccTime dt) { + CC_UNUSED_PARAM(dt); update(1); } void CCActionInstant::update(ccTime time) { + CC_UNUSED_PARAM(time); // ignore } CCFiniteTimeAction * CCActionInstant::reverse() diff --git a/cocos2dx/actions/CCActionInterval.cpp b/cocos2dx/actions/CCActionInterval.cpp index bf177ef4d9..0aa3e744df 100644 --- a/cocos2dx/actions/CCActionInterval.cpp +++ b/cocos2dx/actions/CCActionInterval.cpp @@ -114,6 +114,7 @@ void CCActionInterval::step(ccTime dt) void CCActionInterval::setAmplitudeRate(CGFloat amp) { + CC_UNUSED_PARAM(amp); // Abstract class needs implementation assert(0); } @@ -1710,6 +1711,7 @@ CCObject* CCDelayTime::copyWithZone(cocos2d::CCZone *pZone) void CCDelayTime::update(cocos2d::ccTime time) { + CC_UNUSED_PARAM(time); return; } diff --git a/cocos2dx/actions/CCActionManager.cpp b/cocos2dx/actions/CCActionManager.cpp index adc4f88d4e..ee1d8ee150 100644 --- a/cocos2dx/actions/CCActionManager.cpp +++ b/cocos2dx/actions/CCActionManager.cpp @@ -84,8 +84,8 @@ void CCActionManager::selectorProtocolRelease() } CCActionManager::CCActionManager(void) -: m_pCurrentTarget(NULL), - m_pTargets(NULL), +: m_pTargets(NULL), + m_pCurrentTarget(NULL), m_bCurrentTargetSalvaged(false) { assert(gSharedManager == NULL); @@ -286,7 +286,7 @@ void CCActionManager::removeAction(cocos2d::CCAction *pAction) if (pElement) { unsigned int i = ccArrayGetIndexOfObject(pElement->actions, pAction); - if (i != -1) + if ((int)i != -1) { removeActionAtIndex(i, pElement); } diff --git a/cocos2dx/actions/CCActionTiledGrid.cpp b/cocos2dx/actions/CCActionTiledGrid.cpp index 228435adfc..2813fd776a 100644 --- a/cocos2dx/actions/CCActionTiledGrid.cpp +++ b/cocos2dx/actions/CCActionTiledGrid.cpp @@ -98,6 +98,7 @@ namespace cocos2d void CCShakyTiles3D::update(cocos2d::ccTime time) { + CC_UNUSED_PARAM(time); int i, j; for (i = 0; i < m_sGridSize.x; ++i) @@ -191,6 +192,7 @@ namespace cocos2d void CCShatteredTiles3D::update(cocos2d::ccTime time) { + CC_UNUSED_PARAM(time); int i, j; if (m_bOnce == false) diff --git a/cocos2dx/base_nodes/CCAtlasNode.cpp b/cocos2dx/base_nodes/CCAtlasNode.cpp index 27adc86ab0..b67c9bd840 100644 --- a/cocos2dx/base_nodes/CCAtlasNode.cpp +++ b/cocos2dx/base_nodes/CCAtlasNode.cpp @@ -33,13 +33,13 @@ namespace cocos2d { // CCAtlasNode - Creation & Init CCAtlasNode::CCAtlasNode() -: m_pTextureAtlas(NULL) -, m_bIsOpacityModifyRGB(false) +: m_nItemsPerRow(0) +, m_nItemsPerColumn(0) , m_nItemWidth(0) , m_nItemHeight(0) +, m_pTextureAtlas(NULL) +, m_bIsOpacityModifyRGB(false) , m_cOpacity(0) -, m_nItemsPerRow(0) -, m_nItemsPerColumn(0) { } diff --git a/cocos2dx/base_nodes/CCNode.cpp b/cocos2dx/base_nodes/CCNode.cpp index d92b6e6383..85dc5d588b 100644 --- a/cocos2dx/base_nodes/CCNode.cpp +++ b/cocos2dx/base_nodes/CCNode.cpp @@ -43,35 +43,35 @@ THE SOFTWARE. namespace cocos2d { CCNode::CCNode(void) -:m_bIsRunning(false) -,m_fRotation(0.0f) -,m_fScaleX(1.0f) -,m_fScaleY(1.0f) -,m_tPosition(CCPointZero) -,m_tPositionInPixels(CCPointZero) -,m_tAnchorPointInPixels(CCPointZero) -,m_tAnchorPoint(CCPointZero) -,m_tContentSize(CCSizeZero) -,m_tContentSizeInPixels(CCSizeZero) -// "whole screen" objects. like Scenes and Layers, should set isRelativeAnchorPoint to false -,m_bIsRelativeAnchorPoint(true) -,m_bIsTransformDirty(true) -,m_bIsInverseDirty(true) -#ifdef CC_NODE_TRANSFORM_USING_AFFINE_MATRIX -,m_bIsTransformGLDirty(true) -#endif -,m_fVertexZ(0.0f) -,m_pGrid(NULL) -,m_bIsVisible(true) -,m_nTag(kCCNodeTagInvalid) -,m_nZOrder(0) -// lazy alloc -,m_pCamera(NULL) +: m_nZOrder(0) +, m_fVertexZ(0.0f) +, m_fRotation(0.0f) +, m_fScaleX(1.0f) +, m_fScaleY(1.0f) +, m_tPosition(CCPointZero) +, m_tPositionInPixels(CCPointZero) // children (lazy allocs) -,m_pChildren(NULL) +, m_pChildren(NULL) +// lazy alloc +, m_pCamera(NULL) +, m_pGrid(NULL) +, m_bIsVisible(true) +, m_tAnchorPoint(CCPointZero) +, m_tAnchorPointInPixels(CCPointZero) +, m_tContentSize(CCSizeZero) +, m_tContentSizeInPixels(CCSizeZero) +, m_bIsRunning(false) +, m_pParent(NULL) +// "whole screen" objects. like Scenes and Layers, should set isRelativeAnchorPoint to false +, m_bIsRelativeAnchorPoint(true) +, m_nTag(kCCNodeTagInvalid) // userData is always inited as nil -,m_pUserData(NULL) -,m_pParent(NULL) +, m_pUserData(NULL) +, m_bIsTransformDirty(true) +, m_bIsInverseDirty(true) +#ifdef CC_NODE_TRANSFORM_USING_AFFINE_MATRIX +, m_bIsTransformGLDirty(true) +#endif { // nothing } diff --git a/cocos2dx/cocoa/CCData.cpp b/cocos2dx/cocoa/CCData.cpp index 01539c3fa9..a1cedd823e 100644 --- a/cocos2dx/cocoa/CCData.cpp +++ b/cocos2dx/cocoa/CCData.cpp @@ -67,6 +67,8 @@ void* CCData::bytes(void) //@todo implement CCData* CCData::dataWithBytes(unsigned char *pBytes, int size) { + CC_UNUSED_PARAM(pBytes); + CC_UNUSED_PARAM(size); return NULL; } }//namespace cocos2d diff --git a/cocos2dx/cocoa/CCNS.cpp b/cocos2dx/cocoa/CCNS.cpp index bbf96d9d7a..7e74974f3f 100644 --- a/cocos2dx/cocoa/CCNS.cpp +++ b/cocos2dx/cocoa/CCNS.cpp @@ -64,7 +64,7 @@ bool splitWithForm(const char* pStr, strArray& strs) int nPosRight = content.find('}'); // don't have '{' and '}' - CC_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos); + CC_BREAK_IF(nPosLeft == (int)std::string::npos || nPosRight == (int)std::string::npos); // '}' is before '{' CC_BREAK_IF(nPosLeft > nPosRight); @@ -75,7 +75,7 @@ bool splitWithForm(const char* pStr, strArray& strs) int nPos1 = pointStr.find('{'); int nPos2 = pointStr.find('}'); // contain '{' or '}' - CC_BREAK_IF(nPos1 != std::string::npos || nPos2 != std::string::npos); + CC_BREAK_IF(nPos1 != (int)std::string::npos || nPos2 != (int)std::string::npos); split(pointStr, ",", strs); if (strs.size() != 2 || strs[0].length() == 0 || strs[1].length() == 0) @@ -107,19 +107,19 @@ namespace cocos2d int nPosRight = content.find('}'); for (int i = 1; i < 3; ++i) { - if (nPosRight == std::string::npos) + if (nPosRight == (int)std::string::npos) { break; } nPosRight = content.find('}', nPosRight + 1); } - CC_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos); + CC_BREAK_IF(nPosLeft == (int)std::string::npos || nPosRight == (int)std::string::npos); content = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1); int nPointEnd = content.find('}'); - CC_BREAK_IF(nPointEnd == std::string::npos); + CC_BREAK_IF(nPointEnd == (int)std::string::npos); nPointEnd = content.find(',', nPointEnd); - CC_BREAK_IF(nPointEnd == std::string::npos); + CC_BREAK_IF(nPointEnd == (int)std::string::npos); // get the point string and size string std::string pointStr = content.substr(0, nPointEnd); diff --git a/cocos2dx/cocoa/CCObject.cpp b/cocos2dx/cocoa/CCObject.cpp index ed3a66dd4b..2fe509c973 100644 --- a/cocos2dx/cocoa/CCObject.cpp +++ b/cocos2dx/cocoa/CCObject.cpp @@ -30,6 +30,7 @@ namespace cocos2d { CCObject* CCCopying::copyWithZone(CCZone *pZone) { + CC_UNUSED_PARAM(pZone); assert(0); return NULL; } diff --git a/cocos2dx/effects/CCGrabber.cpp b/cocos2dx/effects/CCGrabber.cpp index 7530b0624f..3c98024a07 100644 --- a/cocos2dx/effects/CCGrabber.cpp +++ b/cocos2dx/effects/CCGrabber.cpp @@ -76,6 +76,7 @@ namespace cocos2d void CCGrabber::beforeRender(cocos2d::CCTexture2D *pTexture) { + CC_UNUSED_PARAM(pTexture); // If the gles version is lower than GLES_VER_1_0, // all the functions in CCGrabber return directly. if (m_eGlesVersion <= GLES_VER_1_0) @@ -101,6 +102,7 @@ namespace cocos2d void CCGrabber::afterRender(cocos2d::CCTexture2D *pTexture) { + CC_UNUSED_PARAM(pTexture); // If the gles version is lower than GLES_VER_1_0, // all the functions in CCGrabber return directly. if (m_eGlesVersion <= GLES_VER_1_0) diff --git a/cocos2dx/effects/CCGrid.cpp b/cocos2dx/effects/CCGrid.cpp index 5d78c9bd45..07f124cc97 100644 --- a/cocos2dx/effects/CCGrid.cpp +++ b/cocos2dx/effects/CCGrid.cpp @@ -377,10 +377,10 @@ namespace cocos2d float y1 = y * m_obStep.y; float y2= y1 + m_obStep.y; - GLushort a = x * (m_sGridSize.y + 1) + y; - GLushort b = (x + 1) * (m_sGridSize.y + 1) + y; - GLushort c = (x + 1) * (m_sGridSize.y + 1) + (y + 1); - GLushort d = x * (m_sGridSize.y + 1) + (y + 1); + GLushort a = (GLushort)(x * (m_sGridSize.y + 1) + y); + GLushort b = (GLushort)((x + 1) * (m_sGridSize.y + 1) + y); + GLushort c = (GLushort)((x + 1) * (m_sGridSize.y + 1) + (y + 1)); + GLushort d = (GLushort)(x * (m_sGridSize.y + 1) + (y + 1)); GLushort tempidx[6] = {a, b, d, b, c, d}; @@ -587,13 +587,13 @@ namespace cocos2d for (x = 0; x < numQuads; x++) { - idxArray[x*6+0] = x * 4 + 0; - idxArray[x*6+1] = x * 4 + 1; - idxArray[x*6+2] = x * 4 + 2; + idxArray[x*6+0] = (GLushort)(x * 4 + 0); + idxArray[x*6+1] = (GLushort)(x * 4 + 1); + idxArray[x*6+2] = (GLushort)(x * 4 + 2); - idxArray[x*6+3] = x * 4 + 1; - idxArray[x*6+4] = x * 4 + 2; - idxArray[x*6+5] = x * 4 + 3; + idxArray[x*6+3] = (GLushort)(x * 4 + 1); + idxArray[x*6+4] = (GLushort)(x * 4 + 2); + idxArray[x*6+5] = (GLushort)(x * 4 + 3); } memcpy(m_pOriginalVertices, m_pVertices, numQuads * 12 * sizeof(GLfloat)); diff --git a/cocos2dx/include/CCAccelerometerDelegate.h b/cocos2dx/include/CCAccelerometerDelegate.h index d8aac55501..1233284f9b 100644 --- a/cocos2dx/include/CCAccelerometerDelegate.h +++ b/cocos2dx/include/CCAccelerometerDelegate.h @@ -48,7 +48,7 @@ receiving acceleration-related data from the system. class CC_DLL CCAccelerometerDelegate { public: - virtual void didAccelerate(CCAcceleration* pAccelerationValue) {} + virtual void didAccelerate(CCAcceleration* pAccelerationValue) {CC_UNUSED_PARAM(pAccelerationValue);} //! call the release() in child layer virtual void AccelerometerDestroy(void) {} diff --git a/cocos2dx/include/CCAction.h b/cocos2dx/include/CCAction.h index 16fc2d6ed8..36d43fcd0d 100644 --- a/cocos2dx/include/CCAction.h +++ b/cocos2dx/include/CCAction.h @@ -194,12 +194,12 @@ class CC_DLL CCFollow : public CCAction public: CCFollow() : m_pobFollowedNode(NULL) - , m_bBoundaryFullyCovered(false) - , m_bBoundarySet(false) - , m_fBottomBoundary(0.0) + , m_bBoundarySet(false) + , m_bBoundaryFullyCovered(false) , m_fLeftBoundary(0.0) , m_fRightBoundary(0.0) , m_fTopBoundary(0.0) + , m_fBottomBoundary(0.0) {} virtual ~CCFollow(void); diff --git a/cocos2dx/include/CCActionCamera.h b/cocos2dx/include/CCActionCamera.h index 92d8c8d9f0..da0c24a642 100644 --- a/cocos2dx/include/CCActionCamera.h +++ b/cocos2dx/include/CCActionCamera.h @@ -73,16 +73,16 @@ namespace cocos2d { { public: CCOrbitCamera() - : m_fAngleX(0.0) - , m_fAngleZ(0.0) + : m_fRadius(0.0) + , m_fDeltaRadius(0.0) + , m_fAngleZ(0.0) + , m_fDeltaAngleZ(0.0) + , m_fAngleX(0.0) , m_fDeltaAngleX(0.0) - , m_fDeltaAngleZ(0.0) - , m_fDeltaRadius(0.0) - , m_fRadDeltaX(0.0) - , m_fRadDeltaZ(0.0) - , m_fRadius(0.0) - , m_fRadX(0.0) - , m_fRadZ(0.0) + , m_fRadZ(0.0) + , m_fRadDeltaZ(0.0) + , m_fRadX(0.0) + , m_fRadDeltaX(0.0) {} ~CCOrbitCamera(){} /** creates a CCOrbitCamera action with radius, delta-radius, z, deltaZ, x, deltaX */ diff --git a/cocos2dx/include/CCActionInstant.h b/cocos2dx/include/CCActionInstant.h index b87d70144d..1fc3e4ca32 100644 --- a/cocos2dx/include/CCActionInstant.h +++ b/cocos2dx/include/CCActionInstant.h @@ -171,9 +171,9 @@ namespace cocos2d { { public: CCCallFunc() - : m_pCallFunc(NULL) - , m_pSelectorTarget(NULL) - { + : m_pSelectorTarget(NULL) + , m_pCallFunc(NULL) + { } virtual ~CCCallFunc() { diff --git a/cocos2dx/include/CCIMEDelegate.h b/cocos2dx/include/CCIMEDelegate.h index b260afb712..f4c72ddefd 100644 --- a/cocos2dx/include/CCIMEDelegate.h +++ b/cocos2dx/include/CCIMEDelegate.h @@ -74,7 +74,7 @@ protected: /** @brief Called by CCIMEDispatcher when some text input from IME. */ - virtual void insertText(const char * text, int len) {} + virtual void insertText(const char * text, int len) {CC_UNUSED_PARAM(text);CC_UNUSED_PARAM(len);} /** @brief Called by CCIMEDispatcher when user clicked the backward key. @@ -89,10 +89,10 @@ protected: ////////////////////////////////////////////////////////////////////////// // keyboard show/hide notification ////////////////////////////////////////////////////////////////////////// - virtual void keyboardWillShow(CCIMEKeyboardNotificationInfo& info) {} - virtual void keyboardDidShow(CCIMEKeyboardNotificationInfo& info) {} - virtual void keyboardWillHide(CCIMEKeyboardNotificationInfo& info) {} - virtual void keyboardDidHide(CCIMEKeyboardNotificationInfo& info) {} + virtual void keyboardWillShow(CCIMEKeyboardNotificationInfo& info) {CC_UNUSED_PARAM(info);} + virtual void keyboardDidShow(CCIMEKeyboardNotificationInfo& info) {CC_UNUSED_PARAM(info);} + virtual void keyboardWillHide(CCIMEKeyboardNotificationInfo& info) {CC_UNUSED_PARAM(info);} + virtual void keyboardDidHide(CCIMEKeyboardNotificationInfo& info) {CC_UNUSED_PARAM(info);} protected: CCIMEDelegate(); diff --git a/cocos2dx/include/CCLabelBMFont.h b/cocos2dx/include/CCLabelBMFont.h index c5ce85c35f..5471eb6a1b 100644 --- a/cocos2dx/include/CCLabelBMFont.h +++ b/cocos2dx/include/CCLabelBMFont.h @@ -85,8 +85,8 @@ namespace cocos2d{ struct _KerningHashElement *m_pKerningDictionary; public: CCBMFontConfiguration() - : m_pKerningDictionary(NULL) - , m_uCommonHeight(0) + : m_uCommonHeight(0) + , m_pKerningDictionary(NULL) {} virtual ~CCBMFontConfiguration(); char * description(); @@ -148,10 +148,10 @@ namespace cocos2d{ CCBMFontConfiguration *m_pConfiguration; public: CCLabelBMFont() - : m_pConfiguration(NULL) + : m_cOpacity(0) , m_bIsOpacityModifyRGB(false) - , m_cOpacity(0) , m_sString("") + , m_pConfiguration(NULL) {} virtual ~CCLabelBMFont(); /** Purges the cached data. diff --git a/cocos2dx/include/CCLayer.h b/cocos2dx/include/CCLayer.h index 12f9feb1f0..ad1e41dbf3 100644 --- a/cocos2dx/include/CCLayer.h +++ b/cocos2dx/include/CCLayer.h @@ -58,7 +58,7 @@ public: virtual void destroy(void); virtual void keep(void); - virtual void didAccelerate(CCAcceleration* pAccelerationValue) {} + virtual void didAccelerate(CCAcceleration* pAccelerationValue) {CC_UNUSED_PARAM(pAccelerationValue);} virtual void AccelerometerDestroy(void); virtual void AccelerometerKeep(void); diff --git a/cocos2dx/include/CCMenu.h b/cocos2dx/include/CCMenu.h index d689eea284..f60fcc08c9 100644 --- a/cocos2dx/include/CCMenu.h +++ b/cocos2dx/include/CCMenu.h @@ -117,8 +117,8 @@ namespace cocos2d{ protected: tCCMenuState m_eState; - CCMenuItem *m_pSelectedItem; - GLubyte m_cOpacity; + GLubyte m_cOpacity; + CCMenuItem *m_pSelectedItem; ccColor3B m_tColor; }; } diff --git a/cocos2dx/include/CCMenuItem.h b/cocos2dx/include/CCMenuItem.h index c2992c617b..b38a9715fb 100644 --- a/cocos2dx/include/CCMenuItem.h +++ b/cocos2dx/include/CCMenuItem.h @@ -51,9 +51,9 @@ namespace cocos2d{ CC_PROPERTY(bool, m_bIsEnabled, IsEnabled); public: CCMenuItem() - : m_pListener(NULL) - , m_bIsEnabled(false) - , m_bIsSelected(false) + : m_bIsSelected(false) + , m_bIsEnabled(false) + , m_pListener(NULL) , m_pfnSelector(NULL) {} virtual ~CCMenuItem(){} @@ -248,8 +248,8 @@ namespace cocos2d{ public: CCMenuItemToggle() : m_cOpacity(0) - , m_pSubItems(NULL) - , m_uSelectedIndex(0) + , m_uSelectedIndex(0) + , m_pSubItems(NULL) {} virtual ~CCMenuItemToggle(); /** creates a menu item from a list of items with a target/selector */ diff --git a/cocos2dx/include/CCMotionStreak.h b/cocos2dx/include/CCMotionStreak.h index b9d91a0272..fdff1c89f1 100644 --- a/cocos2dx/include/CCMotionStreak.h +++ b/cocos2dx/include/CCMotionStreak.h @@ -57,10 +57,10 @@ class CC_DLL CCMotionStreak : public CCNode, public CCTextureProtocol CC_PROPERTY(ccBlendFunc, m_tBlendFunc, BlendFunc) public: CCMotionStreak() - : m_fSegThreshold(0.0) - , m_fWidth(0.0) - , m_pRibbon(NULL) - , m_pTexture(NULL) + : m_pRibbon(NULL) + , m_pTexture(NULL) + , m_fSegThreshold(0.0) + , m_fWidth(0.0) {} virtual ~CCMotionStreak(){} /** creates the a MotionStreak. The image will be loaded using the TextureMgr. */ diff --git a/cocos2dx/include/CCProtocols.h b/cocos2dx/include/CCProtocols.h index 6632fe8bd7..c51f01e978 100644 --- a/cocos2dx/include/CCProtocols.h +++ b/cocos2dx/include/CCProtocols.h @@ -63,7 +63,7 @@ public: Textures with premultiplied alpha will have this property by default on YES. Otherwise the default value is NO @since v0.8 */ - virtual void setIsOpacityModifyRGB(bool bValue) {} + virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);} /** returns whether or not the opacity will be applied using glColor(R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity); @since v0.8 @@ -101,7 +101,7 @@ public: virtual CCTexture2D* getTexture(void) = 0; // sets a new texture. it will be retained - virtual void setTexture(CCTexture2D *texture) {} + virtual void setTexture(CCTexture2D *texture) {CC_UNUSED_PARAM(texture);} }; //! @brief Common interface for Labels diff --git a/cocos2dx/include/CCRibbon.h b/cocos2dx/include/CCRibbon.h index 0fef2fa4ff..702e78bf66 100644 --- a/cocos2dx/include/CCRibbon.h +++ b/cocos2dx/include/CCRibbon.h @@ -108,8 +108,8 @@ public: public: CCRibbonSegment() : m_bFinished(false) - , m_uBegin(0) - , m_uEnd(0) + , m_uEnd(0) + , m_uBegin(0) {} virtual ~CCRibbonSegment(); char * description(); diff --git a/cocos2dx/include/CCTextFieldTTF.h b/cocos2dx/include/CCTextFieldTTF.h index 26ba54ea0d..8f25d7105b 100644 --- a/cocos2dx/include/CCTextFieldTTF.h +++ b/cocos2dx/include/CCTextFieldTTF.h @@ -41,6 +41,7 @@ public: */ virtual bool onTextFieldAttachWithIME(CCTextFieldTTF * sender) { + CC_UNUSED_PARAM(sender); return false; } @@ -49,6 +50,7 @@ public: */ virtual bool onTextFieldDetachWithIME(CCTextFieldTTF * sender) { + CC_UNUSED_PARAM(sender); return false; } @@ -57,6 +59,9 @@ public: */ virtual bool onTextFieldInsertText(CCTextFieldTTF * sender, const char * text, int nLen) { + CC_UNUSED_PARAM(sender); + CC_UNUSED_PARAM(text); + CC_UNUSED_PARAM(nLen); return false; } @@ -65,6 +70,9 @@ public: */ virtual bool onTextFieldDeleteBackward(CCTextFieldTTF * sender, const char * delText, int nLen) { + CC_UNUSED_PARAM(sender); + CC_UNUSED_PARAM(delText); + CC_UNUSED_PARAM(nLen); return false; } @@ -73,6 +81,7 @@ public: */ virtual bool onDraw(CCTextFieldTTF * sender) { + CC_UNUSED_PARAM(sender); return false; } }; diff --git a/cocos2dx/include/CCTouch.h b/cocos2dx/include/CCTouch.h index 3391ba62b4..9b52a1657b 100644 --- a/cocos2dx/include/CCTouch.h +++ b/cocos2dx/include/CCTouch.h @@ -36,8 +36,8 @@ public: CCTouch() {} CCTouch(int nViewId, float x, float y) : m_nViewId(nViewId), m_point(x, y), m_prevPoint(x, y) {} - CCPoint locationInView(int nViewId) { return m_point; } - CCPoint previousLocationInView(int nViewId) { return m_prevPoint; } + CCPoint locationInView(int nViewId) {CC_UNUSED_PARAM(nViewId); return m_point; } + CCPoint previousLocationInView(int nViewId) {CC_UNUSED_PARAM(nViewId); return m_prevPoint; } int view() { return m_nViewId; } void SetTouchInfo(int nViewId, float x, float y) diff --git a/cocos2dx/include/CCTouchDelegateProtocol.h b/cocos2dx/include/CCTouchDelegateProtocol.h index ded8f5320e..6e7d3213be 100644 --- a/cocos2dx/include/CCTouchDelegateProtocol.h +++ b/cocos2dx/include/CCTouchDelegateProtocol.h @@ -56,18 +56,18 @@ public: //! call the retain() in child (layer or menu) virtual void keep(void) {} - virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent) { return false;}; + virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent); return false;}; // optional - virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent) {} - virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent) {} - virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent) {} + virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} + virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} + virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} // optional - virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent) {} - virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent) {} - virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent) {} - virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent) {} + virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} + virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} + virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} + virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} }; /** @brief @@ -90,12 +90,12 @@ public: /** Return YES to claim the touch. @since v0 */ - virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent) { return false;}; + virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent) { CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);return false;}; // optional - virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent) {} - virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent) {} - virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent) {} + virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} + virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} + virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} }; /** @brief @@ -107,10 +107,10 @@ public: public: CCStandardTouchDelegate() { m_eTouchDelegateType = ccTouchDelegateStandardBit; } // optional - virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent) {} - virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent) {} - virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent) {} - virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent) {} + virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} + virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} + virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} + virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} }; }//namespace cocos2d diff --git a/cocos2dx/include/CCTouchDispatcher.h b/cocos2dx/include/CCTouchDispatcher.h index 2ff252375a..e17bb6260a 100644 --- a/cocos2dx/include/CCTouchDispatcher.h +++ b/cocos2dx/include/CCTouchDispatcher.h @@ -96,10 +96,11 @@ public: ~CCTouchDispatcher(); bool init(void); CCTouchDispatcher() - : m_pHandlersToAdd(NULL) + : m_pTargetedHandlers(NULL) + , m_pStandardHandlers(NULL) + , m_pHandlersToAdd(NULL) , m_pHandlersToRemove(NULL) - , m_pStandardHandlers(NULL) - , m_pTargetedHandlers(NULL) + {} public: diff --git a/cocos2dx/include/selector_protocol.h b/cocos2dx/include/selector_protocol.h index a874625874..9ddfb893ca 100644 --- a/cocos2dx/include/selector_protocol.h +++ b/cocos2dx/include/selector_protocol.h @@ -35,13 +35,13 @@ class CCEvent; class CC_DLL SelectorProtocol { public: - virtual void update(ccTime dt) {}; - virtual void tick(ccTime dt){}; + virtual void update(ccTime dt) {CC_UNUSED_PARAM(dt);}; + virtual void tick(ccTime dt){CC_UNUSED_PARAM(dt);}; virtual void callfunc(){}; - virtual void callfunc(CCNode* pSender){}; - virtual void callfunc(CCNode* pSender, void* pData){}; - virtual void menuHandler(CCObject* pSender){}; - virtual void eventHandler(CCEvent* pEvent) {}; + virtual void callfunc(CCNode* pSender){CC_UNUSED_PARAM(pSender);}; + virtual void callfunc(CCNode* pSender, void* pData){CC_UNUSED_PARAM(pSender);CC_UNUSED_PARAM(pData);}; + virtual void menuHandler(CCObject* pSender){CC_UNUSED_PARAM(pSender);}; + virtual void eventHandler(CCEvent* pEvent) {CC_UNUSED_PARAM(pEvent);}; // the child call responding retain/release function virtual void selectorProtocolRetain(void) {}; diff --git a/cocos2dx/label_nodes/CCLabelBMFont.cpp b/cocos2dx/label_nodes/CCLabelBMFont.cpp index e87e541fc5..21f48c468a 100644 --- a/cocos2dx/label_nodes/CCLabelBMFont.cpp +++ b/cocos2dx/label_nodes/CCLabelBMFont.cpp @@ -142,7 +142,7 @@ namespace cocos2d{ while (strLeft.length() > 0) { int pos = strLeft.find('\n'); - if (pos != std::string::npos) + if (pos != (int)std::string::npos) { // the data is more than a line.get one line line = strLeft.substr(0, pos); diff --git a/cocos2dx/label_nodes/CCLabelTTF.cpp b/cocos2dx/label_nodes/CCLabelTTF.cpp index 6b9abef6a3..f556ba99be 100644 --- a/cocos2dx/label_nodes/CCLabelTTF.cpp +++ b/cocos2dx/label_nodes/CCLabelTTF.cpp @@ -29,10 +29,10 @@ namespace cocos2d{ //CCLabelTTF // CCLabelTTF::CCLabelTTF() - : m_pFontName(NULL) + : m_eAlignment(CCTextAlignmentCenter) + , m_pFontName(NULL) + , m_fFontSize(0.0) , m_pString(NULL) - , m_fFontSize(0.0) - , m_eAlignment(CCTextAlignmentCenter) { } diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp index fdb4a20d95..33d25b35b7 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp @@ -53,11 +53,11 @@ bool CCLayer::init() do { CCDirector * pDirector; - CC_BREAK_IF( ! (pDirector = CCDirector::sharedDirector()) ); + CC_BREAK_IF(!(pDirector = CCDirector::sharedDirector())); this->setContentSize(pDirector->getWinSize()); // success bRet = true; - } while (0); + } while(0); return bRet; } @@ -251,6 +251,8 @@ void CCLayer::onEnterTransitionDidFinish() bool CCLayer::ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent) { + CC_UNUSED_PARAM(pTouch); + CC_UNUSED_PARAM(pEvent); CCAssert(false, "Layer#ccTouchBegan override me"); return true; } diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCTransition.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCTransition.cpp index d935207edf..e65fc6ba84 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCTransition.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCTransition.cpp @@ -143,6 +143,7 @@ void CCTransitionScene::finish() void CCTransitionScene::setNewScene(ccTime dt) { + CC_UNUSED_PARAM(dt); // [self unschedule:_cmd]; // "_cmd" is a local variable automatically defined in a method // that contains the selector for the method diff --git a/cocos2dx/menu_nodes/CCMenu.cpp b/cocos2dx/menu_nodes/CCMenu.cpp index 58ffb9c19f..9fad677f38 100644 --- a/cocos2dx/menu_nodes/CCMenu.cpp +++ b/cocos2dx/menu_nodes/CCMenu.cpp @@ -146,6 +146,7 @@ namespace cocos2d{ bool CCMenu::ccTouchBegan(CCTouch* touch, CCEvent* event) { + CC_UNUSED_PARAM(event); if (m_eState != kCCMenuStateWaiting || ! m_bIsVisible) { return false; @@ -162,6 +163,8 @@ namespace cocos2d{ void CCMenu::ccTouchEnded(CCTouch *touch, CCEvent* event) { + CC_UNUSED_PARAM(touch); + CC_UNUSED_PARAM(event); CCAssert(m_eState == kCCMenuStateTrackingTouch, "[Menu ccTouchEnded] -- invalid state"); if (m_pSelectedItem) { @@ -173,6 +176,8 @@ namespace cocos2d{ void CCMenu::ccTouchCancelled(CCTouch *touch, CCEvent* event) { + CC_UNUSED_PARAM(touch); + CC_UNUSED_PARAM(event); CCAssert(m_eState == kCCMenuStateTrackingTouch, "[Menu ccTouchCancelled] -- invalid state"); if (m_pSelectedItem) { @@ -183,6 +188,7 @@ namespace cocos2d{ void CCMenu::ccTouchMoved(CCTouch* touch, CCEvent* event) { + CC_UNUSED_PARAM(event); CCAssert(m_eState == kCCMenuStateTrackingTouch, "[Menu ccTouchMoved] -- invalid state"); CCMenuItem *currentItem = this->itemForTouch(touch); if (currentItem != m_pSelectedItem) @@ -348,8 +354,8 @@ namespace cocos2d{ row = 0; rowHeight = 0; rowColumns = 0; - float w; - float x; + float w = 0.0; + float x = 0.0; float y = (float)(height / 2); if (m_pChildren && m_pChildren->count() > 0) @@ -465,7 +471,7 @@ namespace cocos2d{ columnWidth = 0; columnRows = 0; float x = (float)(-width / 2); - float y; + float y = 0.0; if (m_pChildren && m_pChildren->count() > 0) { diff --git a/cocos2dx/misc_nodes/CCRenderTexture.cpp b/cocos2dx/misc_nodes/CCRenderTexture.cpp index 2f76f77e80..cbf2e7940b 100644 --- a/cocos2dx/misc_nodes/CCRenderTexture.cpp +++ b/cocos2dx/misc_nodes/CCRenderTexture.cpp @@ -244,6 +244,8 @@ bool CCRenderTexture::saveBuffer(const char *name) } bool CCRenderTexture::saveBuffer(const char *fileName, int format) { + CC_UNUSED_PARAM(fileName); + CC_UNUSED_PARAM(format); bool bRet = false; //@ todo CCRenderTexture::saveBuffer // UIImage *myImage = this->getUIImageFromBuffer(format); @@ -263,6 +265,7 @@ bool CCRenderTexture::saveBuffer(const char *fileName, int format) CCData * CCRenderTexture::getUIImageAsDataFromBuffer(int format) { + CC_UNUSED_PARAM(format); CCData * pData = NULL; //@ todo CCRenderTexture::getUIImageAsDataFromBuffer diff --git a/cocos2dx/particle_nodes/CCParticleSystem.cpp b/cocos2dx/particle_nodes/CCParticleSystem.cpp index 18522ed190..1816e282b1 100644 --- a/cocos2dx/particle_nodes/CCParticleSystem.cpp +++ b/cocos2dx/particle_nodes/CCParticleSystem.cpp @@ -656,6 +656,8 @@ void CCParticleSystem::update(ccTime dt) } void CCParticleSystem::updateQuadWithParticle(tCCParticle* particle, CCPoint newPosition) { + CC_UNUSED_PARAM(particle); + CC_UNUSED_PARAM(newPosition); // should be overriden } void CCParticleSystem::postStep() diff --git a/cocos2dx/platform/CCFileUtils.cpp b/cocos2dx/platform/CCFileUtils.cpp index 14db6e74a5..921d381579 100644 --- a/cocos2dx/platform/CCFileUtils.cpp +++ b/cocos2dx/platform/CCFileUtils.cpp @@ -62,9 +62,9 @@ public: CCDictMaker() : m_pRootDict(NULL), m_pCurDict(NULL), - m_tState(SAX_NONE), - m_pArray(NULL), - m_bInArray(false) + m_tState(SAX_NONE), + m_bInArray(false), + m_pArray(NULL) { } @@ -88,6 +88,8 @@ public: void startElement(void *ctx, const char *name, const char **atts) { + CC_UNUSED_PARAM(ctx); + CC_UNUSED_PARAM(atts); std::string sName((char*)name); if( sName == "dict" ) { @@ -137,6 +139,7 @@ public: void endElement(void *ctx, const char *name) { + CC_UNUSED_PARAM(ctx); std::string sName((char*)name); if( sName == "dict" ) { @@ -185,6 +188,7 @@ public: void textHandler(void *ctx, const char *ch, int len) { + CC_UNUSED_PARAM(ctx); if (m_tState == SAX_NONE) { return; @@ -213,6 +217,8 @@ public: } break; } + default: + break; } pText->release(); } @@ -274,7 +280,7 @@ unsigned char* CCFileUtils::getFileDataFromZip(const char* pszZipFilePath, const pBuffer = new unsigned char[FileInfo.uncompressed_size]; int nSize = 0; nSize = unzReadCurrentFile(pFile, pBuffer, FileInfo.uncompressed_size); - CCAssert(nSize == 0 || nSize == FileInfo.uncompressed_size, "the file size is wrong"); + CCAssert(nSize == 0 || nSize == (int)FileInfo.uncompressed_size, "the file size is wrong"); *pSize = FileInfo.uncompressed_size; unzCloseCurrentFile(pFile); diff --git a/cocos2dx/platform/CCImage.cpp b/cocos2dx/platform/CCImage.cpp index af26146165..8bd29f8b62 100644 --- a/cocos2dx/platform/CCImage.cpp +++ b/cocos2dx/platform/CCImage.cpp @@ -86,6 +86,7 @@ CCImage::~CCImage() bool CCImage::initWithImageFile(const char * strPath, EImageFormat eImgFmt/* = eFmtPng*/) { + CC_UNUSED_PARAM(eImgFmt); CCFileData data(CCFileUtils::fullPathFromRelativePath(strPath), "rb"); return initWithImageData(data.getBuffer(), data.getSize()); } @@ -153,8 +154,8 @@ bool CCImage::_initWithJpgData(void * data, int nSize) jpeg_start_decompress( &cinfo ); /* init image info */ - m_nWidth = cinfo.image_width; - m_nHeight = cinfo.image_height; + m_nWidth = (short)(cinfo.image_width); + m_nHeight = (short)(cinfo.image_height); m_bHasAlpha = false; m_bPreMulti = false; m_nBitsPerComponent = 8; @@ -206,7 +207,7 @@ bool CCImage::_initWithPngData(void * pData, int nDatalen) // init png_info info_ptr = png_create_info_struct(png_ptr); - CC_BREAK_IF(! info_ptr || setjmp(png_jmpbuf(png_ptr))); + CC_BREAK_IF(!info_ptr || setjmp(png_jmpbuf(png_ptr))); // set the read call back function tImageSource imageSource; diff --git a/cocos2dx/platform/CCImage.h b/cocos2dx/platform/CCImage.h index 30498ef6c9..2fb3e2e422 100644 --- a/cocos2dx/platform/CCImage.h +++ b/cocos2dx/platform/CCImage.h @@ -100,7 +100,7 @@ public: /** @brief Save the CCImage data to specified file with specified format. */ - bool saveToFile(const char * pszFilePath) { return false; } + bool saveToFile(const char * pszFilePath) { CC_UNUSED_PARAM(pszFilePath);return false; } CC_SYNTHESIZE_READONLY(short, m_nWidth, Width); CC_SYNTHESIZE_READONLY(short, m_nHeight, Height); diff --git a/cocos2dx/platform/CCPlatformConfig.h b/cocos2dx/platform/CCPlatformConfig.h index f13a62c77a..d2dacd0d7c 100644 --- a/cocos2dx/platform/CCPlatformConfig.h +++ b/cocos2dx/platform/CCPlatformConfig.h @@ -151,7 +151,7 @@ There are config below: // Check the supportive of platform #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) - +#pragma warning (disable:4127) #endif // CC_PLATFORM_WIN32 #endif // __CC_PLATFORM_CONFIG_H__ diff --git a/cocos2dx/platform/CCPlatformMacros.h b/cocos2dx/platform/CCPlatformMacros.h index eaf61e208f..4228af2417 100644 --- a/cocos2dx/platform/CCPlatformMacros.h +++ b/cocos2dx/platform/CCPlatformMacros.h @@ -120,9 +120,9 @@ public: inline void set##funName(varType var){ varName = var; } // cocos2d debug #if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 -#define CCLOG(...) do {} while (0) -#define CCLOGINFO(...) do {} while (0) -#define CCLOGERROR(...) do {} while (0) +#define CCLOG(...) +#define CCLOGINFO(...) +#define CCLOGERROR(...) #elif COCOS2D_DEBUG == 1 #define CCLOG(format, ...) cocos2d::CCLog(format, ##__VA_ARGS__) @@ -141,6 +141,9 @@ public: inline void set##funName(varType var){ varName = var; } // assertion #include #define CC_ASSERT(cond) assert(cond) +#define CC_UNUSED_PARAM(unusedparam) unusedparam + + // platform depended macros diff --git a/cocos2dx/platform/CCSAXParser.cpp b/cocos2dx/platform/CCSAXParser.cpp index d666dab5aa..cc1dfeeb62 100644 --- a/cocos2dx/platform/CCSAXParser.cpp +++ b/cocos2dx/platform/CCSAXParser.cpp @@ -43,6 +43,7 @@ CCSAXParser::~CCSAXParser(void) bool CCSAXParser::init(const char *pszEncoding) { + CC_UNUSED_PARAM(pszEncoding); // nothing to do return true; } diff --git a/cocos2dx/platform/android/CCEGLView_android.cpp b/cocos2dx/platform/android/CCEGLView_android.cpp index 159d4b75d4..4f9c17ff82 100644 --- a/cocos2dx/platform/android/CCEGLView_android.cpp +++ b/cocos2dx/platform/android/CCEGLView_android.cpp @@ -35,9 +35,9 @@ THE SOFTWARE. namespace cocos2d { CCEGLView::CCEGLView() -: m_pDelegate(NULL), - m_fScreenScaleFactor(1.0), - m_bNotHVGA(false) + : m_bNotHVGA(false), + m_pDelegate(NULL), + m_fScreenScaleFactor(1.0) { } diff --git a/cocos2dx/platform/android/Cocos2dJni.cpp b/cocos2dx/platform/android/Cocos2dJni.cpp index 32c6b60bf6..07df9bf6c1 100644 --- a/cocos2dx/platform/android/Cocos2dJni.cpp +++ b/cocos2dx/platform/android/Cocos2dJni.cpp @@ -350,7 +350,7 @@ extern "C" void setKeyboardStateJNI(int bOpen) { TMethodJNI t; - jint open = bOpen; + //jint open = bOpen; if (getMethodID(t , "org/cocos2dx/lib/Cocos2dxGLSurfaceView" , (bOpen) ? "openIMEKeyboard" : "closeIMEKeyboard" diff --git a/cocos2dx/platform/platform.cpp b/cocos2dx/platform/platform.cpp index 62fc83cc11..725aef515c 100644 --- a/cocos2dx/platform/platform.cpp +++ b/cocos2dx/platform/platform.cpp @@ -30,6 +30,7 @@ NS_CC_BEGIN; int CCTime::gettimeofdayCocos2d(struct cc_timeval *tp, void *tzp) { + CC_UNUSED_PARAM(tzp); if (tp) { gettimeofday((struct timeval *)tp, 0); diff --git a/cocos2dx/platform/win32/CCAccelerometer_win32.h b/cocos2dx/platform/win32/CCAccelerometer_win32.h index 827c90104f..513a88a8dc 100644 --- a/cocos2dx/platform/win32/CCAccelerometer_win32.h +++ b/cocos2dx/platform/win32/CCAccelerometer_win32.h @@ -35,8 +35,8 @@ public: static CCAccelerometer* sharedAccelerometer() { return NULL; } - void removeDelegate(CCAccelerometerDelegate* pDelegate) {} - void addDelegate(CCAccelerometerDelegate* pDelegate) {} + void removeDelegate(CCAccelerometerDelegate* pDelegate) {CC_UNUSED_PARAM(pDelegate);} + void addDelegate(CCAccelerometerDelegate* pDelegate) {CC_UNUSED_PARAM(pDelegate);} }; }//namespace cocos2d diff --git a/cocos2dx/platform/win32/CCEGLView_win32.cpp b/cocos2dx/platform/win32/CCEGLView_win32.cpp index 2613034ec6..21f76cfeab 100644 --- a/cocos2dx/platform/win32/CCEGLView_win32.cpp +++ b/cocos2dx/platform/win32/CCEGLView_win32.cpp @@ -182,8 +182,8 @@ static LRESULT CALLBACK _WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM CCEGLView::CCEGLView() : m_bCaptured(false) -, m_bOrientationInitVertical(false) , m_bOrientationReverted(false) +, m_bOrientationInitVertical(false) , m_pDelegate(NULL) , m_pEGL(NULL) , m_hWnd(NULL) diff --git a/cocos2dx/platform/win32/CCFileUtils_win32.cpp b/cocos2dx/platform/win32/CCFileUtils_win32.cpp index debe32ee24..34ba8695e0 100644 --- a/cocos2dx/platform/win32/CCFileUtils_win32.cpp +++ b/cocos2dx/platform/win32/CCFileUtils_win32.cpp @@ -144,6 +144,7 @@ unsigned char* CCFileUtils::getFileData(const char* pszFileName, const char* psz void CCFileUtils::setResource(const char* pszZipFileName) { + CC_UNUSED_PARAM(pszZipFileName); CCAssert(0, "Have not implement!"); } @@ -155,6 +156,7 @@ const char* CCFileUtils::getResourcePath(void) void CCFileUtils::setRelativePath(const char* pszRelativePath) { + CC_UNUSED_PARAM(pszRelativePath); CCAssert(0, "Have not implement!"); } diff --git a/cocos2dx/platform/win32/CCImage_win32.cpp b/cocos2dx/platform/win32/CCImage_win32.cpp index b204f0e5c7..92fae8adf0 100644 --- a/cocos2dx/platform/win32/CCImage_win32.cpp +++ b/cocos2dx/platform/win32/CCImage_win32.cpp @@ -235,8 +235,7 @@ public: // draw text HGDIOBJ hOldFont = SelectObject(m_hDC, m_hFont); HGDIOBJ hOldBmp = SelectObject(m_hDC, m_hBmp); - - RECT rc = {0, 0, tSize.cx, tSize.cy}; + SetBkMode(m_hDC, TRANSPARENT); SetTextColor(m_hDC, RGB(255, 255, 255)); // white color @@ -282,8 +281,7 @@ bool CCImage::initWithString( unsigned char * pImageData = 0; do { - CC_BREAK_IF(! pText); - int nLen = strlen(pText); + CC_BREAK_IF(! pText); BitmapDC& dc = sharedBitmapDC(); diff --git a/cocos2dx/sprite_nodes/CCSprite.cpp b/cocos2dx/sprite_nodes/CCSprite.cpp index d876617c1a..21570e1771 100644 --- a/cocos2dx/sprite_nodes/CCSprite.cpp +++ b/cocos2dx/sprite_nodes/CCSprite.cpp @@ -117,6 +117,9 @@ CCSprite* CCSprite::spriteWithTexture(CCTexture2D *pTexture, CCRect rect) CCSprite* CCSprite::spriteWithTexture(CCTexture2D *pTexture, CCRect rect, CCPoint offset) { + CC_UNUSED_PARAM(pTexture); + CC_UNUSED_PARAM(rect); + CC_UNUSED_PARAM(offset); // not implement assert(0); return NULL; diff --git a/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp b/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp index f1702587f7..f42d618247 100644 --- a/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp +++ b/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp @@ -537,7 +537,7 @@ namespace cocos2d pobSprite->useSelfRender(); unsigned int uIndex = m_pobDescendants->indexOfObject(pobSprite); - if (uIndex != -1) + if ((int)uIndex != -1) { m_pobDescendants->removeObjectAtIndex(uIndex); diff --git a/cocos2dx/sprite_nodes/CCSpriteFrame.cpp b/cocos2dx/sprite_nodes/CCSpriteFrame.cpp index ad31316345..4f00c15c0e 100644 --- a/cocos2dx/sprite_nodes/CCSpriteFrame.cpp +++ b/cocos2dx/sprite_nodes/CCSpriteFrame.cpp @@ -79,6 +79,7 @@ CCSpriteFrame::~CCSpriteFrame(void) CCObject* CCSpriteFrame::copyWithZone(CCZone *pZone) { + CC_UNUSED_PARAM(pZone); CCSpriteFrame *pCopy = new CCSpriteFrame(); pCopy->initWithTexture(m_pobTexture, m_obRectInPixels, m_bRotated, m_obOffsetInPixels, m_obOriginalSizeInPixels); diff --git a/cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp b/cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp index 46f1801b90..cc45a4a5fe 100644 --- a/cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp +++ b/cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp @@ -95,7 +95,7 @@ void CCSpriteFrameCache::addSpriteFramesWithDictionary(CCDictionarybegin(); std::string key = ""; CCDictionary *frameDict = NULL; - while( frameDict = (CCDictionary*)framesDict->next(&key) ) + while( (frameDict = (CCDictionary*)framesDict->next(&key)) ) { CCSpriteFrame *spriteFrame = m_pSpriteFrames->objectForKey(key); if (spriteFrame) @@ -237,7 +237,7 @@ void CCSpriteFrameCache::addSpriteFramesWithFile(const char *pszPlist) // stringByDeletingLastPathComponent string textureBase(pszPath); int indexOfLastSeperator = textureBase.find_last_of('/'); - if (indexOfLastSeperator == textureBase.length() - 1) + if (indexOfLastSeperator == (int)textureBase.length() - 1) { textureBase.erase(indexOfLastSeperator, 1); indexOfLastSeperator = textureBase.find_last_of('/'); @@ -293,7 +293,7 @@ void CCSpriteFrameCache::removeUnusedSpriteFrames(void) m_pSpriteFrames->begin(); std::string key = ""; CCSpriteFrame *spriteFrame = NULL; - while( spriteFrame = m_pSpriteFrames->next(&key) ) + while( (spriteFrame = m_pSpriteFrames->next(&key)) ) { if( spriteFrame->retainCount() == 1 ) { @@ -343,7 +343,7 @@ void CCSpriteFrameCache::removeSpriteFramesFromDictionary(CCDictionarybegin(); std::string key = ""; CCDictionary *frameDict = NULL; - while( frameDict = (CCDictionary*)framesDict->next(&key) ) + while( (frameDict = (CCDictionary*)framesDict->next(&key)) ) { if (m_pSpriteFrames->objectForKey(key)) { @@ -366,7 +366,7 @@ void CCSpriteFrameCache::removeSpriteFramesFromTexture(CCTexture2D* texture) m_pSpriteFrames->begin(); std::string key = ""; CCDictionary *frameDict = NULL; - while( frameDict = (CCDictionary*)m_pSpriteFrames->next(&key) ) + while( (frameDict = (CCDictionary*)m_pSpriteFrames->next(&key)) ) { CCSpriteFrame *frame = m_pSpriteFrames->objectForKey(key); if (frame && (frame->getTexture() == texture)) diff --git a/cocos2dx/support/data_support/ccCArray.h b/cocos2dx/support/data_support/ccCArray.h index 493a069b0e..482d8e5381 100644 --- a/cocos2dx/support/data_support/ccCArray.h +++ b/cocos2dx/support/data_support/ccCArray.h @@ -118,13 +118,13 @@ static inline unsigned int ccArrayGetIndexOfObject(ccArray *arr, CCObject* objec } } - return -1; + return (unsigned int)-1; } /** Returns a Boolean value that indicates whether object is present in array. */ static inline bool ccArrayContainsObject(ccArray *arr, CCObject* object) { - return ccArrayGetIndexOfObject(arr, object) != -1; + return (int)ccArrayGetIndexOfObject(arr, object) != -1; } /** Appends an object. Bahaviour undefined if array doesn't have enough capacity. */ @@ -210,7 +210,7 @@ static inline void ccArrayFastRemoveObjectAtIndex(ccArray *arr, unsigned int ind static inline void ccArrayFastRemoveObject(ccArray *arr, CCObject* object) { unsigned int index = ccArrayGetIndexOfObject(arr, object); - if (index != -1) + if ((int)index != -1) ccArrayFastRemoveObjectAtIndex(arr, index); } @@ -220,7 +220,7 @@ static inline void ccArrayRemoveObject(ccArray *arr, CCObject* object) { unsigned int index = ccArrayGetIndexOfObject(arr, object); - if (index != -1) + if ((int)index != -1) { ccArrayRemoveObjectAtIndex(arr, index); } @@ -422,7 +422,7 @@ static inline void ccCArrayFastRemoveValueAtIndex(ccCArray *arr, unsigned int in static inline void ccCArrayRemoveValue(ccCArray *arr, void* value) { unsigned int index = ccCArrayGetIndexOfValue(arr, value); - if (index != -1) + if ((int)index != -1) { ccCArrayRemoveValueAtIndex(arr, index); } diff --git a/cocos2dx/text_input_node/CCTextFieldTTF.cpp b/cocos2dx/text_input_node/CCTextFieldTTF.cpp index b419aa9383..b947152289 100644 --- a/cocos2dx/text_input_node/CCTextFieldTTF.cpp +++ b/cocos2dx/text_input_node/CCTextFieldTTF.cpp @@ -33,7 +33,7 @@ static int _calcCharCount(const char * pszText) { int n = 0; char ch = 0; - while (ch = *pszText) + while ((ch = *pszText)) { CC_BREAK_IF(! ch); @@ -174,7 +174,7 @@ void CCTextFieldTTF::insertText(const char * text, int len) // insert \n means input end int nPos = sInsert.find('\n'); - if (sInsert.npos != nPos) + if ((int)sInsert.npos != nPos) { len = nPos; sInsert.erase(nPos); @@ -194,7 +194,7 @@ void CCTextFieldTTF::insertText(const char * text, int len) setString(sText.c_str()); } - if (sInsert.npos == nPos) { + if ((int)sInsert.npos == nPos) { return; } diff --git a/cocos2dx/textures/CCTexture2D.cpp b/cocos2dx/textures/CCTexture2D.cpp index f919629ed5..cb631674ab 100644 --- a/cocos2dx/textures/CCTexture2D.cpp +++ b/cocos2dx/textures/CCTexture2D.cpp @@ -62,12 +62,12 @@ namespace cocos2d { static CCTexture2DPixelFormat g_defaultAlphaPixelFormat = kCCTexture2DPixelFormat_Default; CCTexture2D::CCTexture2D() -: m_uName(0) -, m_bHasPremultipliedAlpha(false) +: m_uPixelsWide(0) +, m_uPixelsHigh(0) +, m_uName(0) , m_fMaxS(0.0) , m_fMaxT(0.0) -, m_uPixelsHigh(0) -, m_uPixelsWide(0) +, m_bHasPremultipliedAlpha(false) { } @@ -145,6 +145,7 @@ void CCTexture2D::releaseData(void *data) void* CCTexture2D::keepData(void *data, unsigned int length) { + CC_UNUSED_PARAM(length); //The texture data mustn't be saved becuase it isn't a mutable texture. return data; } @@ -291,7 +292,7 @@ bool CCTexture2D::initPremultipliedATextureWithImage(CCImage *image, unsigned in tempData = (unsigned char*)(image->getData()); CCAssert(tempData != NULL, "NULL image data."); - if(image->getWidth() == POTWide && image->getHeight() == POTHigh) + if(image->getWidth() == (short)POTWide && image->getHeight() == (short)POTHigh) { data = new unsigned char[POTHigh * POTWide * 4]; memcpy(data, tempData, POTHigh * POTWide * 4); @@ -315,7 +316,7 @@ bool CCTexture2D::initPremultipliedATextureWithImage(CCImage *image, unsigned in case kCCTexture2DPixelFormat_RGB888: tempData = (unsigned char*)(image->getData()); CCAssert(tempData != NULL, "NULL image data."); - if(image->getWidth() == POTWide && image->getHeight() == POTHigh) + if(image->getWidth() == (short)POTWide && image->getHeight() == (short)POTHigh) { data = new unsigned char[POTHigh * POTWide * 3]; memcpy(data, tempData, POTHigh * POTWide * 3); diff --git a/cocos2dx/textures/CCTextureAtlas.cpp b/cocos2dx/textures/CCTextureAtlas.cpp index a0a75a7daa..8f75651bea 100644 --- a/cocos2dx/textures/CCTextureAtlas.cpp +++ b/cocos2dx/textures/CCTextureAtlas.cpp @@ -40,8 +40,8 @@ THE SOFTWARE. namespace cocos2d { CCTextureAtlas::CCTextureAtlas() - :m_pTexture(NULL) - ,m_pIndices(NULL) + :m_pIndices(NULL) + ,m_pTexture(NULL) ,m_pQuads(NULL) {} @@ -189,14 +189,14 @@ void CCTextureAtlas::initIndices() m_pIndices[i*6+4] = i*4+3; m_pIndices[i*6+5] = i*4+3; #else - m_pIndices[i*6+0] = i*4+0; - m_pIndices[i*6+1] = i*4+1; - m_pIndices[i*6+2] = i*4+2; + m_pIndices[i*6+0] = (GLushort)(i*4+0); + m_pIndices[i*6+1] = (GLushort)(i*4+1); + m_pIndices[i*6+2] = (GLushort)(i*4+2); // inverted index. issue #179 - m_pIndices[i*6+3] = i*4+3; - m_pIndices[i*6+4] = i*4+2; - m_pIndices[i*6+5] = i*4+1; + m_pIndices[i*6+3] = (GLushort)(i*4+3); + m_pIndices[i*6+4] = (GLushort)(i*4+2); + m_pIndices[i*6+5] = (GLushort)(i*4+1); // m_pIndices[i*6+3] = i*4+2; // m_pIndices[i*6+4] = i*4+3; // m_pIndices[i*6+5] = i*4+1; diff --git a/cocos2dx/textures/CCTextureCache.cpp b/cocos2dx/textures/CCTextureCache.cpp index 23223f285d..be99392999 100644 --- a/cocos2dx/textures/CCTextureCache.cpp +++ b/cocos2dx/textures/CCTextureCache.cpp @@ -363,7 +363,7 @@ CCTexture2D* CCTextureCache::addUIImage(CCImage *image, const char *key) do { // If key is nil, then create a new texture each time - if(texture = m_pTextures->objectForKey(forKey)) + if((texture = m_pTextures->objectForKey(forKey))) { break; } @@ -456,10 +456,10 @@ VolatileTexture::VolatileTexture(CCTexture2D *t) , m_bIsString(false) , m_strFileName("") , m_FmtImage(CCImage::kFmtPng) +, m_alignment(CCTextAlignmentCenter) , m_strFontName("") , m_strText("") , m_fFontSize(0.0f) -, m_alignment(CCTextAlignmentCenter) { m_size = CCSizeMake(0, 0); textures.push_back(this); diff --git a/cocos2dx/tileMap_parallax_nodes/CCParallaxNode.cpp b/cocos2dx/tileMap_parallax_nodes/CCParallaxNode.cpp index 1d407ba0bb..533ff00122 100644 --- a/cocos2dx/tileMap_parallax_nodes/CCParallaxNode.cpp +++ b/cocos2dx/tileMap_parallax_nodes/CCParallaxNode.cpp @@ -71,6 +71,9 @@ namespace cocos2d { } void CCParallaxNode::addChild(CCNode * child, int zOrder, int tag) { + CC_UNUSED_PARAM(zOrder); + CC_UNUSED_PARAM(child); + CC_UNUSED_PARAM(tag); CCAssert(0,"ParallaxNode: use addChild:z:parallaxRatio:positionOffset instead"); } void CCParallaxNode::addChild(CCNode *child, int z, CCPoint ratio, CCPoint offset) diff --git a/cocos2dx/tileMap_parallax_nodes/CCTMXLayer.cpp b/cocos2dx/tileMap_parallax_nodes/CCTMXLayer.cpp index 2643e45c89..05a37258bc 100644 --- a/cocos2dx/tileMap_parallax_nodes/CCTMXLayer.cpp +++ b/cocos2dx/tileMap_parallax_nodes/CCTMXLayer.cpp @@ -92,14 +92,14 @@ namespace cocos2d { return false; } CCTMXLayer::CCTMXLayer() - :m_pTiles(NULL) + :m_tLayerSize(CCSizeZero) + ,m_tMapTileSize(CCSizeZero) + ,m_pTiles(NULL) ,m_pTileSet(NULL) ,m_pProperties(NULL) + ,m_sLayerName("") ,m_pReusedTile(NULL) - ,m_pAtlasIndexArray(NULL) - ,m_tLayerSize(CCSizeZero) - ,m_tMapTileSize(CCSizeZero) - ,m_sLayerName("") + ,m_pAtlasIndexArray(NULL) {} CCTMXLayer::~CCTMXLayer() { @@ -446,6 +446,9 @@ namespace cocos2d { } void CCTMXLayer::addChild(CCNode * child, int zOrder, int tag) { + CC_UNUSED_PARAM(child); + CC_UNUSED_PARAM(zOrder); + CC_UNUSED_PARAM(tag); CCAssert(0, "addChild: is not supported on CCTMXLayer. Instead use setTileGID:at:/tileAt:"); } void CCTMXLayer::removeChild(CCNode* node, bool cleanup) diff --git a/cocos2dx/tileMap_parallax_nodes/CCTMXObjectGroup.cpp b/cocos2dx/tileMap_parallax_nodes/CCTMXObjectGroup.cpp index 6ddcc43935..a3cbd0ce5d 100644 --- a/cocos2dx/tileMap_parallax_nodes/CCTMXObjectGroup.cpp +++ b/cocos2dx/tileMap_parallax_nodes/CCTMXObjectGroup.cpp @@ -30,8 +30,8 @@ namespace cocos2d { //implementation CCTMXObjectGroup CCTMXObjectGroup::CCTMXObjectGroup() - :m_sGroupName("") - ,m_tPositionOffset(CCPointZero) + :m_tPositionOffset(CCPointZero) + ,m_sGroupName("") { m_pObjects = new CCMutableArray(); m_pProperties = new CCStringToStringDictionary(); diff --git a/cocos2dx/tileMap_parallax_nodes/CCTMXTiledMap.cpp b/cocos2dx/tileMap_parallax_nodes/CCTMXTiledMap.cpp index 40f3355784..0aaff71dbf 100644 --- a/cocos2dx/tileMap_parallax_nodes/CCTMXTiledMap.cpp +++ b/cocos2dx/tileMap_parallax_nodes/CCTMXTiledMap.cpp @@ -104,8 +104,8 @@ namespace cocos2d{ return true; } CCTMXTiledMap::CCTMXTiledMap() - :m_tTileSize(CCSizeZero) - ,m_tMapSize(CCSizeZero) + :m_tMapSize(CCSizeZero) + ,m_tTileSize(CCSizeZero) ,m_pObjectGroups(NULL) ,m_pProperties(NULL) ,m_pTileProperties(NULL) diff --git a/cocos2dx/tileMap_parallax_nodes/CCTMXXMLParser.cpp b/cocos2dx/tileMap_parallax_nodes/CCTMXXMLParser.cpp index 716d48fc31..ee6f456b23 100644 --- a/cocos2dx/tileMap_parallax_nodes/CCTMXXMLParser.cpp +++ b/cocos2dx/tileMap_parallax_nodes/CCTMXXMLParser.cpp @@ -64,12 +64,12 @@ namespace cocos2d { } // implementation CCTMXLayerInfo CCTMXLayerInfo::CCTMXLayerInfo() - :m_bOwnTiles(true) - ,m_uMinGID(100000) - ,m_uMaxGID(0) - ,m_sName("") - ,m_pTiles(NULL) - ,m_tOffset(CCPointZero) + : m_sName("") + , m_pTiles(NULL) + , m_bOwnTiles(true) + , m_uMinGID(100000) + , m_uMaxGID(0) + , m_tOffset(CCPointZero) { m_pProperties= new CCStringToStringDictionary();; } @@ -150,13 +150,13 @@ namespace cocos2d { return parseXMLFile(m_sTMXFileName.c_str()); } CCTMXMapInfo::CCTMXMapInfo() - :m_bStoringCharacters(false) - ,m_nLayerAttribs(0) - ,m_tMapSize(CCSizeZero) - ,m_tTileSize(CCSizeZero) - ,m_pLayers(NULL) - ,m_pTilesets(NULL) - ,m_pObjectGroups(NULL) + :m_tMapSize(CCSizeZero) + ,m_tTileSize(CCSizeZero) + ,m_pLayers(NULL) + ,m_pTilesets(NULL) + ,m_pObjectGroups(NULL) + ,m_nLayerAttribs(0) + ,m_bStoringCharacters(false) ,m_pProperties(NULL) ,m_pTileProperties(NULL) { @@ -239,6 +239,7 @@ namespace cocos2d { // the XML parser calls here with all the elements void CCTMXMapInfo::startElement(void *ctx, const char *name, const char **atts) { + CC_UNUSED_PARAM(ctx); CCTMXMapInfo *pTMXMapInfo = this; std::string elementName = (char*)name; std::map *attributeDict = new std::map(); @@ -519,6 +520,7 @@ namespace cocos2d { void CCTMXMapInfo::endElement(void *ctx, const char *name) { + CC_UNUSED_PARAM(ctx); CCTMXMapInfo *pTMXMapInfo = this; std::string elementName = (char*)name; @@ -586,6 +588,7 @@ namespace cocos2d { void CCTMXMapInfo::textHandler(void *ctx, const char *ch, int len) { + CC_UNUSED_PARAM(ctx); CCTMXMapInfo *pTMXMapInfo = this; std::string pText((char*)ch,0,len); diff --git a/cocos2dx/tileMap_parallax_nodes/CCTileMapAtlas.cpp b/cocos2dx/tileMap_parallax_nodes/CCTileMapAtlas.cpp index f2422ac9b3..e5d9a51f58 100644 --- a/cocos2dx/tileMap_parallax_nodes/CCTileMapAtlas.cpp +++ b/cocos2dx/tileMap_parallax_nodes/CCTileMapAtlas.cpp @@ -59,8 +59,8 @@ namespace cocos2d { return false; } CCTileMapAtlas::CCTileMapAtlas() - :m_pPosToAtlasIndex(NULL) - ,m_pTGAInfo(NULL) + :m_pTGAInfo(NULL) + ,m_pPosToAtlasIndex(NULL) ,m_nItemsToRender(0) { } diff --git a/cocos2dx/touch_dispatcher/CCTouchDispatcher.cpp b/cocos2dx/touch_dispatcher/CCTouchDispatcher.cpp index e4571ee705..c26e28e125 100644 --- a/cocos2dx/touch_dispatcher/CCTouchDispatcher.cpp +++ b/cocos2dx/touch_dispatcher/CCTouchDispatcher.cpp @@ -231,6 +231,8 @@ void CCTouchDispatcher::removeAllDelegates(void) void CCTouchDispatcher::setPriority(int nPriority, CCTouchDelegate *pDelegate) { + CC_UNUSED_PARAM(nPriority); + CC_UNUSED_PARAM(pDelegate); assert(0); }