fix compilation warnings on android & ios

This commit is contained in:
Walzer 2012-05-05 10:44:42 +08:00
parent 6b374881f0
commit 184b31efa3
5 changed files with 28 additions and 28 deletions

View File

@ -157,7 +157,7 @@ void CCTimer::update(ccTime dt)
m_fElapsed += dt;
if (m_fElapsed >= m_fInterval)
{
if (m_pTarget != NULL && m_pfnSelector != NULL)
if (m_pTarget && m_pfnSelector)
{
(m_pTarget->*m_pfnSelector)(m_fElapsed);
}
@ -175,7 +175,7 @@ void CCTimer::update(ccTime dt)
{
if( m_fElapsed >= m_fDelay )
{
if (m_pTarget != NULL && m_pfnSelector != NULL)
if (m_pTarget && m_pfnSelector)
{
(m_pTarget->*m_pfnSelector)(m_fElapsed);
}
@ -192,7 +192,7 @@ void CCTimer::update(ccTime dt)
{
if (m_fElapsed >= m_fInterval)
{
if (m_pTarget != NULL && m_pfnSelector != NULL)
if (m_pTarget && m_pfnSelector)
{
(m_pTarget->*m_pfnSelector)(m_fElapsed);
}

View File

@ -179,7 +179,7 @@ void CCControl::removeTargetWithActionForControlEvent(CCObject* target, SEL_Menu
//remove all invocations if the target and action are null
//TODO: should the invocations be deleted, or just removed from the array? Won't that cause issues if you add a single invocation for multiple events?
bool bDeleteObjects=true;
if (target == NULL && action == NULL)
if (!target && !action)
{
//remove objects
eventInvocationList->removeAllObjects();

View File

@ -1086,7 +1086,7 @@ void CCLabelBMFont::updateLabel()
vector<unsigned short> last_word;
last_word.reserve( stringLength );
unsigned int line = 1, i = 0;
int line = 1, i = 0;
bool start_line = false, start_word = false;
float startOfLine = -1, startOfWord = -1;
int skip = 0;

View File

@ -1,18 +1,18 @@
" \n\
#ifdef GL_ES \n\
" \n\
#ifdef GL_ES \n\
precision lowp float; \n\
#endif \n\
\n\
varying vec4 v_fragmentColor; \n\
varying vec2 v_texCoord; \n\
uniform sampler2D u_texture; \n\
uniform sampler2D u_mask; \n\
\n\
void main() \n\
{ \n\
vec4 texColor = texture2D(u_texture, v_texCoord); \n\
vec4 maskColor = texture2D(u_mask, v_texCoord); \n\
vec4 finalColor = vec4(texColor.r, texColor.g, texColor.b, maskColor.a * texColor.a); \n\
gl_FragColor = v_fragmentColor * finalColor; \n\
} \n\
";
#endif \n\
\n\
varying vec4 v_fragmentColor; \n\
varying vec2 v_texCoord; \n\
uniform sampler2D u_texture; \n\
uniform sampler2D u_mask; \n\
\n\
void main() \n\
{ \n\
vec4 texColor = texture2D(u_texture, v_texCoord); \n\
vec4 maskColor = texture2D(u_mask, v_texCoord); \n\
vec4 finalColor = vec4(texColor.r, texColor.g, texColor.b, maskColor.a * texColor.a); \n\
gl_FragColor = v_fragmentColor * finalColor; \n\
} \n\
";

View File

@ -613,17 +613,17 @@ void CCTMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
else if (elementName == "polygon")
{
// find parent object's dict and add polygon-points to it
CCTMXObjectGroup* objectGroup = (CCTMXObjectGroup*)m_pObjectGroups->lastObject();
CCDictionary* dict = (CCDictionary*)objectGroup->getObjects()->lastObject();
//TODO: dict->setObject(attributeDict objectForKey:@"points"] forKey:@"polygonPoints"];
// CCTMXObjectGroup* objectGroup = (CCTMXObjectGroup*)m_pObjectGroups->lastObject();
// CCDictionary* dict = (CCDictionary*)objectGroup->getObjects()->lastObject();
// TODO: dict->setObject(attributeDict objectForKey:@"points"] forKey:@"polygonPoints"];
}
else if (elementName == "polyline")
{
// find parent object's dict and add polyline-points to it
CCTMXObjectGroup* objectGroup = (CCTMXObjectGroup*)m_pObjectGroups->lastObject();
CCDictionary* dict = (CCDictionary*)objectGroup->getObjects()->lastObject();
//TODO: dict->setObject:[attributeDict objectForKey:@"points"] forKey:@"polylinePoints"];
// CCTMXObjectGroup* objectGroup = (CCTMXObjectGroup*)m_pObjectGroups->lastObject();
// CCDictionary* dict = (CCDictionary*)objectGroup->getObjects()->lastObject();
// TODO: dict->setObject:[attributeDict objectForKey:@"points"] forKey:@"polylinePoints"];
}
if (attributeDict)