fixed #512 fix warnings in /Wall flag

This commit is contained in:
liswei 2011-06-10 17:51:37 +08:00
parent f600846d4b
commit 1591c7edc8
70 changed files with 294 additions and 221 deletions

View File

@ -139,6 +139,6 @@ LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/platform/third_party/android/l
-lskia -lskia
# define the macro to compile through support/zip_support/ioapi.c # 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) include $(BUILD_SHARED_LIBRARY)

View File

@ -36,14 +36,14 @@ static CCConfiguration g_SharedConfiguration;
static char *g_pGlExtensions; static char *g_pGlExtensions;
CCConfiguration::CCConfiguration(void) CCConfiguration::CCConfiguration(void)
: m_bSupportsBGRA8888(false) :m_nMaxTextureSize(0)
, m_bSupportsDiscardFramebuffer(false)
, m_bSupportsNPOT(false)
, m_bSupportsPVRTC(false)
, m_nMaxModelviewStackDepth(0) , m_nMaxModelviewStackDepth(0)
, m_nMaxSamplesAllowed(0) , m_bSupportsPVRTC(false)
, m_nMaxTextureSize(0) , m_bSupportsNPOT(false)
, m_bSupportsBGRA8888(false)
, m_bSupportsDiscardFramebuffer(false)
, m_uOSVersion(0) , m_uOSVersion(0)
, m_nMaxSamplesAllowed(0)
{ {
} }
@ -90,15 +90,15 @@ CCGlesVersion CCConfiguration::getGlesVersion()
{ {
// To get the Opengl ES version // To get the Opengl ES version
std::string strVersion((char *)glGetString(GL_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; 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; 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; return GLES_VER_2_0;
} }

View File

@ -479,6 +479,7 @@ CCSize CCDirector::getDisplaySizeInPixels(void)
void CCDirector::reshapeProjection(CCSize newWindowSize) void CCDirector::reshapeProjection(CCSize newWindowSize)
{ {
CC_UNUSED_PARAM(newWindowSize);
m_obWinSizeInPoints = m_pobOpenGLView->getSize(); m_obWinSizeInPoints = m_pobOpenGLView->getSize();
m_obWinSizeInPixels = CCSizeMake(m_obWinSizeInPoints.width * m_fContentScaleFactor, m_obWinSizeInPixels = CCSizeMake(m_obWinSizeInPoints.width * m_fContentScaleFactor,
m_obWinSizeInPoints.height * m_fContentScaleFactor); m_obWinSizeInPoints.height * m_fContentScaleFactor);
@ -748,6 +749,7 @@ tPixelFormat CCDirector::getPiexFormat(void)
bool CCDirector::setDirectorType(ccDirectorType obDirectorType) bool CCDirector::setDirectorType(ccDirectorType obDirectorType)
{ {
CC_UNUSED_PARAM(obDirectorType);
// we only support CCDisplayLinkDirector // we only support CCDisplayLinkDirector
CCDirector::sharedDirector(); CCDirector::sharedDirector();

View File

@ -128,14 +128,14 @@ void CCTimer::update(ccTime dt)
static CCScheduler *pSharedScheduler; static CCScheduler *pSharedScheduler;
CCScheduler::CCScheduler(void) CCScheduler::CCScheduler(void)
: m_bCurrentTargetSalvaged(false) : m_fTimeScale(0.0)
, m_fTimeScale(0.0)
, m_pCurrentTarget(NULL)
, m_pHashForSelectors(NULL)
, m_pHashForUpdates(NULL)
, m_pUpdates0List(NULL)
, m_pUpdatesNegList(NULL) , m_pUpdatesNegList(NULL)
, m_pUpdates0List(NULL)
, m_pUpdatesPosList(NULL) , m_pUpdatesPosList(NULL)
, m_pHashForUpdates(NULL)
, m_pHashForSelectors(NULL)
, m_pCurrentTarget(NULL)
, m_bCurrentTargetSalvaged(false)
{ {
assert(pSharedScheduler == NULL); assert(pSharedScheduler == NULL);
} }
@ -191,11 +191,14 @@ void CCScheduler::removeHashElement(_hashSelectorEntry *pElement)
void CCScheduler::scheduleTimer(CCTimer *pTimer) void CCScheduler::scheduleTimer(CCTimer *pTimer)
{ {
CC_UNUSED_PARAM(pTimer);
assert(false); assert(false);
} }
void CCScheduler::unscheduleTimer(CCTimer *pTimer) void CCScheduler::unscheduleTimer(CCTimer *pTimer)
{ {
//CC_UNUSED_PARAM(pTimer);
pTimer = NULL;
assert(false); assert(false);
} }

View File

@ -94,11 +94,13 @@ bool CCAction::isDone()
void CCAction::step(ccTime dt) void CCAction::step(ccTime dt)
{ {
CC_UNUSED_PARAM(dt);
CCLOG("[Action step]. override me"); CCLOG("[Action step]. override me");
} }
void CCAction::update(ccTime time) void CCAction::update(ccTime time)
{ {
CC_UNUSED_PARAM(time);
CCLOG("[Action update]. override me"); CCLOG("[Action update]. override me");
} }
@ -291,6 +293,7 @@ CCObject *CCFollow::copyWithZone(CCZone *pZone)
} }
void CCFollow::step(ccTime dt) void CCFollow::step(ccTime dt)
{ {
CC_UNUSED_PARAM(dt);
#define CLAMP(x,y,z) MIN(MAX(x,y),z) #define CLAMP(x,y,z) MIN(MAX(x,y),z)
if(m_bBoundarySet) if(m_bBoundarySet)

View File

@ -411,6 +411,7 @@ namespace cocos2d
void CCLens3D::update(cocos2d::ccTime time) void CCLens3D::update(cocos2d::ccTime time)
{ {
CC_UNUSED_PARAM(time);
if (m_bDirty) if (m_bDirty)
{ {
int i, j; int i, j;
@ -601,6 +602,7 @@ namespace cocos2d
void CCShaky3D::update(cocos2d::ccTime time) void CCShaky3D::update(cocos2d::ccTime time)
{ {
CC_UNUSED_PARAM(time);
int i, j; int i, j;
for (i = 0; i < (m_sGridSize.x+1); ++i) for (i = 0; i < (m_sGridSize.x+1); ++i)

View File

@ -57,10 +57,12 @@ namespace cocos2d {
} }
void CCActionInstant::step(ccTime dt) void CCActionInstant::step(ccTime dt)
{ {
CC_UNUSED_PARAM(dt);
update(1); update(1);
} }
void CCActionInstant::update(ccTime time) void CCActionInstant::update(ccTime time)
{ {
CC_UNUSED_PARAM(time);
// ignore // ignore
} }
CCFiniteTimeAction * CCActionInstant::reverse() CCFiniteTimeAction * CCActionInstant::reverse()

View File

@ -114,6 +114,7 @@ void CCActionInterval::step(ccTime dt)
void CCActionInterval::setAmplitudeRate(CGFloat amp) void CCActionInterval::setAmplitudeRate(CGFloat amp)
{ {
CC_UNUSED_PARAM(amp);
// Abstract class needs implementation // Abstract class needs implementation
assert(0); assert(0);
} }
@ -1710,6 +1711,7 @@ CCObject* CCDelayTime::copyWithZone(cocos2d::CCZone *pZone)
void CCDelayTime::update(cocos2d::ccTime time) void CCDelayTime::update(cocos2d::ccTime time)
{ {
CC_UNUSED_PARAM(time);
return; return;
} }

View File

@ -84,8 +84,8 @@ void CCActionManager::selectorProtocolRelease()
} }
CCActionManager::CCActionManager(void) CCActionManager::CCActionManager(void)
: m_pCurrentTarget(NULL), : m_pTargets(NULL),
m_pTargets(NULL), m_pCurrentTarget(NULL),
m_bCurrentTargetSalvaged(false) m_bCurrentTargetSalvaged(false)
{ {
assert(gSharedManager == NULL); assert(gSharedManager == NULL);
@ -286,7 +286,7 @@ void CCActionManager::removeAction(cocos2d::CCAction *pAction)
if (pElement) if (pElement)
{ {
unsigned int i = ccArrayGetIndexOfObject(pElement->actions, pAction); unsigned int i = ccArrayGetIndexOfObject(pElement->actions, pAction);
if (i != -1) if ((int)i != -1)
{ {
removeActionAtIndex(i, pElement); removeActionAtIndex(i, pElement);
} }

View File

@ -98,6 +98,7 @@ namespace cocos2d
void CCShakyTiles3D::update(cocos2d::ccTime time) void CCShakyTiles3D::update(cocos2d::ccTime time)
{ {
CC_UNUSED_PARAM(time);
int i, j; int i, j;
for (i = 0; i < m_sGridSize.x; ++i) for (i = 0; i < m_sGridSize.x; ++i)
@ -191,6 +192,7 @@ namespace cocos2d
void CCShatteredTiles3D::update(cocos2d::ccTime time) void CCShatteredTiles3D::update(cocos2d::ccTime time)
{ {
CC_UNUSED_PARAM(time);
int i, j; int i, j;
if (m_bOnce == false) if (m_bOnce == false)

View File

@ -33,13 +33,13 @@ namespace cocos2d {
// CCAtlasNode - Creation & Init // CCAtlasNode - Creation & Init
CCAtlasNode::CCAtlasNode() CCAtlasNode::CCAtlasNode()
: m_pTextureAtlas(NULL) : m_nItemsPerRow(0)
, m_bIsOpacityModifyRGB(false) , m_nItemsPerColumn(0)
, m_nItemWidth(0) , m_nItemWidth(0)
, m_nItemHeight(0) , m_nItemHeight(0)
, m_pTextureAtlas(NULL)
, m_bIsOpacityModifyRGB(false)
, m_cOpacity(0) , m_cOpacity(0)
, m_nItemsPerRow(0)
, m_nItemsPerColumn(0)
{ {
} }

View File

@ -43,35 +43,35 @@ THE SOFTWARE.
namespace cocos2d { namespace cocos2d {
CCNode::CCNode(void) CCNode::CCNode(void)
:m_bIsRunning(false) : m_nZOrder(0)
, m_fVertexZ(0.0f)
, m_fRotation(0.0f) , m_fRotation(0.0f)
, m_fScaleX(1.0f) , m_fScaleX(1.0f)
, m_fScaleY(1.0f) , m_fScaleY(1.0f)
, m_tPosition(CCPointZero) , m_tPosition(CCPointZero)
, m_tPositionInPixels(CCPointZero) , m_tPositionInPixels(CCPointZero)
,m_tAnchorPointInPixels(CCPointZero) // children (lazy allocs)
, m_pChildren(NULL)
// lazy alloc
, m_pCamera(NULL)
, m_pGrid(NULL)
, m_bIsVisible(true)
, m_tAnchorPoint(CCPointZero) , m_tAnchorPoint(CCPointZero)
, m_tAnchorPointInPixels(CCPointZero)
, m_tContentSize(CCSizeZero) , m_tContentSize(CCSizeZero)
, m_tContentSizeInPixels(CCSizeZero) , m_tContentSizeInPixels(CCSizeZero)
, m_bIsRunning(false)
, m_pParent(NULL)
// "whole screen" objects. like Scenes and Layers, should set isRelativeAnchorPoint to false // "whole screen" objects. like Scenes and Layers, should set isRelativeAnchorPoint to false
, m_bIsRelativeAnchorPoint(true) , m_bIsRelativeAnchorPoint(true)
, m_nTag(kCCNodeTagInvalid)
// userData is always inited as nil
, m_pUserData(NULL)
, m_bIsTransformDirty(true) , m_bIsTransformDirty(true)
, m_bIsInverseDirty(true) , m_bIsInverseDirty(true)
#ifdef CC_NODE_TRANSFORM_USING_AFFINE_MATRIX #ifdef CC_NODE_TRANSFORM_USING_AFFINE_MATRIX
, m_bIsTransformGLDirty(true) , m_bIsTransformGLDirty(true)
#endif #endif
,m_fVertexZ(0.0f)
,m_pGrid(NULL)
,m_bIsVisible(true)
,m_nTag(kCCNodeTagInvalid)
,m_nZOrder(0)
// lazy alloc
,m_pCamera(NULL)
// children (lazy allocs)
,m_pChildren(NULL)
// userData is always inited as nil
,m_pUserData(NULL)
,m_pParent(NULL)
{ {
// nothing // nothing
} }

View File

@ -67,6 +67,8 @@ void* CCData::bytes(void)
//@todo implement //@todo implement
CCData* CCData::dataWithBytes(unsigned char *pBytes, int size) CCData* CCData::dataWithBytes(unsigned char *pBytes, int size)
{ {
CC_UNUSED_PARAM(pBytes);
CC_UNUSED_PARAM(size);
return NULL; return NULL;
} }
}//namespace cocos2d }//namespace cocos2d

View File

@ -64,7 +64,7 @@ bool splitWithForm(const char* pStr, strArray& strs)
int nPosRight = content.find('}'); int nPosRight = content.find('}');
// don't have '{' and '}' // 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 '{' // '}' is before '{'
CC_BREAK_IF(nPosLeft > nPosRight); CC_BREAK_IF(nPosLeft > nPosRight);
@ -75,7 +75,7 @@ bool splitWithForm(const char* pStr, strArray& strs)
int nPos1 = pointStr.find('{'); int nPos1 = pointStr.find('{');
int nPos2 = pointStr.find('}'); int nPos2 = pointStr.find('}');
// contain '{' or '}' // 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); split(pointStr, ",", strs);
if (strs.size() != 2 || strs[0].length() == 0 || strs[1].length() == 0) if (strs.size() != 2 || strs[0].length() == 0 || strs[1].length() == 0)
@ -107,19 +107,19 @@ namespace cocos2d
int nPosRight = content.find('}'); int nPosRight = content.find('}');
for (int i = 1; i < 3; ++i) for (int i = 1; i < 3; ++i)
{ {
if (nPosRight == std::string::npos) if (nPosRight == (int)std::string::npos)
{ {
break; break;
} }
nPosRight = content.find('}', nPosRight + 1); 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); content = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1);
int nPointEnd = content.find('}'); int nPointEnd = content.find('}');
CC_BREAK_IF(nPointEnd == std::string::npos); CC_BREAK_IF(nPointEnd == (int)std::string::npos);
nPointEnd = content.find(',', nPointEnd); 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 // get the point string and size string
std::string pointStr = content.substr(0, nPointEnd); std::string pointStr = content.substr(0, nPointEnd);

View File

@ -30,6 +30,7 @@ namespace cocos2d {
CCObject* CCCopying::copyWithZone(CCZone *pZone) CCObject* CCCopying::copyWithZone(CCZone *pZone)
{ {
CC_UNUSED_PARAM(pZone);
assert(0); assert(0);
return NULL; return NULL;
} }

View File

@ -76,6 +76,7 @@ namespace cocos2d
void CCGrabber::beforeRender(cocos2d::CCTexture2D *pTexture) void CCGrabber::beforeRender(cocos2d::CCTexture2D *pTexture)
{ {
CC_UNUSED_PARAM(pTexture);
// If the gles version is lower than GLES_VER_1_0, // If the gles version is lower than GLES_VER_1_0,
// all the functions in CCGrabber return directly. // all the functions in CCGrabber return directly.
if (m_eGlesVersion <= GLES_VER_1_0) if (m_eGlesVersion <= GLES_VER_1_0)
@ -101,6 +102,7 @@ namespace cocos2d
void CCGrabber::afterRender(cocos2d::CCTexture2D *pTexture) void CCGrabber::afterRender(cocos2d::CCTexture2D *pTexture)
{ {
CC_UNUSED_PARAM(pTexture);
// If the gles version is lower than GLES_VER_1_0, // If the gles version is lower than GLES_VER_1_0,
// all the functions in CCGrabber return directly. // all the functions in CCGrabber return directly.
if (m_eGlesVersion <= GLES_VER_1_0) if (m_eGlesVersion <= GLES_VER_1_0)

View File

@ -377,10 +377,10 @@ namespace cocos2d
float y1 = y * m_obStep.y; float y1 = y * m_obStep.y;
float y2= y1 + m_obStep.y; float y2= y1 + m_obStep.y;
GLushort a = x * (m_sGridSize.y + 1) + y; GLushort a = (GLushort)(x * (m_sGridSize.y + 1) + y);
GLushort b = (x + 1) * (m_sGridSize.y + 1) + y; GLushort b = (GLushort)((x + 1) * (m_sGridSize.y + 1) + y);
GLushort c = (x + 1) * (m_sGridSize.y + 1) + (y + 1); GLushort c = (GLushort)((x + 1) * (m_sGridSize.y + 1) + (y + 1));
GLushort d = x * (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}; GLushort tempidx[6] = {a, b, d, b, c, d};
@ -587,13 +587,13 @@ namespace cocos2d
for (x = 0; x < numQuads; x++) for (x = 0; x < numQuads; x++)
{ {
idxArray[x*6+0] = x * 4 + 0; idxArray[x*6+0] = (GLushort)(x * 4 + 0);
idxArray[x*6+1] = x * 4 + 1; idxArray[x*6+1] = (GLushort)(x * 4 + 1);
idxArray[x*6+2] = x * 4 + 2; idxArray[x*6+2] = (GLushort)(x * 4 + 2);
idxArray[x*6+3] = x * 4 + 1; idxArray[x*6+3] = (GLushort)(x * 4 + 1);
idxArray[x*6+4] = x * 4 + 2; idxArray[x*6+4] = (GLushort)(x * 4 + 2);
idxArray[x*6+5] = x * 4 + 3; idxArray[x*6+5] = (GLushort)(x * 4 + 3);
} }
memcpy(m_pOriginalVertices, m_pVertices, numQuads * 12 * sizeof(GLfloat)); memcpy(m_pOriginalVertices, m_pVertices, numQuads * 12 * sizeof(GLfloat));

View File

@ -48,7 +48,7 @@ receiving acceleration-related data from the system.
class CC_DLL CCAccelerometerDelegate class CC_DLL CCAccelerometerDelegate
{ {
public: public:
virtual void didAccelerate(CCAcceleration* pAccelerationValue) {} virtual void didAccelerate(CCAcceleration* pAccelerationValue) {CC_UNUSED_PARAM(pAccelerationValue);}
//! call the release() in child layer //! call the release() in child layer
virtual void AccelerometerDestroy(void) {} virtual void AccelerometerDestroy(void) {}

View File

@ -194,12 +194,12 @@ class CC_DLL CCFollow : public CCAction
public: public:
CCFollow() CCFollow()
: m_pobFollowedNode(NULL) : m_pobFollowedNode(NULL)
, m_bBoundaryFullyCovered(false)
, m_bBoundarySet(false) , m_bBoundarySet(false)
, m_fBottomBoundary(0.0) , m_bBoundaryFullyCovered(false)
, m_fLeftBoundary(0.0) , m_fLeftBoundary(0.0)
, m_fRightBoundary(0.0) , m_fRightBoundary(0.0)
, m_fTopBoundary(0.0) , m_fTopBoundary(0.0)
, m_fBottomBoundary(0.0)
{} {}
virtual ~CCFollow(void); virtual ~CCFollow(void);

View File

@ -73,16 +73,16 @@ namespace cocos2d {
{ {
public: public:
CCOrbitCamera() CCOrbitCamera()
: m_fAngleX(0.0) : m_fRadius(0.0)
, m_fAngleZ(0.0)
, m_fDeltaAngleX(0.0)
, m_fDeltaAngleZ(0.0)
, m_fDeltaRadius(0.0) , m_fDeltaRadius(0.0)
, m_fRadDeltaX(0.0) , m_fAngleZ(0.0)
, m_fRadDeltaZ(0.0) , m_fDeltaAngleZ(0.0)
, m_fRadius(0.0) , m_fAngleX(0.0)
, m_fRadX(0.0) , m_fDeltaAngleX(0.0)
, m_fRadZ(0.0) , m_fRadZ(0.0)
, m_fRadDeltaZ(0.0)
, m_fRadX(0.0)
, m_fRadDeltaX(0.0)
{} {}
~CCOrbitCamera(){} ~CCOrbitCamera(){}
/** creates a CCOrbitCamera action with radius, delta-radius, z, deltaZ, x, deltaX */ /** creates a CCOrbitCamera action with radius, delta-radius, z, deltaZ, x, deltaX */

View File

@ -171,8 +171,8 @@ namespace cocos2d {
{ {
public: public:
CCCallFunc() CCCallFunc()
: m_pCallFunc(NULL) : m_pSelectorTarget(NULL)
, m_pSelectorTarget(NULL) , m_pCallFunc(NULL)
{ {
} }
virtual ~CCCallFunc() virtual ~CCCallFunc()

View File

@ -74,7 +74,7 @@ protected:
/** /**
@brief Called by CCIMEDispatcher when some text input from IME. @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. @brief Called by CCIMEDispatcher when user clicked the backward key.
@ -89,10 +89,10 @@ protected:
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// keyboard show/hide notification // keyboard show/hide notification
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
virtual void keyboardWillShow(CCIMEKeyboardNotificationInfo& info) {} virtual void keyboardWillShow(CCIMEKeyboardNotificationInfo& info) {CC_UNUSED_PARAM(info);}
virtual void keyboardDidShow(CCIMEKeyboardNotificationInfo& info) {} virtual void keyboardDidShow(CCIMEKeyboardNotificationInfo& info) {CC_UNUSED_PARAM(info);}
virtual void keyboardWillHide(CCIMEKeyboardNotificationInfo& info) {} virtual void keyboardWillHide(CCIMEKeyboardNotificationInfo& info) {CC_UNUSED_PARAM(info);}
virtual void keyboardDidHide(CCIMEKeyboardNotificationInfo& info) {} virtual void keyboardDidHide(CCIMEKeyboardNotificationInfo& info) {CC_UNUSED_PARAM(info);}
protected: protected:
CCIMEDelegate(); CCIMEDelegate();

View File

@ -85,8 +85,8 @@ namespace cocos2d{
struct _KerningHashElement *m_pKerningDictionary; struct _KerningHashElement *m_pKerningDictionary;
public: public:
CCBMFontConfiguration() CCBMFontConfiguration()
: m_pKerningDictionary(NULL) : m_uCommonHeight(0)
, m_uCommonHeight(0) , m_pKerningDictionary(NULL)
{} {}
virtual ~CCBMFontConfiguration(); virtual ~CCBMFontConfiguration();
char * description(); char * description();
@ -148,10 +148,10 @@ namespace cocos2d{
CCBMFontConfiguration *m_pConfiguration; CCBMFontConfiguration *m_pConfiguration;
public: public:
CCLabelBMFont() CCLabelBMFont()
: m_pConfiguration(NULL) : m_cOpacity(0)
, m_bIsOpacityModifyRGB(false) , m_bIsOpacityModifyRGB(false)
, m_cOpacity(0)
, m_sString("") , m_sString("")
, m_pConfiguration(NULL)
{} {}
virtual ~CCLabelBMFont(); virtual ~CCLabelBMFont();
/** Purges the cached data. /** Purges the cached data.

View File

@ -58,7 +58,7 @@ public:
virtual void destroy(void); virtual void destroy(void);
virtual void keep(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 AccelerometerDestroy(void);
virtual void AccelerometerKeep(void); virtual void AccelerometerKeep(void);

View File

@ -117,8 +117,8 @@ namespace cocos2d{
protected: protected:
tCCMenuState m_eState; tCCMenuState m_eState;
CCMenuItem *m_pSelectedItem;
GLubyte m_cOpacity; GLubyte m_cOpacity;
CCMenuItem *m_pSelectedItem;
ccColor3B m_tColor; ccColor3B m_tColor;
}; };
} }

View File

@ -51,9 +51,9 @@ namespace cocos2d{
CC_PROPERTY(bool, m_bIsEnabled, IsEnabled); CC_PROPERTY(bool, m_bIsEnabled, IsEnabled);
public: public:
CCMenuItem() CCMenuItem()
: m_pListener(NULL) : m_bIsSelected(false)
, m_bIsEnabled(false) , m_bIsEnabled(false)
, m_bIsSelected(false) , m_pListener(NULL)
, m_pfnSelector(NULL) , m_pfnSelector(NULL)
{} {}
virtual ~CCMenuItem(){} virtual ~CCMenuItem(){}
@ -248,8 +248,8 @@ namespace cocos2d{
public: public:
CCMenuItemToggle() CCMenuItemToggle()
: m_cOpacity(0) : m_cOpacity(0)
, m_pSubItems(NULL)
, m_uSelectedIndex(0) , m_uSelectedIndex(0)
, m_pSubItems(NULL)
{} {}
virtual ~CCMenuItemToggle(); virtual ~CCMenuItemToggle();
/** creates a menu item from a list of items with a target/selector */ /** creates a menu item from a list of items with a target/selector */

View File

@ -57,10 +57,10 @@ class CC_DLL CCMotionStreak : public CCNode, public CCTextureProtocol
CC_PROPERTY(ccBlendFunc, m_tBlendFunc, BlendFunc) CC_PROPERTY(ccBlendFunc, m_tBlendFunc, BlendFunc)
public: public:
CCMotionStreak() CCMotionStreak()
: m_fSegThreshold(0.0) : m_pRibbon(NULL)
, m_fWidth(0.0)
, m_pRibbon(NULL)
, m_pTexture(NULL) , m_pTexture(NULL)
, m_fSegThreshold(0.0)
, m_fWidth(0.0)
{} {}
virtual ~CCMotionStreak(){} virtual ~CCMotionStreak(){}
/** creates the a MotionStreak. The image will be loaded using the TextureMgr. */ /** creates the a MotionStreak. The image will be loaded using the TextureMgr. */

View File

@ -63,7 +63,7 @@ public:
Textures with premultiplied alpha will have this property by default on YES. Otherwise the default value is NO Textures with premultiplied alpha will have this property by default on YES. Otherwise the default value is NO
@since v0.8 @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); /** returns whether or not the opacity will be applied using glColor(R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity);
@since v0.8 @since v0.8
@ -101,7 +101,7 @@ public:
virtual CCTexture2D* getTexture(void) = 0; virtual CCTexture2D* getTexture(void) = 0;
// sets a new texture. it will be retained // 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 //! @brief Common interface for Labels

View File

@ -108,8 +108,8 @@ public:
public: public:
CCRibbonSegment() CCRibbonSegment()
: m_bFinished(false) : m_bFinished(false)
, m_uBegin(0)
, m_uEnd(0) , m_uEnd(0)
, m_uBegin(0)
{} {}
virtual ~CCRibbonSegment(); virtual ~CCRibbonSegment();
char * description(); char * description();

View File

@ -41,6 +41,7 @@ public:
*/ */
virtual bool onTextFieldAttachWithIME(CCTextFieldTTF * sender) virtual bool onTextFieldAttachWithIME(CCTextFieldTTF * sender)
{ {
CC_UNUSED_PARAM(sender);
return false; return false;
} }
@ -49,6 +50,7 @@ public:
*/ */
virtual bool onTextFieldDetachWithIME(CCTextFieldTTF * sender) virtual bool onTextFieldDetachWithIME(CCTextFieldTTF * sender)
{ {
CC_UNUSED_PARAM(sender);
return false; return false;
} }
@ -57,6 +59,9 @@ public:
*/ */
virtual bool onTextFieldInsertText(CCTextFieldTTF * sender, const char * text, int nLen) virtual bool onTextFieldInsertText(CCTextFieldTTF * sender, const char * text, int nLen)
{ {
CC_UNUSED_PARAM(sender);
CC_UNUSED_PARAM(text);
CC_UNUSED_PARAM(nLen);
return false; return false;
} }
@ -65,6 +70,9 @@ public:
*/ */
virtual bool onTextFieldDeleteBackward(CCTextFieldTTF * sender, const char * delText, int nLen) virtual bool onTextFieldDeleteBackward(CCTextFieldTTF * sender, const char * delText, int nLen)
{ {
CC_UNUSED_PARAM(sender);
CC_UNUSED_PARAM(delText);
CC_UNUSED_PARAM(nLen);
return false; return false;
} }
@ -73,6 +81,7 @@ public:
*/ */
virtual bool onDraw(CCTextFieldTTF * sender) virtual bool onDraw(CCTextFieldTTF * sender)
{ {
CC_UNUSED_PARAM(sender);
return false; return false;
} }
}; };

View File

@ -36,8 +36,8 @@ public:
CCTouch() {} CCTouch() {}
CCTouch(int nViewId, float x, float y) : m_nViewId(nViewId), m_point(x, y), m_prevPoint(x, y) {} 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 locationInView(int nViewId) {CC_UNUSED_PARAM(nViewId); return m_point; }
CCPoint previousLocationInView(int nViewId) { return m_prevPoint; } CCPoint previousLocationInView(int nViewId) {CC_UNUSED_PARAM(nViewId); return m_prevPoint; }
int view() { return m_nViewId; } int view() { return m_nViewId; }
void SetTouchInfo(int nViewId, float x, float y) void SetTouchInfo(int nViewId, float x, float y)

View File

@ -56,18 +56,18 @@ public:
//! call the retain() in child (layer or menu) //! call the retain() in child (layer or menu)
virtual void keep(void) {} 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 // optional
virtual void ccTouchMoved(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) {} virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent) {} virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);}
// optional // optional
virtual void ccTouchesBegan(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) {} virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent) {} virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent) {} virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}
}; };
/** /**
@brief @brief
@ -90,12 +90,12 @@ public:
/** Return YES to claim the touch. /** Return YES to claim the touch.
@since v0 @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 // optional
virtual void ccTouchMoved(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) {} virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent) {} virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);}
}; };
/** @brief /** @brief
@ -107,10 +107,10 @@ public:
public: public:
CCStandardTouchDelegate() { m_eTouchDelegateType = ccTouchDelegateStandardBit; } CCStandardTouchDelegate() { m_eTouchDelegateType = ccTouchDelegateStandardBit; }
// optional // optional
virtual void ccTouchesBegan(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) {} virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent) {} virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent) {} virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}
}; };
}//namespace cocos2d }//namespace cocos2d

View File

@ -96,10 +96,11 @@ public:
~CCTouchDispatcher(); ~CCTouchDispatcher();
bool init(void); bool init(void);
CCTouchDispatcher() CCTouchDispatcher()
: m_pHandlersToAdd(NULL) : m_pTargetedHandlers(NULL)
, m_pHandlersToRemove(NULL)
, m_pStandardHandlers(NULL) , m_pStandardHandlers(NULL)
, m_pTargetedHandlers(NULL) , m_pHandlersToAdd(NULL)
, m_pHandlersToRemove(NULL)
{} {}
public: public:

View File

@ -35,13 +35,13 @@ class CCEvent;
class CC_DLL SelectorProtocol class CC_DLL SelectorProtocol
{ {
public: public:
virtual void update(ccTime dt) {}; virtual void update(ccTime dt) {CC_UNUSED_PARAM(dt);};
virtual void tick(ccTime dt){}; virtual void tick(ccTime dt){CC_UNUSED_PARAM(dt);};
virtual void callfunc(){}; virtual void callfunc(){};
virtual void callfunc(CCNode* pSender){}; virtual void callfunc(CCNode* pSender){CC_UNUSED_PARAM(pSender);};
virtual void callfunc(CCNode* pSender, void* pData){}; virtual void callfunc(CCNode* pSender, void* pData){CC_UNUSED_PARAM(pSender);CC_UNUSED_PARAM(pData);};
virtual void menuHandler(CCObject* pSender){}; virtual void menuHandler(CCObject* pSender){CC_UNUSED_PARAM(pSender);};
virtual void eventHandler(CCEvent* pEvent) {}; virtual void eventHandler(CCEvent* pEvent) {CC_UNUSED_PARAM(pEvent);};
// the child call responding retain/release function // the child call responding retain/release function
virtual void selectorProtocolRetain(void) {}; virtual void selectorProtocolRetain(void) {};

View File

@ -142,7 +142,7 @@ namespace cocos2d{
while (strLeft.length() > 0) { while (strLeft.length() > 0) {
int pos = strLeft.find('\n'); 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 // the data is more than a line.get one line
line = strLeft.substr(0, pos); line = strLeft.substr(0, pos);

View File

@ -29,10 +29,10 @@ namespace cocos2d{
//CCLabelTTF //CCLabelTTF
// //
CCLabelTTF::CCLabelTTF() CCLabelTTF::CCLabelTTF()
: m_pFontName(NULL) : m_eAlignment(CCTextAlignmentCenter)
, m_pString(NULL) , m_pFontName(NULL)
, m_fFontSize(0.0) , m_fFontSize(0.0)
, m_eAlignment(CCTextAlignmentCenter) , m_pString(NULL)
{ {
} }

View File

@ -251,6 +251,8 @@ void CCLayer::onEnterTransitionDidFinish()
bool CCLayer::ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent) bool CCLayer::ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent)
{ {
CC_UNUSED_PARAM(pTouch);
CC_UNUSED_PARAM(pEvent);
CCAssert(false, "Layer#ccTouchBegan override me"); CCAssert(false, "Layer#ccTouchBegan override me");
return true; return true;
} }

View File

@ -143,6 +143,7 @@ void CCTransitionScene::finish()
void CCTransitionScene::setNewScene(ccTime dt) void CCTransitionScene::setNewScene(ccTime dt)
{ {
CC_UNUSED_PARAM(dt);
// [self unschedule:_cmd]; // [self unschedule:_cmd];
// "_cmd" is a local variable automatically defined in a method // "_cmd" is a local variable automatically defined in a method
// that contains the selector for the method // that contains the selector for the method

View File

@ -146,6 +146,7 @@ namespace cocos2d{
bool CCMenu::ccTouchBegan(CCTouch* touch, CCEvent* event) bool CCMenu::ccTouchBegan(CCTouch* touch, CCEvent* event)
{ {
CC_UNUSED_PARAM(event);
if (m_eState != kCCMenuStateWaiting || ! m_bIsVisible) if (m_eState != kCCMenuStateWaiting || ! m_bIsVisible)
{ {
return false; return false;
@ -162,6 +163,8 @@ namespace cocos2d{
void CCMenu::ccTouchEnded(CCTouch *touch, CCEvent* event) void CCMenu::ccTouchEnded(CCTouch *touch, CCEvent* event)
{ {
CC_UNUSED_PARAM(touch);
CC_UNUSED_PARAM(event);
CCAssert(m_eState == kCCMenuStateTrackingTouch, "[Menu ccTouchEnded] -- invalid state"); CCAssert(m_eState == kCCMenuStateTrackingTouch, "[Menu ccTouchEnded] -- invalid state");
if (m_pSelectedItem) if (m_pSelectedItem)
{ {
@ -173,6 +176,8 @@ namespace cocos2d{
void CCMenu::ccTouchCancelled(CCTouch *touch, CCEvent* event) void CCMenu::ccTouchCancelled(CCTouch *touch, CCEvent* event)
{ {
CC_UNUSED_PARAM(touch);
CC_UNUSED_PARAM(event);
CCAssert(m_eState == kCCMenuStateTrackingTouch, "[Menu ccTouchCancelled] -- invalid state"); CCAssert(m_eState == kCCMenuStateTrackingTouch, "[Menu ccTouchCancelled] -- invalid state");
if (m_pSelectedItem) if (m_pSelectedItem)
{ {
@ -183,6 +188,7 @@ namespace cocos2d{
void CCMenu::ccTouchMoved(CCTouch* touch, CCEvent* event) void CCMenu::ccTouchMoved(CCTouch* touch, CCEvent* event)
{ {
CC_UNUSED_PARAM(event);
CCAssert(m_eState == kCCMenuStateTrackingTouch, "[Menu ccTouchMoved] -- invalid state"); CCAssert(m_eState == kCCMenuStateTrackingTouch, "[Menu ccTouchMoved] -- invalid state");
CCMenuItem *currentItem = this->itemForTouch(touch); CCMenuItem *currentItem = this->itemForTouch(touch);
if (currentItem != m_pSelectedItem) if (currentItem != m_pSelectedItem)
@ -348,8 +354,8 @@ namespace cocos2d{
row = 0; row = 0;
rowHeight = 0; rowHeight = 0;
rowColumns = 0; rowColumns = 0;
float w; float w = 0.0;
float x; float x = 0.0;
float y = (float)(height / 2); float y = (float)(height / 2);
if (m_pChildren && m_pChildren->count() > 0) if (m_pChildren && m_pChildren->count() > 0)
@ -465,7 +471,7 @@ namespace cocos2d{
columnWidth = 0; columnWidth = 0;
columnRows = 0; columnRows = 0;
float x = (float)(-width / 2); float x = (float)(-width / 2);
float y; float y = 0.0;
if (m_pChildren && m_pChildren->count() > 0) if (m_pChildren && m_pChildren->count() > 0)
{ {

View File

@ -244,6 +244,8 @@ bool CCRenderTexture::saveBuffer(const char *name)
} }
bool CCRenderTexture::saveBuffer(const char *fileName, int format) bool CCRenderTexture::saveBuffer(const char *fileName, int format)
{ {
CC_UNUSED_PARAM(fileName);
CC_UNUSED_PARAM(format);
bool bRet = false; bool bRet = false;
//@ todo CCRenderTexture::saveBuffer //@ todo CCRenderTexture::saveBuffer
// UIImage *myImage = this->getUIImageFromBuffer(format); // UIImage *myImage = this->getUIImageFromBuffer(format);
@ -263,6 +265,7 @@ bool CCRenderTexture::saveBuffer(const char *fileName, int format)
CCData * CCRenderTexture::getUIImageAsDataFromBuffer(int format) CCData * CCRenderTexture::getUIImageAsDataFromBuffer(int format)
{ {
CC_UNUSED_PARAM(format);
CCData * pData = NULL; CCData * pData = NULL;
//@ todo CCRenderTexture::getUIImageAsDataFromBuffer //@ todo CCRenderTexture::getUIImageAsDataFromBuffer

View File

@ -656,6 +656,8 @@ void CCParticleSystem::update(ccTime dt)
} }
void CCParticleSystem::updateQuadWithParticle(tCCParticle* particle, CCPoint newPosition) void CCParticleSystem::updateQuadWithParticle(tCCParticle* particle, CCPoint newPosition)
{ {
CC_UNUSED_PARAM(particle);
CC_UNUSED_PARAM(newPosition);
// should be overriden // should be overriden
} }
void CCParticleSystem::postStep() void CCParticleSystem::postStep()

View File

@ -63,8 +63,8 @@ public:
: m_pRootDict(NULL), : m_pRootDict(NULL),
m_pCurDict(NULL), m_pCurDict(NULL),
m_tState(SAX_NONE), m_tState(SAX_NONE),
m_pArray(NULL), m_bInArray(false),
m_bInArray(false) m_pArray(NULL)
{ {
} }
@ -88,6 +88,8 @@ public:
void startElement(void *ctx, const char *name, const char **atts) void startElement(void *ctx, const char *name, const char **atts)
{ {
CC_UNUSED_PARAM(ctx);
CC_UNUSED_PARAM(atts);
std::string sName((char*)name); std::string sName((char*)name);
if( sName == "dict" ) if( sName == "dict" )
{ {
@ -137,6 +139,7 @@ public:
void endElement(void *ctx, const char *name) void endElement(void *ctx, const char *name)
{ {
CC_UNUSED_PARAM(ctx);
std::string sName((char*)name); std::string sName((char*)name);
if( sName == "dict" ) if( sName == "dict" )
{ {
@ -185,6 +188,7 @@ public:
void textHandler(void *ctx, const char *ch, int len) void textHandler(void *ctx, const char *ch, int len)
{ {
CC_UNUSED_PARAM(ctx);
if (m_tState == SAX_NONE) if (m_tState == SAX_NONE)
{ {
return; return;
@ -213,6 +217,8 @@ public:
} }
break; break;
} }
default:
break;
} }
pText->release(); pText->release();
} }
@ -274,7 +280,7 @@ unsigned char* CCFileUtils::getFileDataFromZip(const char* pszZipFilePath, const
pBuffer = new unsigned char[FileInfo.uncompressed_size]; pBuffer = new unsigned char[FileInfo.uncompressed_size];
int nSize = 0; int nSize = 0;
nSize = unzReadCurrentFile(pFile, pBuffer, FileInfo.uncompressed_size); 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; *pSize = FileInfo.uncompressed_size;
unzCloseCurrentFile(pFile); unzCloseCurrentFile(pFile);

View File

@ -86,6 +86,7 @@ CCImage::~CCImage()
bool CCImage::initWithImageFile(const char * strPath, EImageFormat eImgFmt/* = eFmtPng*/) bool CCImage::initWithImageFile(const char * strPath, EImageFormat eImgFmt/* = eFmtPng*/)
{ {
CC_UNUSED_PARAM(eImgFmt);
CCFileData data(CCFileUtils::fullPathFromRelativePath(strPath), "rb"); CCFileData data(CCFileUtils::fullPathFromRelativePath(strPath), "rb");
return initWithImageData(data.getBuffer(), data.getSize()); return initWithImageData(data.getBuffer(), data.getSize());
} }
@ -153,8 +154,8 @@ bool CCImage::_initWithJpgData(void * data, int nSize)
jpeg_start_decompress( &cinfo ); jpeg_start_decompress( &cinfo );
/* init image info */ /* init image info */
m_nWidth = cinfo.image_width; m_nWidth = (short)(cinfo.image_width);
m_nHeight = cinfo.image_height; m_nHeight = (short)(cinfo.image_height);
m_bHasAlpha = false; m_bHasAlpha = false;
m_bPreMulti = false; m_bPreMulti = false;
m_nBitsPerComponent = 8; m_nBitsPerComponent = 8;

View File

@ -100,7 +100,7 @@ public:
/** /**
@brief Save the CCImage data to specified file with specified format. @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_nWidth, Width);
CC_SYNTHESIZE_READONLY(short, m_nHeight, Height); CC_SYNTHESIZE_READONLY(short, m_nHeight, Height);

View File

@ -151,7 +151,7 @@ There are config below:
// Check the supportive of platform // Check the supportive of platform
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
#pragma warning (disable:4127)
#endif // CC_PLATFORM_WIN32 #endif // CC_PLATFORM_WIN32
#endif // __CC_PLATFORM_CONFIG_H__ #endif // __CC_PLATFORM_CONFIG_H__

View File

@ -120,9 +120,9 @@ public: inline void set##funName(varType var){ varName = var; }
// cocos2d debug // cocos2d debug
#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 #if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0
#define CCLOG(...) do {} while (0) #define CCLOG(...)
#define CCLOGINFO(...) do {} while (0) #define CCLOGINFO(...)
#define CCLOGERROR(...) do {} while (0) #define CCLOGERROR(...)
#elif COCOS2D_DEBUG == 1 #elif COCOS2D_DEBUG == 1
#define CCLOG(format, ...) cocos2d::CCLog(format, ##__VA_ARGS__) #define CCLOG(format, ...) cocos2d::CCLog(format, ##__VA_ARGS__)
@ -141,6 +141,9 @@ public: inline void set##funName(varType var){ varName = var; }
// assertion // assertion
#include <assert.h> #include <assert.h>
#define CC_ASSERT(cond) assert(cond) #define CC_ASSERT(cond) assert(cond)
#define CC_UNUSED_PARAM(unusedparam) unusedparam
// platform depended macros // platform depended macros

View File

@ -43,6 +43,7 @@ CCSAXParser::~CCSAXParser(void)
bool CCSAXParser::init(const char *pszEncoding) bool CCSAXParser::init(const char *pszEncoding)
{ {
CC_UNUSED_PARAM(pszEncoding);
// nothing to do // nothing to do
return true; return true;
} }

View File

@ -35,9 +35,9 @@ THE SOFTWARE.
namespace cocos2d { namespace cocos2d {
CCEGLView::CCEGLView() CCEGLView::CCEGLView()
: m_pDelegate(NULL), : m_bNotHVGA(false),
m_fScreenScaleFactor(1.0), m_pDelegate(NULL),
m_bNotHVGA(false) m_fScreenScaleFactor(1.0)
{ {
} }

View File

@ -350,7 +350,7 @@ extern "C"
void setKeyboardStateJNI(int bOpen) void setKeyboardStateJNI(int bOpen)
{ {
TMethodJNI t; TMethodJNI t;
jint open = bOpen; //jint open = bOpen;
if (getMethodID(t if (getMethodID(t
, "org/cocos2dx/lib/Cocos2dxGLSurfaceView" , "org/cocos2dx/lib/Cocos2dxGLSurfaceView"
, (bOpen) ? "openIMEKeyboard" : "closeIMEKeyboard" , (bOpen) ? "openIMEKeyboard" : "closeIMEKeyboard"

View File

@ -30,6 +30,7 @@ NS_CC_BEGIN;
int CCTime::gettimeofdayCocos2d(struct cc_timeval *tp, void *tzp) int CCTime::gettimeofdayCocos2d(struct cc_timeval *tp, void *tzp)
{ {
CC_UNUSED_PARAM(tzp);
if (tp) if (tp)
{ {
gettimeofday((struct timeval *)tp, 0); gettimeofday((struct timeval *)tp, 0);

View File

@ -35,8 +35,8 @@ public:
static CCAccelerometer* sharedAccelerometer() { return NULL; } static CCAccelerometer* sharedAccelerometer() { return NULL; }
void removeDelegate(CCAccelerometerDelegate* pDelegate) {} void removeDelegate(CCAccelerometerDelegate* pDelegate) {CC_UNUSED_PARAM(pDelegate);}
void addDelegate(CCAccelerometerDelegate* pDelegate) {} void addDelegate(CCAccelerometerDelegate* pDelegate) {CC_UNUSED_PARAM(pDelegate);}
}; };
}//namespace cocos2d }//namespace cocos2d

View File

@ -182,8 +182,8 @@ static LRESULT CALLBACK _WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
CCEGLView::CCEGLView() CCEGLView::CCEGLView()
: m_bCaptured(false) : m_bCaptured(false)
, m_bOrientationInitVertical(false)
, m_bOrientationReverted(false) , m_bOrientationReverted(false)
, m_bOrientationInitVertical(false)
, m_pDelegate(NULL) , m_pDelegate(NULL)
, m_pEGL(NULL) , m_pEGL(NULL)
, m_hWnd(NULL) , m_hWnd(NULL)

View File

@ -144,6 +144,7 @@ unsigned char* CCFileUtils::getFileData(const char* pszFileName, const char* psz
void CCFileUtils::setResource(const char* pszZipFileName) void CCFileUtils::setResource(const char* pszZipFileName)
{ {
CC_UNUSED_PARAM(pszZipFileName);
CCAssert(0, "Have not implement!"); CCAssert(0, "Have not implement!");
} }
@ -155,6 +156,7 @@ const char* CCFileUtils::getResourcePath(void)
void CCFileUtils::setRelativePath(const char* pszRelativePath) void CCFileUtils::setRelativePath(const char* pszRelativePath)
{ {
CC_UNUSED_PARAM(pszRelativePath);
CCAssert(0, "Have not implement!"); CCAssert(0, "Have not implement!");
} }

View File

@ -236,7 +236,6 @@ public:
HGDIOBJ hOldFont = SelectObject(m_hDC, m_hFont); HGDIOBJ hOldFont = SelectObject(m_hDC, m_hFont);
HGDIOBJ hOldBmp = SelectObject(m_hDC, m_hBmp); HGDIOBJ hOldBmp = SelectObject(m_hDC, m_hBmp);
RECT rc = {0, 0, tSize.cx, tSize.cy};
SetBkMode(m_hDC, TRANSPARENT); SetBkMode(m_hDC, TRANSPARENT);
SetTextColor(m_hDC, RGB(255, 255, 255)); // white color SetTextColor(m_hDC, RGB(255, 255, 255)); // white color
@ -283,7 +282,6 @@ bool CCImage::initWithString(
do do
{ {
CC_BREAK_IF(! pText); CC_BREAK_IF(! pText);
int nLen = strlen(pText);
BitmapDC& dc = sharedBitmapDC(); BitmapDC& dc = sharedBitmapDC();

View File

@ -117,6 +117,9 @@ CCSprite* CCSprite::spriteWithTexture(CCTexture2D *pTexture, CCRect rect)
CCSprite* CCSprite::spriteWithTexture(CCTexture2D *pTexture, CCRect rect, CCPoint offset) CCSprite* CCSprite::spriteWithTexture(CCTexture2D *pTexture, CCRect rect, CCPoint offset)
{ {
CC_UNUSED_PARAM(pTexture);
CC_UNUSED_PARAM(rect);
CC_UNUSED_PARAM(offset);
// not implement // not implement
assert(0); assert(0);
return NULL; return NULL;

View File

@ -537,7 +537,7 @@ namespace cocos2d
pobSprite->useSelfRender(); pobSprite->useSelfRender();
unsigned int uIndex = m_pobDescendants->indexOfObject(pobSprite); unsigned int uIndex = m_pobDescendants->indexOfObject(pobSprite);
if (uIndex != -1) if ((int)uIndex != -1)
{ {
m_pobDescendants->removeObjectAtIndex(uIndex); m_pobDescendants->removeObjectAtIndex(uIndex);

View File

@ -79,6 +79,7 @@ CCSpriteFrame::~CCSpriteFrame(void)
CCObject* CCSpriteFrame::copyWithZone(CCZone *pZone) CCObject* CCSpriteFrame::copyWithZone(CCZone *pZone)
{ {
CC_UNUSED_PARAM(pZone);
CCSpriteFrame *pCopy = new CCSpriteFrame(); CCSpriteFrame *pCopy = new CCSpriteFrame();
pCopy->initWithTexture(m_pobTexture, m_obRectInPixels, m_bRotated, m_obOffsetInPixels, m_obOriginalSizeInPixels); pCopy->initWithTexture(m_pobTexture, m_obRectInPixels, m_bRotated, m_obOffsetInPixels, m_obOriginalSizeInPixels);

View File

@ -95,7 +95,7 @@ void CCSpriteFrameCache::addSpriteFramesWithDictionary(CCDictionary<std::string,
framesDict->begin(); framesDict->begin();
std::string key = ""; std::string key = "";
CCDictionary<std::string, CCObject*> *frameDict = NULL; CCDictionary<std::string, CCObject*> *frameDict = NULL;
while( frameDict = (CCDictionary<std::string, CCObject*>*)framesDict->next(&key) ) while( (frameDict = (CCDictionary<std::string, CCObject*>*)framesDict->next(&key)) )
{ {
CCSpriteFrame *spriteFrame = m_pSpriteFrames->objectForKey(key); CCSpriteFrame *spriteFrame = m_pSpriteFrames->objectForKey(key);
if (spriteFrame) if (spriteFrame)
@ -237,7 +237,7 @@ void CCSpriteFrameCache::addSpriteFramesWithFile(const char *pszPlist)
// stringByDeletingLastPathComponent // stringByDeletingLastPathComponent
string textureBase(pszPath); string textureBase(pszPath);
int indexOfLastSeperator = textureBase.find_last_of('/'); int indexOfLastSeperator = textureBase.find_last_of('/');
if (indexOfLastSeperator == textureBase.length() - 1) if (indexOfLastSeperator == (int)textureBase.length() - 1)
{ {
textureBase.erase(indexOfLastSeperator, 1); textureBase.erase(indexOfLastSeperator, 1);
indexOfLastSeperator = textureBase.find_last_of('/'); indexOfLastSeperator = textureBase.find_last_of('/');
@ -293,7 +293,7 @@ void CCSpriteFrameCache::removeUnusedSpriteFrames(void)
m_pSpriteFrames->begin(); m_pSpriteFrames->begin();
std::string key = ""; std::string key = "";
CCSpriteFrame *spriteFrame = NULL; CCSpriteFrame *spriteFrame = NULL;
while( spriteFrame = m_pSpriteFrames->next(&key) ) while( (spriteFrame = m_pSpriteFrames->next(&key)) )
{ {
if( spriteFrame->retainCount() == 1 ) if( spriteFrame->retainCount() == 1 )
{ {
@ -343,7 +343,7 @@ void CCSpriteFrameCache::removeSpriteFramesFromDictionary(CCDictionary<std::stri
framesDict->begin(); framesDict->begin();
std::string key = ""; std::string key = "";
CCDictionary<std::string, CCObject*> *frameDict = NULL; CCDictionary<std::string, CCObject*> *frameDict = NULL;
while( frameDict = (CCDictionary<std::string, CCObject*>*)framesDict->next(&key) ) while( (frameDict = (CCDictionary<std::string, CCObject*>*)framesDict->next(&key)) )
{ {
if (m_pSpriteFrames->objectForKey(key)) if (m_pSpriteFrames->objectForKey(key))
{ {
@ -366,7 +366,7 @@ void CCSpriteFrameCache::removeSpriteFramesFromTexture(CCTexture2D* texture)
m_pSpriteFrames->begin(); m_pSpriteFrames->begin();
std::string key = ""; std::string key = "";
CCDictionary<std::string, CCObject*> *frameDict = NULL; CCDictionary<std::string, CCObject*> *frameDict = NULL;
while( frameDict = (CCDictionary<std::string, CCObject*>*)m_pSpriteFrames->next(&key) ) while( (frameDict = (CCDictionary<std::string, CCObject*>*)m_pSpriteFrames->next(&key)) )
{ {
CCSpriteFrame *frame = m_pSpriteFrames->objectForKey(key); CCSpriteFrame *frame = m_pSpriteFrames->objectForKey(key);
if (frame && (frame->getTexture() == texture)) if (frame && (frame->getTexture() == texture))

View File

@ -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. */ /** Returns a Boolean value that indicates whether object is present in array. */
static inline bool ccArrayContainsObject(ccArray *arr, CCObject* object) 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. */ /** 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) static inline void ccArrayFastRemoveObject(ccArray *arr, CCObject* object)
{ {
unsigned int index = ccArrayGetIndexOfObject(arr, object); unsigned int index = ccArrayGetIndexOfObject(arr, object);
if (index != -1) if ((int)index != -1)
ccArrayFastRemoveObjectAtIndex(arr, index); ccArrayFastRemoveObjectAtIndex(arr, index);
} }
@ -220,7 +220,7 @@ static inline void ccArrayRemoveObject(ccArray *arr, CCObject* object)
{ {
unsigned int index = ccArrayGetIndexOfObject(arr, object); unsigned int index = ccArrayGetIndexOfObject(arr, object);
if (index != -1) if ((int)index != -1)
{ {
ccArrayRemoveObjectAtIndex(arr, index); ccArrayRemoveObjectAtIndex(arr, index);
} }
@ -422,7 +422,7 @@ static inline void ccCArrayFastRemoveValueAtIndex(ccCArray *arr, unsigned int in
static inline void ccCArrayRemoveValue(ccCArray *arr, void* value) static inline void ccCArrayRemoveValue(ccCArray *arr, void* value)
{ {
unsigned int index = ccCArrayGetIndexOfValue(arr, value); unsigned int index = ccCArrayGetIndexOfValue(arr, value);
if (index != -1) if ((int)index != -1)
{ {
ccCArrayRemoveValueAtIndex(arr, index); ccCArrayRemoveValueAtIndex(arr, index);
} }

View File

@ -33,7 +33,7 @@ static int _calcCharCount(const char * pszText)
{ {
int n = 0; int n = 0;
char ch = 0; char ch = 0;
while (ch = *pszText) while ((ch = *pszText))
{ {
CC_BREAK_IF(! ch); CC_BREAK_IF(! ch);
@ -174,7 +174,7 @@ void CCTextFieldTTF::insertText(const char * text, int len)
// insert \n means input end // insert \n means input end
int nPos = sInsert.find('\n'); int nPos = sInsert.find('\n');
if (sInsert.npos != nPos) if ((int)sInsert.npos != nPos)
{ {
len = nPos; len = nPos;
sInsert.erase(nPos); sInsert.erase(nPos);
@ -194,7 +194,7 @@ void CCTextFieldTTF::insertText(const char * text, int len)
setString(sText.c_str()); setString(sText.c_str());
} }
if (sInsert.npos == nPos) { if ((int)sInsert.npos == nPos) {
return; return;
} }

View File

@ -62,12 +62,12 @@ namespace cocos2d {
static CCTexture2DPixelFormat g_defaultAlphaPixelFormat = kCCTexture2DPixelFormat_Default; static CCTexture2DPixelFormat g_defaultAlphaPixelFormat = kCCTexture2DPixelFormat_Default;
CCTexture2D::CCTexture2D() CCTexture2D::CCTexture2D()
: m_uName(0) : m_uPixelsWide(0)
, m_bHasPremultipliedAlpha(false) , m_uPixelsHigh(0)
, m_uName(0)
, m_fMaxS(0.0) , m_fMaxS(0.0)
, m_fMaxT(0.0) , m_fMaxT(0.0)
, m_uPixelsHigh(0) , m_bHasPremultipliedAlpha(false)
, m_uPixelsWide(0)
{ {
} }
@ -145,6 +145,7 @@ void CCTexture2D::releaseData(void *data)
void* CCTexture2D::keepData(void *data, unsigned int length) 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. //The texture data mustn't be saved becuase it isn't a mutable texture.
return data; return data;
} }
@ -291,7 +292,7 @@ bool CCTexture2D::initPremultipliedATextureWithImage(CCImage *image, unsigned in
tempData = (unsigned char*)(image->getData()); tempData = (unsigned char*)(image->getData());
CCAssert(tempData != NULL, "NULL image data."); 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]; data = new unsigned char[POTHigh * POTWide * 4];
memcpy(data, tempData, POTHigh * POTWide * 4); memcpy(data, tempData, POTHigh * POTWide * 4);
@ -315,7 +316,7 @@ bool CCTexture2D::initPremultipliedATextureWithImage(CCImage *image, unsigned in
case kCCTexture2DPixelFormat_RGB888: case kCCTexture2DPixelFormat_RGB888:
tempData = (unsigned char*)(image->getData()); tempData = (unsigned char*)(image->getData());
CCAssert(tempData != NULL, "NULL image data."); 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]; data = new unsigned char[POTHigh * POTWide * 3];
memcpy(data, tempData, POTHigh * POTWide * 3); memcpy(data, tempData, POTHigh * POTWide * 3);

View File

@ -40,8 +40,8 @@ THE SOFTWARE.
namespace cocos2d { namespace cocos2d {
CCTextureAtlas::CCTextureAtlas() CCTextureAtlas::CCTextureAtlas()
:m_pTexture(NULL) :m_pIndices(NULL)
,m_pIndices(NULL) ,m_pTexture(NULL)
,m_pQuads(NULL) ,m_pQuads(NULL)
{} {}
@ -189,14 +189,14 @@ void CCTextureAtlas::initIndices()
m_pIndices[i*6+4] = i*4+3; m_pIndices[i*6+4] = i*4+3;
m_pIndices[i*6+5] = i*4+3; m_pIndices[i*6+5] = i*4+3;
#else #else
m_pIndices[i*6+0] = i*4+0; m_pIndices[i*6+0] = (GLushort)(i*4+0);
m_pIndices[i*6+1] = i*4+1; m_pIndices[i*6+1] = (GLushort)(i*4+1);
m_pIndices[i*6+2] = i*4+2; m_pIndices[i*6+2] = (GLushort)(i*4+2);
// inverted index. issue #179 // inverted index. issue #179
m_pIndices[i*6+3] = i*4+3; m_pIndices[i*6+3] = (GLushort)(i*4+3);
m_pIndices[i*6+4] = i*4+2; m_pIndices[i*6+4] = (GLushort)(i*4+2);
m_pIndices[i*6+5] = i*4+1; m_pIndices[i*6+5] = (GLushort)(i*4+1);
// m_pIndices[i*6+3] = i*4+2; // m_pIndices[i*6+3] = i*4+2;
// m_pIndices[i*6+4] = i*4+3; // m_pIndices[i*6+4] = i*4+3;
// m_pIndices[i*6+5] = i*4+1; // m_pIndices[i*6+5] = i*4+1;

View File

@ -363,7 +363,7 @@ CCTexture2D* CCTextureCache::addUIImage(CCImage *image, const char *key)
do do
{ {
// If key is nil, then create a new texture each time // If key is nil, then create a new texture each time
if(texture = m_pTextures->objectForKey(forKey)) if((texture = m_pTextures->objectForKey(forKey)))
{ {
break; break;
} }
@ -456,10 +456,10 @@ VolatileTexture::VolatileTexture(CCTexture2D *t)
, m_bIsString(false) , m_bIsString(false)
, m_strFileName("") , m_strFileName("")
, m_FmtImage(CCImage::kFmtPng) , m_FmtImage(CCImage::kFmtPng)
, m_alignment(CCTextAlignmentCenter)
, m_strFontName("") , m_strFontName("")
, m_strText("") , m_strText("")
, m_fFontSize(0.0f) , m_fFontSize(0.0f)
, m_alignment(CCTextAlignmentCenter)
{ {
m_size = CCSizeMake(0, 0); m_size = CCSizeMake(0, 0);
textures.push_back(this); textures.push_back(this);

View File

@ -71,6 +71,9 @@ namespace cocos2d {
} }
void CCParallaxNode::addChild(CCNode * child, int zOrder, int tag) 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"); CCAssert(0,"ParallaxNode: use addChild:z:parallaxRatio:positionOffset instead");
} }
void CCParallaxNode::addChild(CCNode *child, int z, CCPoint ratio, CCPoint offset) void CCParallaxNode::addChild(CCNode *child, int z, CCPoint ratio, CCPoint offset)

View File

@ -92,14 +92,14 @@ namespace cocos2d {
return false; return false;
} }
CCTMXLayer::CCTMXLayer() CCTMXLayer::CCTMXLayer()
:m_pTiles(NULL) :m_tLayerSize(CCSizeZero)
,m_tMapTileSize(CCSizeZero)
,m_pTiles(NULL)
,m_pTileSet(NULL) ,m_pTileSet(NULL)
,m_pProperties(NULL) ,m_pProperties(NULL)
,m_sLayerName("")
,m_pReusedTile(NULL) ,m_pReusedTile(NULL)
,m_pAtlasIndexArray(NULL) ,m_pAtlasIndexArray(NULL)
,m_tLayerSize(CCSizeZero)
,m_tMapTileSize(CCSizeZero)
,m_sLayerName("")
{} {}
CCTMXLayer::~CCTMXLayer() CCTMXLayer::~CCTMXLayer()
{ {
@ -446,6 +446,9 @@ namespace cocos2d {
} }
void CCTMXLayer::addChild(CCNode * child, int zOrder, int tag) 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:"); CCAssert(0, "addChild: is not supported on CCTMXLayer. Instead use setTileGID:at:/tileAt:");
} }
void CCTMXLayer::removeChild(CCNode* node, bool cleanup) void CCTMXLayer::removeChild(CCNode* node, bool cleanup)

View File

@ -30,8 +30,8 @@ namespace cocos2d {
//implementation CCTMXObjectGroup //implementation CCTMXObjectGroup
CCTMXObjectGroup::CCTMXObjectGroup() CCTMXObjectGroup::CCTMXObjectGroup()
:m_sGroupName("") :m_tPositionOffset(CCPointZero)
,m_tPositionOffset(CCPointZero) ,m_sGroupName("")
{ {
m_pObjects = new CCMutableArray<CCStringToStringDictionary*>(); m_pObjects = new CCMutableArray<CCStringToStringDictionary*>();
m_pProperties = new CCStringToStringDictionary(); m_pProperties = new CCStringToStringDictionary();

View File

@ -104,8 +104,8 @@ namespace cocos2d{
return true; return true;
} }
CCTMXTiledMap::CCTMXTiledMap() CCTMXTiledMap::CCTMXTiledMap()
:m_tTileSize(CCSizeZero) :m_tMapSize(CCSizeZero)
,m_tMapSize(CCSizeZero) ,m_tTileSize(CCSizeZero)
,m_pObjectGroups(NULL) ,m_pObjectGroups(NULL)
,m_pProperties(NULL) ,m_pProperties(NULL)
,m_pTileProperties(NULL) ,m_pTileProperties(NULL)

View File

@ -64,11 +64,11 @@ namespace cocos2d {
} }
// implementation CCTMXLayerInfo // implementation CCTMXLayerInfo
CCTMXLayerInfo::CCTMXLayerInfo() CCTMXLayerInfo::CCTMXLayerInfo()
:m_bOwnTiles(true) : m_sName("")
, m_pTiles(NULL)
, m_bOwnTiles(true)
, m_uMinGID(100000) , m_uMinGID(100000)
, m_uMaxGID(0) , m_uMaxGID(0)
,m_sName("")
,m_pTiles(NULL)
, m_tOffset(CCPointZero) , m_tOffset(CCPointZero)
{ {
m_pProperties= new CCStringToStringDictionary();; m_pProperties= new CCStringToStringDictionary();;
@ -150,13 +150,13 @@ namespace cocos2d {
return parseXMLFile(m_sTMXFileName.c_str()); return parseXMLFile(m_sTMXFileName.c_str());
} }
CCTMXMapInfo::CCTMXMapInfo() CCTMXMapInfo::CCTMXMapInfo()
:m_bStoringCharacters(false) :m_tMapSize(CCSizeZero)
,m_nLayerAttribs(0)
,m_tMapSize(CCSizeZero)
,m_tTileSize(CCSizeZero) ,m_tTileSize(CCSizeZero)
,m_pLayers(NULL) ,m_pLayers(NULL)
,m_pTilesets(NULL) ,m_pTilesets(NULL)
,m_pObjectGroups(NULL) ,m_pObjectGroups(NULL)
,m_nLayerAttribs(0)
,m_bStoringCharacters(false)
,m_pProperties(NULL) ,m_pProperties(NULL)
,m_pTileProperties(NULL) ,m_pTileProperties(NULL)
{ {
@ -239,6 +239,7 @@ namespace cocos2d {
// the XML parser calls here with all the elements // the XML parser calls here with all the elements
void CCTMXMapInfo::startElement(void *ctx, const char *name, const char **atts) void CCTMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
{ {
CC_UNUSED_PARAM(ctx);
CCTMXMapInfo *pTMXMapInfo = this; CCTMXMapInfo *pTMXMapInfo = this;
std::string elementName = (char*)name; std::string elementName = (char*)name;
std::map<std::string, std::string> *attributeDict = new std::map<std::string, std::string>(); std::map<std::string, std::string> *attributeDict = new std::map<std::string, std::string>();
@ -519,6 +520,7 @@ namespace cocos2d {
void CCTMXMapInfo::endElement(void *ctx, const char *name) void CCTMXMapInfo::endElement(void *ctx, const char *name)
{ {
CC_UNUSED_PARAM(ctx);
CCTMXMapInfo *pTMXMapInfo = this; CCTMXMapInfo *pTMXMapInfo = this;
std::string elementName = (char*)name; std::string elementName = (char*)name;
@ -586,6 +588,7 @@ namespace cocos2d {
void CCTMXMapInfo::textHandler(void *ctx, const char *ch, int len) void CCTMXMapInfo::textHandler(void *ctx, const char *ch, int len)
{ {
CC_UNUSED_PARAM(ctx);
CCTMXMapInfo *pTMXMapInfo = this; CCTMXMapInfo *pTMXMapInfo = this;
std::string pText((char*)ch,0,len); std::string pText((char*)ch,0,len);

View File

@ -59,8 +59,8 @@ namespace cocos2d {
return false; return false;
} }
CCTileMapAtlas::CCTileMapAtlas() CCTileMapAtlas::CCTileMapAtlas()
:m_pPosToAtlasIndex(NULL) :m_pTGAInfo(NULL)
,m_pTGAInfo(NULL) ,m_pPosToAtlasIndex(NULL)
,m_nItemsToRender(0) ,m_nItemsToRender(0)
{ {
} }

View File

@ -231,6 +231,8 @@ void CCTouchDispatcher::removeAllDelegates(void)
void CCTouchDispatcher::setPriority(int nPriority, CCTouchDelegate *pDelegate) void CCTouchDispatcher::setPriority(int nPriority, CCTouchDelegate *pDelegate)
{ {
CC_UNUSED_PARAM(nPriority);
CC_UNUSED_PARAM(pDelegate);
assert(0); assert(0);
} }