Fix all compiler warnings produced by gcc.

This allows the linux and NaCl builds (and perhaps others)
to be compiles with -Wall and -Werror, and it makes the build
output much less noisy.
This commit is contained in:
Sam Clegg 2013-03-02 18:32:09 -08:00
parent da0aadefe4
commit 38878b084b
48 changed files with 235 additions and 244 deletions

View File

@ -45,7 +45,6 @@ void FmodAudioPlayer::init() {
FMOD_RESULT result; FMOD_RESULT result;
FMOD::ChannelGroup *masterChannelGroup; FMOD::ChannelGroup *masterChannelGroup;
unsigned int version;
/* /*
Create a System object and initialize. Create a System object and initialize.
*/ */

View File

@ -37,13 +37,13 @@ CCConfiguration* CCConfiguration::s_gSharedConfiguration = NULL;
CCConfiguration::CCConfiguration(void) CCConfiguration::CCConfiguration(void)
: m_nMaxTextureSize(0) : m_nMaxTextureSize(0)
, m_nMaxModelviewStackDepth(0) , m_nMaxModelviewStackDepth(0)
, m_nMaxTextureUnits(0)
, m_bSupportsPVRTC(false) , m_bSupportsPVRTC(false)
, m_bSupportsNPOT(false) , m_bSupportsNPOT(false)
, m_bSupportsBGRA8888(false) , m_bSupportsBGRA8888(false)
, m_bSupportsShareableVAO(false)
, m_bSupportsDiscardFramebuffer(false) , m_bSupportsDiscardFramebuffer(false)
, m_bSupportsShareableVAO(false)
, m_nMaxSamplesAllowed(0) , m_nMaxSamplesAllowed(0)
, m_nMaxTextureUnits(0)
, m_pGlExtensions(NULL) , m_pGlExtensions(NULL)
{ {
} }
@ -77,14 +77,13 @@ bool CCConfiguration::init(void)
CCLOG("cocos2d: GL supports discard_framebuffer: %s", (m_bSupportsDiscardFramebuffer ? "YES" : "NO")); CCLOG("cocos2d: GL supports discard_framebuffer: %s", (m_bSupportsDiscardFramebuffer ? "YES" : "NO"));
CCLOG("cocos2d: GL supports shareable VAO: %s", (m_bSupportsShareableVAO ? "YES" : "NO") ); CCLOG("cocos2d: GL supports shareable VAO: %s", (m_bSupportsShareableVAO ? "YES" : "NO") );
bool bEnableProfilers = false; bool CC_UNUSED bEnableProfilers = false;
#if CC_ENABLE_PROFILERS #if CC_ENABLE_PROFILERS
bEnableProfilers = true; bEnableProfilers = true;
#else #else
bEnableProfilers = false; bEnableProfilers = false;
#endif #endif
CCLOG("cocos2d: compiled with Profiling Support: %s", CCLOG("cocos2d: compiled with Profiling Support: %s",
bEnableProfilers ? "YES - *** Disable it when you finish profiling ***" : "NO"); bEnableProfilers ? "YES - *** Disable it when you finish profiling ***" : "NO");

View File

@ -71,15 +71,15 @@ typedef struct _hashSelectorEntry
// implementation CCTimer // implementation CCTimer
CCTimer::CCTimer() CCTimer::CCTimer()
: m_pfnSelector(NULL) : m_pTarget(NULL)
, m_fInterval(0.0f)
, m_pTarget(NULL)
, m_fElapsed(-1) , m_fElapsed(-1)
, m_bRunForever(false) , m_bRunForever(false)
, m_bUseDelay(false) , m_bUseDelay(false)
, m_uTimesExecuted(0) , m_uTimesExecuted(0)
, m_uRepeat(0) , m_uRepeat(0)
, m_fDelay(0.0f) , m_fDelay(0.0f)
, m_fInterval(0.0f)
, m_pfnSelector(NULL)
, m_nScriptHandler(0) , m_nScriptHandler(0)
{ {
} }
@ -243,8 +243,8 @@ CCScheduler::CCScheduler(void)
, m_pHashForTimers(NULL) , m_pHashForTimers(NULL)
, m_pCurrentTarget(NULL) , m_pCurrentTarget(NULL)
, m_bCurrentTargetSalvaged(false) , m_bCurrentTargetSalvaged(false)
, m_pScriptHandlerEntries(NULL)
, m_bUpdateHashLocked(false) , m_bUpdateHashLocked(false)
, m_pScriptHandlerEntries(NULL)
{ {
} }
@ -635,7 +635,7 @@ void CCScheduler::unscheduleScriptEntry(unsigned int uScheduleScriptEntryID)
for (int i = m_pScriptHandlerEntries->count() - 1; i >= 0; i--) for (int i = m_pScriptHandlerEntries->count() - 1; i >= 0; i--)
{ {
CCSchedulerScriptHandlerEntry* pEntry = static_cast<CCSchedulerScriptHandlerEntry*>(m_pScriptHandlerEntries->objectAtIndex(i)); CCSchedulerScriptHandlerEntry* pEntry = static_cast<CCSchedulerScriptHandlerEntry*>(m_pScriptHandlerEntries->objectAtIndex(i));
if (pEntry->getEntryId() == uScheduleScriptEntryID) if (pEntry->getEntryId() == (int)uScheduleScriptEntryID)
{ {
pEntry->markedForDeletion(); pEntry->markedForDeletion();
break; break;

View File

@ -261,8 +261,8 @@ CCCardinalSplineTo::~CCCardinalSplineTo()
CCCardinalSplineTo::CCCardinalSplineTo() CCCardinalSplineTo::CCCardinalSplineTo()
: m_pPoints(NULL) : m_pPoints(NULL)
, m_fTension(0.f)
, m_fDeltaT(0.f) , m_fDeltaT(0.f)
, m_fTension(0.f)
{ {
} }

View File

@ -342,7 +342,7 @@ void CCShuffleTiles::startWithTarget(CCNode *pTarget)
{ {
CCTiledGrid3DAction::startWithTarget(pTarget); CCTiledGrid3DAction::startWithTarget(pTarget);
if (m_nSeed != -1) if (m_nSeed != (unsigned int)-1)
{ {
srand(m_nSeed); srand(m_nSeed);
} }
@ -699,7 +699,7 @@ void CCTurnOffTiles::startWithTarget(CCNode *pTarget)
CCTiledGrid3DAction::startWithTarget(pTarget); CCTiledGrid3DAction::startWithTarget(pTarget);
if (m_nSeed != -1) if (m_nSeed != (unsigned int)-1)
{ {
srand(m_nSeed); srand(m_nSeed);
} }

View File

@ -52,42 +52,42 @@ NS_CC_BEGIN
static int s_globalOrderOfArrival = 1; static int s_globalOrderOfArrival = 1;
CCNode::CCNode(void) CCNode::CCNode(void)
: m_nZOrder(0) : m_fRotationX(0.0f)
, m_fVertexZ(0.0f)
, m_fRotationX(0.0f)
, m_fRotationY(0.0f) , m_fRotationY(0.0f)
, m_fScaleX(1.0f) , m_fScaleX(1.0f)
, m_fScaleY(1.0f) , m_fScaleY(1.0f)
, m_fVertexZ(0.0f)
, m_obPosition(CCPointZero) , m_obPosition(CCPointZero)
, m_fSkewX(0.0f) , m_fSkewX(0.0f)
, m_fSkewY(0.0f) , m_fSkewY(0.0f)
// children (lazy allocs)
, m_pChildren(NULL)
// lazy alloc
, m_pCamera(NULL)
, m_pGrid(NULL)
, m_bVisible(true)
, m_obAnchorPoint(CCPointZero)
, m_obAnchorPointInPoints(CCPointZero) , m_obAnchorPointInPoints(CCPointZero)
, m_obAnchorPoint(CCPointZero)
, m_obContentSize(CCSizeZero) , m_obContentSize(CCSizeZero)
, m_bRunning(false) , m_sAdditionalTransform(CCAffineTransformMakeIdentity())
, m_pCamera(NULL)
// children (lazy allocs)
// lazy alloc
, m_pGrid(NULL)
, m_nZOrder(0)
, m_pChildren(NULL)
, m_pParent(NULL) , m_pParent(NULL)
// "whole screen" objects. like Scenes and Layers, should set m_bIgnoreAnchorPointForPosition to false // "whole screen" objects. like Scenes and Layers, should set m_bIgnoreAnchorPointForPosition to false
, m_bIgnoreAnchorPointForPosition(false)
, m_nTag(kCCNodeTagInvalid) , m_nTag(kCCNodeTagInvalid)
// userData is always inited as nil // userData is always inited as nil
, m_pUserData(NULL) , m_pUserData(NULL)
, m_pUserObject(NULL) , m_pUserObject(NULL)
, m_pShaderProgram(NULL)
, m_eGLServerState(ccGLServerState(0))
, m_uOrderOfArrival(0)
, m_bRunning(false)
, m_bTransformDirty(true) , m_bTransformDirty(true)
, m_bInverseDirty(true) , m_bInverseDirty(true)
, m_bAdditionalTransformDirty(false)
, m_bVisible(true)
, m_bIgnoreAnchorPointForPosition(false)
, m_bReorderChildDirty(false)
, m_nScriptHandler(0) , m_nScriptHandler(0)
, m_nUpdateScriptHandler(0) , m_nUpdateScriptHandler(0)
, m_pShaderProgram(NULL)
, m_uOrderOfArrival(0)
, m_eGLServerState(ccGLServerState(0))
, m_bReorderChildDirty(false)
, m_sAdditionalTransform(CCAffineTransformMakeIdentity())
, m_bAdditionalTransformDirty(false)
{ {
// set default scheduler and actionManager // set default scheduler and actionManager
CCDirector *director = CCDirector::sharedDirector(); CCDirector *director = CCDirector::sharedDirector();

View File

@ -38,9 +38,9 @@ CCObject* CCCopying::copyWithZone(CCZone *pZone)
} }
CCObject::CCObject(void) CCObject::CCObject(void)
:m_uAutoReleaseCount(0) : m_nLuaID(0)
, m_uReference(1) // when the object is created, the reference count of it is 1 , m_uReference(1) // when the object is created, the reference count of it is 1
,m_nLuaID(0) , m_uAutoReleaseCount(0)
{ {
static unsigned int uObjectCount = 0; static unsigned int uObjectCount = 0;

View File

@ -518,17 +518,17 @@ bool CCLabelBMFont::initWithString(const char *theString, const char *fntFile, f
} }
CCLabelBMFont::CCLabelBMFont() CCLabelBMFont::CCLabelBMFont()
: m_cDisplayedOpacity(255) : m_sString(NULL)
, m_pConfiguration(NULL)
, m_bLineBreakWithoutSpaces(false)
, m_tImageOffset(CCPointZero)
, m_cDisplayedOpacity(255)
, m_cRealOpacity(255) , m_cRealOpacity(255)
, m_tDisplayedColor(ccWHITE) , m_tDisplayedColor(ccWHITE)
, m_tRealColor(ccWHITE) , m_tRealColor(ccWHITE)
, m_bCascadeOpacityEnabled(true)
, m_bCascadeColorEnabled(true) , m_bCascadeColorEnabled(true)
, m_bCascadeOpacityEnabled(true)
, m_bIsOpacityModifyRGB(false) , m_bIsOpacityModifyRGB(false)
, m_pConfiguration(NULL)
, m_sString(NULL)
, m_bLineBreakWithoutSpaces(false)
, m_tImageOffset(CCPointZero)
{ {
} }

View File

@ -275,9 +275,12 @@ protected:
CCSprite *m_pReusedChar; CCSprite *m_pReusedChar;
// texture RGBA // texture RGBA
GLubyte m_cDisplayedOpacity, m_cRealOpacity; GLubyte m_cDisplayedOpacity;
ccColor3B m_tDisplayedColor, m_tRealColor; GLubyte m_cRealOpacity;
bool m_bCascadeColorEnabled, m_bCascadeOpacityEnabled; ccColor3B m_tDisplayedColor;
ccColor3B m_tRealColor;
bool m_bCascadeColorEnabled;
bool m_bCascadeOpacityEnabled;
/** conforms to CCRGBAProtocol protocol */ /** conforms to CCRGBAProtocol protocol */
bool m_bIsOpacityModifyRGB; bool m_bIsOpacityModifyRGB;

View File

@ -49,8 +49,8 @@ CCLayer::CCLayer()
, m_pScriptTouchHandlerEntry(NULL) , m_pScriptTouchHandlerEntry(NULL)
, m_pScriptKeypadHandlerEntry(NULL) , m_pScriptKeypadHandlerEntry(NULL)
, m_pScriptAccelerateHandlerEntry(NULL) , m_pScriptAccelerateHandlerEntry(NULL)
, m_eTouchMode(kCCTouchesAllAtOnce)
, m_nTouchPriority(0) , m_nTouchPriority(0)
, m_eTouchMode(kCCTouchesAllAtOnce)
{ {
m_bIgnoreAnchorPointForPosition = true; m_bIgnoreAnchorPointForPosition = true;
setAnchorPoint(ccp(0.5f, 0.5f)); setAnchorPoint(ccp(0.5f, 0.5f));
@ -494,8 +494,8 @@ CCLayerRGBA::CCLayerRGBA()
, _realOpacity (255) , _realOpacity (255)
, _displayedColor(ccWHITE) , _displayedColor(ccWHITE)
, _realColor(ccWHITE) , _realColor(ccWHITE)
, _cascadeColorEnabled(false)
, _cascadeOpacityEnabled(false) , _cascadeOpacityEnabled(false)
, _cascadeColorEnabled(false)
{} {}
CCLayerRGBA::~CCLayerRGBA() {} CCLayerRGBA::~CCLayerRGBA() {}
@ -711,7 +711,7 @@ bool CCLayerColor::initWithColor(const ccColor4B& color, GLfloat w, GLfloat h)
_displayedColor.b = _realColor.b = color.b; _displayedColor.b = _realColor.b = color.b;
_displayedOpacity = color.a; _displayedOpacity = color.a;
for (int i = 0; i<sizeof(m_pSquareVertices) / sizeof( m_pSquareVertices[0]); i++ ) for (size_t i = 0; i<sizeof(m_pSquareVertices) / sizeof( m_pSquareVertices[0]); i++ )
{ {
m_pSquareVertices[i].x = 0.0f; m_pSquareVertices[i].x = 0.0f;
m_pSquareVertices[i].y = 0.0f; m_pSquareVertices[i].y = 0.0f;

View File

@ -163,8 +163,10 @@ private:
int excuteScriptTouchHandler(int nEventType, CCSet *pTouches); int excuteScriptTouchHandler(int nEventType, CCSet *pTouches);
}; };
#ifdef __apple__
#pragma mark - #pragma mark -
#pragma mark CCLayerRGBA #pragma mark CCLayerRGBA
#endif
/** CCLayerRGBA is a subclass of CCLayer that implements the CCRGBAProtocol protocol using a solid color as the background. /** CCLayerRGBA is a subclass of CCLayer that implements the CCRGBAProtocol protocol using a solid color as the background.

View File

@ -51,8 +51,8 @@ static void setProgram(CCNode *n, CCGLProgram *p)
CCClippingNode::CCClippingNode() CCClippingNode::CCClippingNode()
: m_pStencil(NULL) : m_pStencil(NULL)
, m_bInverted(false)
, m_fAlphaThreshold(0.0f) , m_fAlphaThreshold(0.0f)
, m_bInverted(false)
{} {}
CCClippingNode::~CCClippingNode() CCClippingNode::~CCClippingNode()

View File

@ -36,6 +36,7 @@ NS_CC_BEGIN
CCMotionStreak::CCMotionStreak() CCMotionStreak::CCMotionStreak()
: m_bFastMode(false) : m_bFastMode(false)
, m_bStartingPositionInitialized(false)
, m_pTexture(NULL) , m_pTexture(NULL)
, m_tPositionR(CCPointZero) , m_tPositionR(CCPointZero)
, m_fStroke(0.0f) , m_fStroke(0.0f)
@ -49,7 +50,6 @@ CCMotionStreak::CCMotionStreak()
, m_pVertices(NULL) , m_pVertices(NULL)
, m_pColorPointer(NULL) , m_pColorPointer(NULL)
, m_pTexCoords(NULL) , m_pTexCoords(NULL)
, m_bStartingPositionInitialized(false)
{ {
m_tBlendFunc.src = GL_SRC_ALPHA; m_tBlendFunc.src = GL_SRC_ALPHA;
m_tBlendFunc.dst = GL_ONE_MINUS_SRC_ALPHA; m_tBlendFunc.dst = GL_ONE_MINUS_SRC_ALPHA;

View File

@ -87,6 +87,10 @@ CCParticleSystem::CCParticleSystem()
, m_pParticles(NULL) , m_pParticles(NULL)
, m_fEmitCounter(0) , m_fEmitCounter(0)
, m_uParticleIdx(0) , m_uParticleIdx(0)
, m_pBatchNode(NULL)
, m_uAtlasIndex(0)
, m_bTransformSystemDirty(false)
, m_uAllocatedParticles(0)
, m_bIsActive(true) , m_bIsActive(true)
, m_uParticleCount(0) , m_uParticleCount(0)
, m_fDuration(0) , m_fDuration(0)
@ -112,10 +116,6 @@ CCParticleSystem::CCParticleSystem()
, m_ePositionType(kCCPositionTypeFree) , m_ePositionType(kCCPositionTypeFree)
, m_bIsAutoRemoveOnFinish(false) , m_bIsAutoRemoveOnFinish(false)
, m_nEmitterMode(kCCParticleModeGravity) , m_nEmitterMode(kCCParticleModeGravity)
,m_pBatchNode(NULL)
,m_uAtlasIndex(0)
,m_bTransformSystemDirty(false)
,m_uAllocatedParticles(0)
{ {
modeA.gravity = CCPointZero; modeA.gravity = CCPointZero;
modeA.speed = 0; modeA.speed = 0;

View File

@ -44,8 +44,8 @@ static void removeUsedIndexBit(int index)
CCEGLViewProtocol::CCEGLViewProtocol() CCEGLViewProtocol::CCEGLViewProtocol()
: m_pDelegate(NULL) : m_pDelegate(NULL)
, m_fScaleY(1.0f)
, m_fScaleX(1.0f) , m_fScaleX(1.0f)
, m_fScaleY(1.0f)
, m_eResolutionPolicy(kResolutionUnKnown) , m_eResolutionPolicy(kResolutionUnKnown)
{ {
} }

View File

@ -419,8 +419,7 @@ unsigned char* CCFileUtils::getFileDataFromZip(const char* pszZipFilePath, const
CC_BREAK_IF(UNZ_OK != nRet); CC_BREAK_IF(UNZ_OK != nRet);
pBuffer = new unsigned char[FileInfo.uncompressed_size]; pBuffer = new unsigned char[FileInfo.uncompressed_size];
int nSize = 0; int CC_UNUSED nSize = unzReadCurrentFile(pFile, pBuffer, FileInfo.uncompressed_size);
nSize = unzReadCurrentFile(pFile, pBuffer, FileInfo.uncompressed_size);
CCAssert(nSize == 0 || nSize == (int)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;

View File

@ -527,22 +527,22 @@ static uint64 _tiffSeekProc(thandle_t fd, uint64 off, int whence)
{ {
if (whence == SEEK_SET) if (whence == SEEK_SET)
{ {
CC_BREAK_IF(off > isource->size-1); CC_BREAK_IF(off >= (uint64)isource->size);
ret = isource->offset = (uint32)off; ret = isource->offset = (uint32)off;
} }
else if (whence == SEEK_CUR) else if (whence == SEEK_CUR)
{ {
CC_BREAK_IF(isource->offset + off > isource->size-1); CC_BREAK_IF(isource->offset + off >= (uint64)isource->size);
ret = isource->offset += (uint32)off; ret = isource->offset += (uint32)off;
} }
else if (whence == SEEK_END) else if (whence == SEEK_END)
{ {
CC_BREAK_IF(off > isource->size-1); CC_BREAK_IF(off >= (uint64)isource->size);
ret = isource->offset = (uint32)(isource->size-1 - off); ret = isource->offset = (uint32)(isource->size-1 - off);
} }
else else
{ {
CC_BREAK_IF(off > isource->size-1); CC_BREAK_IF(off >= (uint64)isource->size);
ret = isource->offset = (uint32)off; ret = isource->offset = (uint32)off;
} }
} while (0); } while (0);
@ -620,11 +620,11 @@ bool CCImage::_initWithTiffData(void* pData, int nDataLen)
{ {
if (TIFFReadRGBAImageOriented(tif, w, h, raster, ORIENTATION_TOPLEFT, 0)) if (TIFFReadRGBAImageOriented(tif, w, h, raster, ORIENTATION_TOPLEFT, 0))
{ {
/* the raster data is pre-multiplied by the alpha component
after invoking TIFFReadRGBAImageOriented
unsigned char* src = (unsigned char*)raster; unsigned char* src = (unsigned char*)raster;
unsigned int* tmp = (unsigned int*)m_pData; unsigned int* tmp = (unsigned int*)m_pData;
/* the raster data is pre-multiplied by the alpha component
after invoking TIFFReadRGBAImageOriented
for(int j = 0; j < m_nWidth * m_nHeight * 4; j += 4) for(int j = 0; j < m_nWidth * m_nHeight * 4; j += 4)
{ {
*tmp++ = CC_RGB_PREMULTIPLY_ALPHA( src[j], src[j + 1], *tmp++ = CC_RGB_PREMULTIPLY_ALPHA( src[j], src[j + 1],

View File

@ -244,4 +244,10 @@ public: virtual void set##funName(varType var) \
#define CC_DEPRECATED_ATTRIBUTE #define CC_DEPRECATED_ATTRIBUTE
#endif #endif
#ifdef __GNUC__
#define CC_UNUSED __attribute__ ((unused))
#else
#define CC_UNUSED
#endif
#endif // __CC_PLATFORM_MACROS_H__ #endif // __CC_PLATFORM_MACROS_H__

View File

@ -56,7 +56,7 @@ public:
iMaxLineHeight = 0; iMaxLineHeight = 0;
//Free all text lines //Free all text lines
size_t size = vLines.size(); size_t size = vLines.size();
for (int i=0; i<size; ++i) { for (size_t i=0; i<size; ++i) {
TextLine line = vLines[i]; TextLine line = vLines[i];
free(line.text); free(line.text);
} }
@ -106,7 +106,7 @@ public:
oTempLine.text = text; oTempLine.text = text;
//get last glyph //get last glyph
int iError = FT_Load_Char(face, cLastChar, FT_LOAD_DEFAULT); FT_Load_Char(face, cLastChar, FT_LOAD_DEFAULT);
oTempLine.iLineWidth = iCurXCursor;// - SHIFT6((face->glyph->metrics.horiAdvance + face->glyph->metrics.horiBearingX - face->glyph->metrics.width))/*-iInterval*/;//TODO interval oTempLine.iLineWidth = iCurXCursor;// - SHIFT6((face->glyph->metrics.horiAdvance + face->glyph->metrics.horiBearingX - face->glyph->metrics.width))/*-iInterval*/;//TODO interval
iMaxLineWidth = MAX(iMaxLineWidth, oTempLine.iLineWidth); iMaxLineWidth = MAX(iMaxLineWidth, oTempLine.iLineWidth);
@ -116,7 +116,7 @@ public:
bool divideString(FT_Face face, const char* sText, int iMaxWidth, int iMaxHeight) { bool divideString(FT_Face face, const char* sText, int iMaxWidth, int iMaxHeight) {
int iError = 0; int iError = 0;
int iCurXCursor, iCurYCursor; int iCurXCursor;
const char* pText = sText; const char* pText = sText;
FT_UInt unicode = utf8((char**)&pText); FT_UInt unicode = utf8((char**)&pText);
@ -131,7 +131,7 @@ public:
pText = sText; pText = sText;
size_t text_len = 0; size_t text_len = 0;
wchar_t* text_buf = (wchar_t*) malloc(sizeof(wchar_t) * strlen(sText)); wchar_t* text_buf = (wchar_t*) malloc(sizeof(wchar_t) * strlen(sText));
while (unicode=utf8((char**)&pText)) { while ((unicode=utf8((char**)&pText))) {
if (unicode == '\n') { if (unicode == '\n') {
buildLine(text_buf, text_len, face, iCurXCursor, cLastCh); buildLine(text_buf, text_len, face, iCurXCursor, cLastCh);
text_len = 0; text_len = 0;

View File

@ -50,7 +50,9 @@ static GLuint s_uCurrentBoundTexture[kCCMaxActiveTexture] = {(GLuint)-1,(GLu
static GLenum s_eBlendingSource = -1; static GLenum s_eBlendingSource = -1;
static GLenum s_eBlendingDest = -1; static GLenum s_eBlendingDest = -1;
static int s_eGLServerState = 0; static int s_eGLServerState = 0;
#if CC_TEXTURE_ATLAS_USE_VAO
static GLuint s_uVAO = 0; static GLuint s_uVAO = 0;
#endif
#endif // CC_ENABLE_GL_STATE_CACHE #endif // CC_ENABLE_GL_STATE_CACHE
// GL State Cache functions // GL State Cache functions

View File

@ -294,8 +294,8 @@ CCSprite* CCSprite::initWithCGImage(CGImageRef pImage, const char *pszKey)
*/ */
CCSprite::CCSprite(void) CCSprite::CCSprite(void)
: m_pobTexture(NULL) : m_bShouldBeHidden(false),
, m_bShouldBeHidden(false) m_pobTexture(NULL)
{ {
} }

View File

@ -121,24 +121,6 @@ static const char *const g_utf8_skip = utf8_skip_data;
#define cc_utf8_next_char(p) (char *)((p) + g_utf8_skip[*(unsigned char *)(p)]) #define cc_utf8_next_char(p) (char *)((p) + g_utf8_skip[*(unsigned char *)(p)])
/*
* @str: the string to search through.
* @c: the character to find.
*
* Returns the index of the first occurrence of the character, if found. Otherwise -1 is returned.
*
* Return value: the index of the first occurrence of the character if found or -1 otherwise.
* */
static unsigned int cc_utf8_find_char(std::vector<unsigned short> str, unsigned short c)
{
unsigned int len = str.size();
for (unsigned int i = 0; i < len; ++i)
if (str[i] == c) return i;
return -1;
}
/* /*
* @str: the string to search through. * @str: the string to search through.
* @c: the character to not look for. * @c: the character to not look for.

View File

@ -407,8 +407,7 @@ unsigned char *ZipFile::getFileData(const std::string &fileName, unsigned long *
CC_BREAK_IF(UNZ_OK != nRet); CC_BREAK_IF(UNZ_OK != nRet);
pBuffer = new unsigned char[fileInfo.uncompressed_size]; pBuffer = new unsigned char[fileInfo.uncompressed_size];
int nSize = 0; int CC_UNUSED nSize = unzReadCurrentFile(m_data->zipFile, pBuffer, fileInfo.uncompressed_size);
nSize = unzReadCurrentFile(m_data->zipFile, pBuffer, fileInfo.uncompressed_size);
CCAssert(nSize == 0 || nSize == (int)fileInfo.uncompressed_size, "the file size is wrong"); CCAssert(nSize == 0 || nSize == (int)fileInfo.uncompressed_size, "the file size is wrong");
if (pSize) if (pSize)

View File

@ -61,14 +61,14 @@ static CCTexture2DPixelFormat g_defaultAlphaPixelFormat = kCCTexture2DPixelForma
static bool PVRHaveAlphaPremultiplied_ = false; static bool PVRHaveAlphaPremultiplied_ = false;
CCTexture2D::CCTexture2D() CCTexture2D::CCTexture2D()
: m_uPixelsWide(0) : m_bPVRHaveAlphaPremultiplied(true)
, m_uPixelsWide(0)
, m_uPixelsHigh(0) , m_uPixelsHigh(0)
, m_uName(0) , m_uName(0)
, m_fMaxS(0.0) , m_fMaxS(0.0)
, m_fMaxT(0.0) , m_fMaxT(0.0)
, m_bHasPremultipliedAlpha(false) , m_bHasPremultipliedAlpha(false)
, m_bHasMipmaps(false) , m_bHasMipmaps(false)
, m_bPVRHaveAlphaPremultiplied(true)
, m_pShaderProgram(NULL) , m_pShaderProgram(NULL)
{ {
} }
@ -445,6 +445,7 @@ bool CCTexture2D::initWithString(const char *text, const char *fontName, float f
else else
{ {
CCAssert(false, "Not supported alignment format!"); CCAssert(false, "Not supported alignment format!");
return false;
} }
do do

View File

@ -225,16 +225,16 @@ typedef struct {
CCTexturePVR::CCTexturePVR() CCTexturePVR::CCTexturePVR()
: m_pPixelFormatInfo(NULL) : m_uNumberOfMipmaps(0)
, m_uNumberOfMipmaps(0)
, m_uWidth(0) , m_uWidth(0)
, m_uHeight(0) , m_uHeight(0)
, m_bRetainName(false)
, m_bHasAlpha(false)
, m_uName(0) , m_uName(0)
, m_eFormat(kCCTexture2DPixelFormat_Default) , m_bHasAlpha(false)
, m_bHasPremultipliedAlpha(false) , m_bHasPremultipliedAlpha(false)
, m_bForcePremultipliedAlpha(false) , m_bForcePremultipliedAlpha(false)
, m_bRetainName(false)
, m_eFormat(kCCTexture2DPixelFormat_Default)
, m_pPixelFormatInfo(NULL)
{ {
} }
@ -415,7 +415,7 @@ bool CCTexturePVR::unpackPVRv3Data(unsigned char* dataPointer, unsigned int data
bool infoValid = false; bool infoValid = false;
for(int i = 0; i < PVR3_MAX_TABLE_ELEMENTS; i++) for(unsigned int i = 0; i < PVR3_MAX_TABLE_ELEMENTS; i++)
{ {
if( v3_pixel_formathash[i].pixelFormat == pixelFormat ) if( v3_pixel_formathash[i].pixelFormat == pixelFormat )
{ {

View File

@ -517,7 +517,7 @@ void CCTMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
// Parse everything automatically // Parse everything automatically
const char* pArray[] = {"name", "type", "width", "height", "gid"}; const char* pArray[] = {"name", "type", "width", "height", "gid"};
for( int i = 0; i < sizeof(pArray)/sizeof(pArray[0]); ++i ) for(size_t i = 0; i < sizeof(pArray)/sizeof(pArray[0]); ++i )
{ {
const char* key = pArray[i]; const char* key = pArray[i];
CCString* obj = new CCString(valueForKey(key, attributeDict)); CCString* obj = new CCString(valueForKey(key, attributeDict));

View File

@ -64,13 +64,13 @@ CCBReader::CCBReader(CCNodeLoaderLibrary * pCCNodeLoaderLibrary, CCBMemberVariab
, mCurrentBit(-1) , mCurrentBit(-1)
, mOwner(NULL) , mOwner(NULL)
, mActionManager(NULL) , mActionManager(NULL)
, mAnimatedProps(NULL)
, hasScriptingOwner(false)
, mActionManagers(NULL) , mActionManagers(NULL)
, mAnimatedProps(NULL)
, mOwnerOutletNodes(NULL)
, mNodesWithAnimationManagers(NULL) , mNodesWithAnimationManagers(NULL)
, mAnimationManagersForNodes(NULL) , mAnimationManagersForNodes(NULL)
, mOwnerOutletNodes(NULL)
, mOwnerCallbackNodes(NULL) , mOwnerCallbackNodes(NULL)
, hasScriptingOwner(false)
{ {
this->mCCNodeLoaderLibrary = pCCNodeLoaderLibrary; this->mCCNodeLoaderLibrary = pCCNodeLoaderLibrary;
this->mCCNodeLoaderLibrary->retain(); this->mCCNodeLoaderLibrary->retain();
@ -87,13 +87,13 @@ CCBReader::CCBReader(CCBReader * pCCBReader)
, mCurrentBit(-1) , mCurrentBit(-1)
, mOwner(NULL) , mOwner(NULL)
, mActionManager(NULL) , mActionManager(NULL)
, mAnimatedProps(NULL)
, hasScriptingOwner(false)
, mActionManagers(NULL) , mActionManagers(NULL)
, mAnimatedProps(NULL)
, mOwnerOutletNodes(NULL)
, mNodesWithAnimationManagers(NULL) , mNodesWithAnimationManagers(NULL)
, mAnimationManagersForNodes(NULL) , mAnimationManagersForNodes(NULL)
, mOwnerOutletNodes(NULL)
, mOwnerCallbackNodes(NULL) , mOwnerCallbackNodes(NULL)
, hasScriptingOwner(false)
{ {
this->mLoadedSpriteSheets = pCCBReader->mLoadedSpriteSheets; this->mLoadedSpriteSheets = pCCBReader->mLoadedSpriteSheets;
this->mCCNodeLoaderLibrary = pCCBReader->mCCNodeLoaderLibrary; this->mCCNodeLoaderLibrary = pCCBReader->mCCNodeLoaderLibrary;
@ -119,15 +119,14 @@ CCBReader::CCBReader()
, mCurrentBit(-1) , mCurrentBit(-1)
, mOwner(NULL) , mOwner(NULL)
, mActionManager(NULL) , mActionManager(NULL)
, mActionManagers(NULL)
, mCCNodeLoaderLibrary(NULL) , mCCNodeLoaderLibrary(NULL)
, mCCNodeLoaderListener(NULL) , mCCNodeLoaderListener(NULL)
, mCCBMemberVariableAssigner(NULL) , mCCBMemberVariableAssigner(NULL)
, mCCBSelectorResolver(NULL) , mCCBSelectorResolver(NULL)
, mAnimatedProps(NULL)
, hasScriptingOwner(false)
, mActionManagers(NULL)
, mNodesWithAnimationManagers(NULL) , mNodesWithAnimationManagers(NULL)
, mAnimationManagersForNodes(NULL) , mAnimationManagersForNodes(NULL)
, hasScriptingOwner(false)
{ {
init(); init();
} }
@ -862,7 +861,7 @@ bool CCBReader::readSequences()
std::string CCBReader::lastPathComponent(const char* pPath) { std::string CCBReader::lastPathComponent(const char* pPath) {
std::string path(pPath); std::string path(pPath);
int slashPos = path.find_last_of("/"); size_t slashPos = path.find_last_of("/");
if(slashPos != std::string::npos) { if(slashPos != std::string::npos) {
return path.substr(slashPos + 1, path.length() - slashPos); return path.substr(slashPos + 1, path.length() - slashPos);
} }
@ -871,7 +870,7 @@ std::string CCBReader::lastPathComponent(const char* pPath) {
std::string CCBReader::deletePathExtension(const char* pPath) { std::string CCBReader::deletePathExtension(const char* pPath) {
std::string path(pPath); std::string path(pPath);
int dotPos = path.find_last_of("."); size_t dotPos = path.find_last_of(".");
if(dotPos != std::string::npos) { if(dotPos != std::string::npos) {
return path.substr(0, dotPos); return path.substr(0, dotPos);
} }

View File

@ -196,6 +196,7 @@ private:
std::vector<std::string> mOwnerCallbackNames; std::vector<std::string> mOwnerCallbackNames;
CCArray* mOwnerCallbackNodes; CCArray* mOwnerCallbackNodes;
std::string mCCBRootPath; std::string mCCBRootPath;
bool hasScriptingOwner;
bool init(); bool init();
public: public:
CCBReader(CCNodeLoaderLibrary *pCCNodeLoaderLibrary, CCBMemberVariableAssigner *pCCBMemberVariableAssigner = NULL, CCBSelectorResolver *pCCBSelectorResolver = NULL, CCNodeLoaderListener *pCCNodeLoaderListener = NULL); CCBReader(CCNodeLoaderLibrary *pCCNodeLoaderLibrary, CCBMemberVariableAssigner *pCCBMemberVariableAssigner = NULL, CCBSelectorResolver *pCCBSelectorResolver = NULL, CCNodeLoaderListener *pCCNodeLoaderListener = NULL);
@ -262,7 +263,6 @@ public:
static float getResolutionScale(); static float getResolutionScale();
CCNode* readFileWithCleanUp(bool bCleanUp, CCDictionary* am); CCNode* readFileWithCleanUp(bool bCleanUp, CCDictionary* am);
bool hasScriptingOwner;
private: private:
void cleanUpNodeGraph(CCNode *pNode); void cleanUpNodeGraph(CCNode *pNode);

View File

@ -55,8 +55,8 @@ CCControlButton::CCControlButton()
, m_titleColorDispatchTable(NULL) , m_titleColorDispatchTable(NULL)
, m_titleLabelDispatchTable(NULL) , m_titleLabelDispatchTable(NULL)
, m_backgroundSpriteDispatchTable(NULL) , m_backgroundSpriteDispatchTable(NULL)
, m_marginH(CCControlButtonMarginLR)
, m_marginV(CCControlButtonMarginTB) , m_marginV(CCControlButtonMarginTB)
, m_marginH(CCControlButtonMarginLR)
{ {
} }

View File

@ -31,11 +31,11 @@
NS_CC_EXT_BEGIN NS_CC_EXT_BEGIN
CCControlPotentiometer::CCControlPotentiometer() CCControlPotentiometer::CCControlPotentiometer()
: m_fValue(0.0f) : m_pThumbSprite(NULL)
, m_pProgressTimer(NULL)
, m_fValue(0.0f)
, m_fMinimumValue(0.0f) , m_fMinimumValue(0.0f)
, m_fMaximumValue(0.0f) , m_fMaximumValue(0.0f)
, m_pThumbSprite(NULL)
, m_pProgressTimer(NULL)
{ {
} }

View File

@ -39,17 +39,17 @@ NS_CC_EXT_BEGIN
#define kAutorepeatIncreaseTimeIncrement 12 #define kAutorepeatIncreaseTimeIncrement 12
CCControlStepper::CCControlStepper() CCControlStepper::CCControlStepper()
: m_dValue(0.0) : m_pMinusSprite(NULL)
, m_pPlusSprite(NULL)
, m_pMinusLabel(NULL)
, m_pPlusLabel(NULL)
, m_dValue(0.0)
, m_bContinuous(false) , m_bContinuous(false)
, m_bAutorepeat(false) , m_bAutorepeat(false)
, m_bWraps(false) , m_bWraps(false)
, m_dMinimumValue(0.0) , m_dMinimumValue(0.0)
, m_dMaximumValue(0.0) , m_dMaximumValue(0.0)
, m_dStepValue(0.0) , m_dStepValue(0.0)
, m_pMinusSprite(NULL)
, m_pPlusSprite(NULL)
, m_pMinusLabel(NULL)
, m_pPlusLabel(NULL)
, m_bTouchInsideFlag(false) , m_bTouchInsideFlag(false)
, m_eTouchedPart(kCCControlStepperPartNone) , m_eTouchedPart(kCCControlStepperPartNone)
, m_nAutorepeatCount(0) , m_nAutorepeatCount(0)

View File

@ -45,12 +45,12 @@ CCScrollView::CCScrollView()
, m_fMinZoomScale(0.0f) , m_fMinZoomScale(0.0f)
, m_fMaxZoomScale(0.0f) , m_fMaxZoomScale(0.0f)
, m_pDelegate(NULL) , m_pDelegate(NULL)
, m_bDragging(false)
, m_bBounceable(false)
, m_eDirection(kCCScrollViewDirectionBoth) , m_eDirection(kCCScrollViewDirectionBoth)
, m_bClippingToBounds(false) , m_bDragging(false)
, m_pContainer(NULL) , m_pContainer(NULL)
, m_bTouchMoved(false) , m_bTouchMoved(false)
, m_bBounceable(false)
, m_bClippingToBounds(false)
, m_fTouchLength(0.0f) , m_fTouchLength(0.0f)
, m_pTouches(NULL) , m_pTouches(NULL)
, m_fMinScale(0.0f) , m_fMinScale(0.0f)

View File

@ -37,6 +37,7 @@ private:
unsigned int objectID; unsigned int objectID;
}; };
#if 0
static int _compareObject(const void * val1, const void * val2) static int _compareObject(const void * val1, const void * val2)
{ {
CCSortableObject* operand1; CCSortableObject* operand1;
@ -54,6 +55,7 @@ static int _compareObject(const void * val1, const void * val2)
} }
return 0; return 0;
} }
#endif
void CCArrayForObjectSorting::insertSortedObject(CCSortableObject* object) void CCArrayForObjectSorting::insertSortedObject(CCSortableObject* object)

View File

@ -66,12 +66,12 @@ bool CCTableView::initWithViewSize(CCSize size, CCNode* container/* = NULL*/)
} }
CCTableView::CCTableView() CCTableView::CCTableView()
: m_pIndices(NULL) : m_pTouchedCell(NULL)
, m_pIndices(NULL)
, m_pCellsUsed(NULL) , m_pCellsUsed(NULL)
, m_pCellsFreed(NULL) , m_pCellsFreed(NULL)
, m_pDataSource(NULL) , m_pDataSource(NULL)
, m_pTableViewDelegate(NULL) , m_pTableViewDelegate(NULL)
, m_pTouchedCell(NULL)
, m_eOldDirection(kCCScrollViewDirectionNone) , m_eOldDirection(kCCScrollViewDirectionNone)
{ {

View File

@ -404,8 +404,8 @@ void CCHttpClient::destroyInstance()
} }
CCHttpClient::CCHttpClient() CCHttpClient::CCHttpClient()
:_timeoutForRead(60) : _timeoutForConnect(30)
,_timeoutForConnect(30) , _timeoutForRead(60)
{ {
CCDirector::sharedDirector()->getScheduler()->scheduleSelector( CCDirector::sharedDirector()->getScheduler()->scheduleSelector(
schedule_selector(CCHttpClient::dispatchResponseCallbacks), this, 0, false); schedule_selector(CCHttpClient::dispatchResponseCallbacks), this, 0, false);

View File

@ -114,7 +114,7 @@ public:
void Step(Settings* settings) void Step(Settings* settings)
{ {
bool sleeping = true; //bool sleeping = true;
for (b2Body* b = m_world->GetBodyList(); b; b = b->GetNext()) for (b2Body* b = m_world->GetBodyList(); b; b = b->GetNext())
{ {
if (b->GetType() != b2_dynamicBody) if (b->GetType() != b2_dynamicBody)
@ -122,10 +122,10 @@ public:
continue; continue;
} }
if (b->IsAwake()) //if (b->IsAwake())
{ //{
sleeping = false; // sleeping = false;
} //}
} }
if (m_stepCount == 180) if (m_stepCount == 180)

View File

@ -86,10 +86,6 @@ public:
sweepB.GetTransform(&transformB, 0.0f); sweepB.GetTransform(&transformB, 0.0f);
b2Vec2 localPoint(2.0f, -0.1f); b2Vec2 localPoint(2.0f, -0.1f);
b2Vec2 rB = b2Mul(transformB, localPoint) - sweepB.c0;
float32 wB = sweepB.a - sweepB.a0;
b2Vec2 vB = sweepB.c - sweepB.c0;
b2Vec2 v = vB + b2Cross(wB, rB);
for (int32 i = 0; i < m_shapeB.m_vertexCount; ++i) for (int32 i = 0; i < m_shapeB.m_vertexCount; ++i)
{ {

View File

@ -16,10 +16,6 @@ enum {
}; };
// callback to remove Shapes from the Space // callback to remove Shapes from the Space
static void removeShape( cpBody *body, cpShape *shape, void *data )
{
cpShapeFree( shape );
}
ChipmunkTestLayer::ChipmunkTestLayer() ChipmunkTestLayer::ChipmunkTestLayer()
{ {

View File

@ -42,6 +42,12 @@ CurrentLanguageTest::CurrentLanguageTest()
case kLanguageHungarian: case kLanguageHungarian:
labelLanguage->setString("current language is Hungarian"); labelLanguage->setString("current language is Hungarian");
break; break;
case kLanguagePortuguese:
labelLanguage->setString("current language is Portuguese");
break;
case kLanguageArabic:
labelLanguage->setString("current language is Arabic");
break;
} }
addChild(labelLanguage); addChild(labelLanguage);

View File

@ -127,7 +127,7 @@ NotificationCenterTest::NotificationCenterTest()
light->setIsConnectToSwitch(bConnected); light->setIsConnectToSwitch(bConnected);
} }
CCNotificationCenter::sharedNotificationCenter()->postNotification(MSG_SWITCH_STATE, (CCObject*)item->getSelectedIndex()); CCNotificationCenter::sharedNotificationCenter()->postNotification(MSG_SWITCH_STATE, (CCObject*)(intptr_t)item->getSelectedIndex());
} }
void NotificationCenterTest::toExtensionsMainLayer(cocos2d::CCObject* sender) void NotificationCenterTest::toExtensionsMainLayer(cocos2d::CCObject* sender)
@ -141,7 +141,7 @@ void NotificationCenterTest::toggleSwitch(CCObject *sender)
{ {
CCMenuItemToggle* item = (CCMenuItemToggle*)sender; CCMenuItemToggle* item = (CCMenuItemToggle*)sender;
int index = item->getSelectedIndex(); int index = item->getSelectedIndex();
CCNotificationCenter::sharedNotificationCenter()->postNotification(MSG_SWITCH_STATE, (CCObject*)index); CCNotificationCenter::sharedNotificationCenter()->postNotification(MSG_SWITCH_STATE, (CCObject*)(intptr_t)index);
} }
void NotificationCenterTest::connectToSwitch(CCObject *sender) void NotificationCenterTest::connectToSwitch(CCObject *sender)

View File

@ -227,12 +227,14 @@ void TestSearchPath::onEnter()
// Gets external.txt from writable path // Gets external.txt from writable path
string fullPath = sharedFileUtils->fullPathForFilename("external.txt"); string fullPath = sharedFileUtils->fullPathForFilename("external.txt");
CCLog("\nexternal file path = %s\n", fullPath.c_str()); CCLog("\nexternal file path = %s\n", fullPath.c_str());
if (fullPath.length() > 0) { if (fullPath.length() > 0)
{
fp = fopen(fullPath.c_str(), "rb"); fp = fopen(fullPath.c_str(), "rb");
if (fp) if (fp)
{ {
char szReadBuf[100] = {0}; char szReadBuf[100] = {0};
fread(szReadBuf, 1, strlen(szBuf), fp); int read = fread(szReadBuf, 1, strlen(szBuf), fp);
if (read > 0)
CCLog("The content of file from writable path: %s", szReadBuf); CCLog("The content of file from writable path: %s", szReadBuf);
fclose(fp); fclose(fp);
} }

View File

@ -362,14 +362,14 @@ void MenuLayer3::menuCallback(CCObject* sender)
void MenuLayer3::menuCallback2(CCObject* sender) void MenuLayer3::menuCallback2(CCObject* sender)
{ {
//UXLOG("Label clicked. Toogling AtlasSprite"); //CCLOG("Label clicked. Toogling AtlasSprite");
m_disabledItem->setEnabled( ! m_disabledItem->isEnabled() ); m_disabledItem->setEnabled( ! m_disabledItem->isEnabled() );
m_disabledItem->stopAllActions(); m_disabledItem->stopAllActions();
} }
void MenuLayer3::menuCallback3(CCObject* sender) void MenuLayer3::menuCallback3(CCObject* sender)
{ {
//UXLOG("MenuItemSprite clicked"); //CCLOG("MenuItemSprite clicked");
} }
//------------------------------------------------------------------ //------------------------------------------------------------------
@ -466,7 +466,7 @@ MenuLayer4::~MenuLayer4()
void MenuLayer4::menuCallback(CCObject* sender) void MenuLayer4::menuCallback(CCObject* sender)
{ {
//UXLOG("selected item: %x index:%d", dynamic_cast<CCMenuItemToggle*>(sender)->selectedItem(), dynamic_cast<CCMenuItemToggle*>(sender)->selectedIndex() ); //CCLOG("selected item: %x index:%d", dynamic_cast<CCMenuItemToggle*>(sender)->selectedItem(), dynamic_cast<CCMenuItemToggle*>(sender)->selectedIndex() );
} }
void MenuLayer4::backCallback(CCObject* sender) void MenuLayer4::backCallback(CCObject* sender)

View File

@ -471,16 +471,16 @@ std::string StressTest2::title()
SchedulerTest1::SchedulerTest1() SchedulerTest1::SchedulerTest1()
{ {
CCLayer*layer = CCLayer::create(); CCLayer*layer = CCLayer::create();
//UXLOG("retain count after init is %d", layer->retainCount()); // 1 //CCLOG("retain count after init is %d", layer->retainCount()); // 1
addChild(layer, 0); addChild(layer, 0);
//UXLOG("retain count after addChild is %d", layer->retainCount()); // 2 //CCLOG("retain count after addChild is %d", layer->retainCount()); // 2
layer->schedule( schedule_selector(SchedulerTest1::doSomething) ); layer->schedule( schedule_selector(SchedulerTest1::doSomething) );
//UXLOG("retain count after schedule is %d", layer->retainCount()); // 3 : (object-c viersion), but win32 version is still 2, because CCTimer class don't save target. //CCLOG("retain count after schedule is %d", layer->retainCount()); // 3 : (object-c viersion), but win32 version is still 2, because CCTimer class don't save target.
layer->unschedule(schedule_selector(SchedulerTest1::doSomething)); layer->unschedule(schedule_selector(SchedulerTest1::doSomething));
//UXLOG("retain count after unschedule is %d", layer->retainCount()); // STILL 3! (win32 is '2') //CCLOG("retain count after unschedule is %d", layer->retainCount()); // STILL 3! (win32 is '2')
} }
void SchedulerTest1::doSomething(float dt) void SchedulerTest1::doSomething(float dt)
@ -560,7 +560,6 @@ CameraOrbitTest::CameraOrbitTest()
CCSprite* sprite; CCSprite* sprite;
CCOrbitCamera* orbit; CCOrbitCamera* orbit;
CCCamera* cam;
CCSize ss; CCSize ss;
// LEFT // LEFT
@ -569,7 +568,6 @@ CameraOrbitTest::CameraOrbitTest()
sprite->setScale(0.5f); sprite->setScale(0.5f);
p->addChild(sprite, 0); p->addChild(sprite, 0);
sprite->setPosition( ccp(s.width/4*1, s.height/2) ); sprite->setPosition( ccp(s.width/4*1, s.height/2) );
cam = sprite->getCamera();
orbit = CCOrbitCamera::create(2, 1, 0, 0, 360, 0, 0); orbit = CCOrbitCamera::create(2, 1, 0, 0, 360, 0, 0);
sprite->runAction( CCRepeatForever::create( orbit ) ); sprite->runAction( CCRepeatForever::create( orbit ) );

View File

@ -40,7 +40,7 @@ SceneTestLayer1::SceneTestLayer1()
void SceneTestLayer1::testDealloc(float dt) void SceneTestLayer1::testDealloc(float dt)
{ {
//UXLOG("SceneTestLayer1:testDealloc"); //CCLOG("SceneTestLayer1:testDealloc");
} }
void SceneTestLayer1::onEnter() void SceneTestLayer1::onEnter()

View File

@ -1 +1 @@
51f42cf74fedd14098cdf7ea89e53cdc81c6ee80 eff4f2aa0226630c0b7749f48604f100212b964e

View File

@ -21,7 +21,7 @@ TileMapTest::TileMapTest()
// Convert it to "alias" (GL_LINEAR filtering) // Convert it to "alias" (GL_LINEAR filtering)
map->getTexture()->setAntiAliasTexParameters(); map->getTexture()->setAntiAliasTexParameters();
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
CCLOG("ContentSize: %f, %f", s.width,s.height); CCLOG("ContentSize: %f, %f", s.width,s.height);
// If you are not going to use the Map, you can free it now // If you are not going to use the Map, you can free it now
@ -56,7 +56,7 @@ TileMapEditTest::TileMapEditTest()
// Create an Aliased Atlas // Create an Aliased Atlas
map->getTexture()->setAliasTexParameters(); map->getTexture()->setAliasTexParameters();
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
CCLOG("ContentSize: %f, %f", s.width,s.height); CCLOG("ContentSize: %f, %f", s.width,s.height);
// If you are not going to use the Map, you can free it now // If you are not going to use the Map, you can free it now
@ -86,7 +86,7 @@ void TileMapEditTest::updateMap(float dt)
// for(int y=0; y < tilemap.tgaInfo->height; y++) { // for(int y=0; y < tilemap.tgaInfo->height; y++) {
// ccColor3B c =[tilemap tileAt:CCSizeMake(x,y)); // ccColor3B c =[tilemap tileAt:CCSizeMake(x,y));
// if( c.r != 0 ) { // if( c.r != 0 ) {
// ////----UXLOG("%d,%d = %d", x,y,c.r); // ////----CCLOG("%d,%d = %d", x,y,c.r);
// } // }
// } // }
// } // }
@ -125,7 +125,7 @@ TMXOrthoTest::TMXOrthoTest()
CCTMXTiledMap* map = CCTMXTiledMap::create("TileMaps/orthogonal-test2.tmx"); CCTMXTiledMap* map = CCTMXTiledMap::create("TileMaps/orthogonal-test2.tmx");
addChild(map, 0, kTagTileMap); addChild(map, 0, kTagTileMap);
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
CCLOG("ContentSize: %f, %f", s.width,s.height); CCLOG("ContentSize: %f, %f", s.width,s.height);
CCArray * pChildrenArray = map->getChildren(); CCArray * pChildrenArray = map->getChildren();
@ -174,8 +174,8 @@ TMXOrthoTest2::TMXOrthoTest2()
CCTMXTiledMap* map = CCTMXTiledMap::create("TileMaps/orthogonal-test1.tmx"); CCTMXTiledMap* map = CCTMXTiledMap::create("TileMaps/orthogonal-test1.tmx");
addChild(map, 0, kTagTileMap); addChild(map, 0, kTagTileMap);
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
////----UXLOG("ContentSize: %f, %f", s.width,s.height); CCLOG("ContentSize: %f, %f", s.width,s.height);
CCArray* pChildrenArray = map->getChildren(); CCArray* pChildrenArray = map->getChildren();
CCSpriteBatchNode* child = NULL; CCSpriteBatchNode* child = NULL;
@ -208,8 +208,8 @@ TMXOrthoTest3::TMXOrthoTest3()
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test3.tmx"); CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test3.tmx");
addChild(map, 0, kTagTileMap); addChild(map, 0, kTagTileMap);
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
////----UXLOG("ContentSize: %f, %f", s.width,s.height); CCLOG("ContentSize: %f, %f", s.width,s.height);
CCArray* pChildrenArray = map->getChildren(); CCArray* pChildrenArray = map->getChildren();
CCSpriteBatchNode* child = NULL; CCSpriteBatchNode* child = NULL;
@ -243,8 +243,8 @@ TMXOrthoTest4::TMXOrthoTest4()
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test4.tmx"); CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test4.tmx");
addChild(map, 0, kTagTileMap); addChild(map, 0, kTagTileMap);
CCSize s1 = map->getContentSize(); CCSize CC_UNUSED s1 = map->getContentSize();
////----UXLOG("ContentSize: %f, %f", s1.width,s1.height); CCLOG("ContentSize: %f, %f", s1.width,s1.height);
CCArray* pChildrenArray = map->getChildren(); CCArray* pChildrenArray = map->getChildren();
CCSpriteBatchNode* child = NULL; CCSpriteBatchNode* child = NULL;
@ -314,8 +314,8 @@ TMXReadWriteTest::TMXReadWriteTest()
CCTMXTiledMap* map = CCTMXTiledMap::create("TileMaps/orthogonal-test2.tmx"); CCTMXTiledMap* map = CCTMXTiledMap::create("TileMaps/orthogonal-test2.tmx");
addChild(map, 0, kTagTileMap); addChild(map, 0, kTagTileMap);
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
////----UXLOG("ContentSize: %f, %f", s.width,s.height); CCLOG("ContentSize: %f, %f", s.width,s.height);
CCTMXLayer* layer = map->layerNamed("Layer 0"); CCTMXLayer* layer = map->layerNamed("Layer 0");
@ -351,21 +351,21 @@ TMXReadWriteTest::TMXReadWriteTest()
m_gid = layer->tileGIDAt(ccp(0,63)); m_gid = layer->tileGIDAt(ccp(0,63));
////----UXLOG("Tile GID at:(0,63) is: %d", m_gid); ////----CCLOG("Tile GID at:(0,63) is: %d", m_gid);
schedule(schedule_selector(TMXReadWriteTest::updateCol), 2.0f); schedule(schedule_selector(TMXReadWriteTest::updateCol), 2.0f);
schedule(schedule_selector(TMXReadWriteTest::repaintWithGID), 2.05f); schedule(schedule_selector(TMXReadWriteTest::repaintWithGID), 2.05f);
schedule(schedule_selector(TMXReadWriteTest::removeTiles), 1.0f); schedule(schedule_selector(TMXReadWriteTest::removeTiles), 1.0f);
////----UXLOG("++++atlas quantity: %d", layer->textureAtlas()->getTotalQuads()); ////----CCLOG("++++atlas quantity: %d", layer->textureAtlas()->getTotalQuads());
////----UXLOG("++++children: %d", layer->getChildren()->count() ); ////----CCLOG("++++children: %d", layer->getChildren()->count() );
m_gid2 = 0; m_gid2 = 0;
} }
void TMXReadWriteTest::removeSprite(CCNode* sender) void TMXReadWriteTest::removeSprite(CCNode* sender)
{ {
////----UXLOG("removing tile: %x", sender); ////----CCLOG("removing tile: %x", sender);
CCNode* p = ((CCNode*)sender)->getParent(); CCNode* p = ((CCNode*)sender)->getParent();
if (p) if (p)
@ -373,7 +373,7 @@ void TMXReadWriteTest::removeSprite(CCNode* sender)
p->removeChild((CCNode*)sender, true); p->removeChild((CCNode*)sender, true);
} }
//////----UXLOG("atlas quantity: %d", p->textureAtlas()->totalQuads()); //////----CCLOG("atlas quantity: %d", p->textureAtlas()->totalQuads());
} }
void TMXReadWriteTest::updateCol(float dt) void TMXReadWriteTest::updateCol(float dt)
@ -381,8 +381,8 @@ void TMXReadWriteTest::updateCol(float dt)
CCTMXTiledMap* map = (CCTMXTiledMap*)getChildByTag(kTagTileMap); CCTMXTiledMap* map = (CCTMXTiledMap*)getChildByTag(kTagTileMap);
CCTMXLayer *layer = (CCTMXLayer*)map->getChildByTag(0); CCTMXLayer *layer = (CCTMXLayer*)map->getChildByTag(0);
////----UXLOG("++++atlas quantity: %d", layer->textureAtlas()->getTotalQuads()); ////----CCLOG("++++atlas quantity: %d", layer->textureAtlas()->getTotalQuads());
////----UXLOG("++++children: %d", layer->getChildren()->count() ); ////----CCLOG("++++children: %d", layer->getChildren()->count() );
CCSize s = layer->getLayerSize(); CCSize s = layer->getLayerSize();
@ -445,8 +445,8 @@ TMXHexTest::TMXHexTest()
CCTMXTiledMap* map = CCTMXTiledMap::create("TileMaps/hexa-test.tmx"); CCTMXTiledMap* map = CCTMXTiledMap::create("TileMaps/hexa-test.tmx");
addChild(map, 0, kTagTileMap); addChild(map, 0, kTagTileMap);
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
////----UXLOG("ContentSize: %f, %f", s.width,s.height); CCLOG("ContentSize: %f, %f", s.width,s.height);
} }
std::string TMXHexTest::title() std::string TMXHexTest::title()
@ -491,8 +491,8 @@ TMXIsoTest1::TMXIsoTest1()
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/iso-test1.tmx"); CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/iso-test1.tmx");
addChild(map, 0, kTagTileMap); addChild(map, 0, kTagTileMap);
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
////----UXLOG("ContentSize: %f, %f", s.width,s.height); CCLOG("ContentSize: %f, %f", s.width,s.height);
map->setAnchorPoint(ccp(0.5f, 0.5f)); map->setAnchorPoint(ccp(0.5f, 0.5f));
} }
@ -515,8 +515,8 @@ TMXIsoTest2::TMXIsoTest2()
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/iso-test2.tmx"); CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/iso-test2.tmx");
addChild(map, 0, kTagTileMap); addChild(map, 0, kTagTileMap);
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
////----UXLOG("ContentSize: %f, %f", s.width,s.height); CCLOG("ContentSize: %f, %f", s.width,s.height);
// move map to the center of the screen // move map to the center of the screen
CCSize ms = map->getMapSize(); CCSize ms = map->getMapSize();
@ -542,8 +542,8 @@ TMXUncompressedTest::TMXUncompressedTest()
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/iso-test2-uncompressed.tmx"); CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/iso-test2-uncompressed.tmx");
addChild(map, 0, kTagTileMap); addChild(map, 0, kTagTileMap);
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
////----UXLOG("ContentSize: %f, %f", s.width,s.height); CCLOG("ContentSize: %f, %f", s.width,s.height);
// move map to the center of the screen // move map to the center of the screen
CCSize ms = map->getMapSize(); CCSize ms = map->getMapSize();
@ -581,8 +581,8 @@ TMXTilesetTest::TMXTilesetTest()
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test5.tmx"); CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test5.tmx");
addChild(map, 0, kTagTileMap); addChild(map, 0, kTagTileMap);
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
////----UXLOG("ContentSize: %f, %f", s.width,s.height); CCLOG("ContentSize: %f, %f", s.width,s.height);
CCTMXLayer* layer; CCTMXLayer* layer;
layer = map->layerNamed("Layer 0"); layer = map->layerNamed("Layer 0");
@ -610,10 +610,10 @@ TMXOrthoObjectsTest::TMXOrthoObjectsTest()
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/ortho-objects.tmx"); CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/ortho-objects.tmx");
addChild(map, -1, kTagTileMap); addChild(map, -1, kTagTileMap);
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
////----UXLOG("ContentSize: %f, %f", s.width,s.height); CCLOG("ContentSize: %f, %f", s.width,s.height);
////----UXLOG("----> Iterating over all the group objets"); ////----CCLOG("----> Iterating over all the group objets");
CCTMXObjectGroup* group = map->objectGroupNamed("Object Group 1"); CCTMXObjectGroup* group = map->objectGroupNamed("Object Group 1");
CCArray* objects = group->getObjects(); CCArray* objects = group->getObjects();
@ -626,12 +626,12 @@ TMXOrthoObjectsTest::TMXOrthoObjectsTest()
if(!dict) if(!dict)
break; break;
////----UXLOG("object: %x", dict); ////----CCLOG("object: %x", dict);
} }
////----UXLOG("----> Fetching 1 object by name"); ////----CCLOG("----> Fetching 1 object by name");
// CCStringToStringDictionary* platform = group->objectNamed("platform"); // CCStringToStringDictionary* platform = group->objectNamed("platform");
////----UXLOG("platform: %x", platform); ////----CCLOG("platform: %x", platform);
} }
void TMXOrthoObjectsTest::draw() void TMXOrthoObjectsTest::draw()
@ -690,8 +690,8 @@ TMXIsoObjectsTest::TMXIsoObjectsTest()
CCTMXTiledMap* map = CCTMXTiledMap::create("TileMaps/iso-test-objectgroup.tmx"); CCTMXTiledMap* map = CCTMXTiledMap::create("TileMaps/iso-test-objectgroup.tmx");
addChild(map, -1, kTagTileMap); addChild(map, -1, kTagTileMap);
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
////----UXLOG("ContentSize: %f, %f", s.width,s.height); CCLOG("ContentSize: %f, %f", s.width,s.height);
CCTMXObjectGroup* group = map->objectGroupNamed("Object Group 1"); CCTMXObjectGroup* group = map->objectGroupNamed("Object Group 1");
@ -707,7 +707,7 @@ TMXIsoObjectsTest::TMXIsoObjectsTest()
if(!dict) if(!dict)
break; break;
////----UXLOG("object: %x", dict); ////----CCLOG("object: %x", dict);
} }
} }
@ -767,8 +767,8 @@ TMXResizeTest::TMXResizeTest()
CCTMXTiledMap* map = CCTMXTiledMap::create("TileMaps/orthogonal-test5.tmx"); CCTMXTiledMap* map = CCTMXTiledMap::create("TileMaps/orthogonal-test5.tmx");
addChild(map, 0, kTagTileMap); addChild(map, 0, kTagTileMap);
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
////----UXLOG("ContentSize: %f, %f", s.width,s.height); CCLOG("ContentSize: %f, %f", s.width,s.height);
CCTMXLayer* layer; CCTMXLayer* layer;
layer = map->layerNamed("Layer 0"); layer = map->layerNamed("Layer 0");
@ -873,8 +873,8 @@ TMXOrthoZorder::TMXOrthoZorder()
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test-zorder.tmx"); CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test-zorder.tmx");
addChild(map, 0, kTagTileMap); addChild(map, 0, kTagTileMap);
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
////----UXLOG("ContentSize: %f, %f", s.width,s.height); CCLOG("ContentSize: %f, %f", s.width,s.height);
m_tamara = CCSprite::create(s_pPathSister1); m_tamara = CCSprite::create(s_pPathSister1);
map->addChild(m_tamara, map->getChildren()->count()); map->addChild(m_tamara, map->getChildren()->count());
@ -1004,8 +1004,8 @@ TMXOrthoVertexZ::TMXOrthoVertexZ()
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test-vertexz.tmx"); CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test-vertexz.tmx");
addChild(map, 0, kTagTileMap); addChild(map, 0, kTagTileMap);
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
////----UXLOG("ContentSize: %f, %f", s.width,s.height); CCLOG("ContentSize: %f, %f", s.width,s.height);
// because I'm lazy, I'm reusing a tile as an sprite, but since this method uses vertexZ, you // because I'm lazy, I'm reusing a tile as an sprite, but since this method uses vertexZ, you
// can use any CCSprite and it will work OK. // can use any CCSprite and it will work OK.
@ -1075,8 +1075,8 @@ TMXIsoMoveLayer::TMXIsoMoveLayer()
map->setPosition(ccp(-700,-50)); map->setPosition(ccp(-700,-50));
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
////----UXLOG("ContentSize: %f, %f", s.width,s.height); CCLOG("ContentSize: %f, %f", s.width,s.height);
} }
std::string TMXIsoMoveLayer::title() std::string TMXIsoMoveLayer::title()
@ -1100,8 +1100,8 @@ TMXOrthoMoveLayer::TMXOrthoMoveLayer()
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test-movelayer.tmx"); CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test-movelayer.tmx");
addChild(map, 0, kTagTileMap); addChild(map, 0, kTagTileMap);
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
////----UXLOG("ContentSize: %f, %f", s.width,s.height); CCLOG("ContentSize: %f, %f", s.width,s.height);
} }
std::string TMXOrthoMoveLayer::title() std::string TMXOrthoMoveLayer::title()
@ -1151,7 +1151,7 @@ TMXOrthoFlipTest::TMXOrthoFlipTest()
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/ortho-rotation-test.tmx"); CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/ortho-rotation-test.tmx");
addChild(map, 0, kTagTileMap); addChild(map, 0, kTagTileMap);
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
CCLog("ContentSize: %f, %f", s.width,s.height); CCLog("ContentSize: %f, %f", s.width,s.height);
CCObject* pObj = NULL; CCObject* pObj = NULL;
@ -1289,7 +1289,7 @@ TMXBug987::TMXBug987()
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test6.tmx"); CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test6.tmx");
addChild(map, 0, kTagTileMap); addChild(map, 0, kTagTileMap);
CCSize s1 = map->getContentSize(); CCSize CC_UNUSED s1 = map->getContentSize();
CCLOG("ContentSize: %f, %f", s1.width,s1.height); CCLOG("ContentSize: %f, %f", s1.width,s1.height);
CCArray* childs = map->getChildren(); CCArray* childs = map->getChildren();
@ -1540,7 +1540,7 @@ TMXGIDObjectsTest::TMXGIDObjectsTest()
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/test-object-layer.tmx"); CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/test-object-layer.tmx");
addChild(map, -1, kTagTileMap); addChild(map, -1, kTagTileMap);
CCSize s = map->getContentSize(); CCSize CC_UNUSED s = map->getContentSize();
CCLOG("Contentsize: %f, %f", s.width, s.height); CCLOG("Contentsize: %f, %f", s.width, s.height);
CCLOG("----> Iterating over all the group objets"); CCLOG("----> Iterating over all the group objets");

View File

@ -94,7 +94,7 @@ TOLUA_API int toluafix_remove_ccobject_by_refid(lua_State* L, int refid)
if (lua_isnil(L, -1)) if (lua_isnil(L, -1))
{ {
lua_pop(L, 2); lua_pop(L, 2);
printf("[LUA ERROR] remove CCObject with NULL type, refid: %d, ptr: %x\n", refid, (int)ptr); printf("[LUA ERROR] remove CCObject with NULL type, refid: %d, ptr: %p\n", refid, ptr);
return -1; return -1;
} }
@ -133,7 +133,7 @@ TOLUA_API int toluafix_remove_ccobject_by_refid(lua_State* L, int refid)
lua_pop(L, 1); /* stack: mt ubox */ lua_pop(L, 1); /* stack: mt ubox */
if (ud == NULL) if (ud == NULL)
{ {
printf("[LUA ERROR] remove CCObject with NULL userdata, refid: %d, ptr: %x, type: %s\n", refid, (int)ptr, type); printf("[LUA ERROR] remove CCObject with NULL userdata, refid: %d, ptr: %p, type: %s\n", refid, ptr, type);
lua_pop(L, 2); lua_pop(L, 2);
return -1; return -1;
} }

View File

@ -729,7 +729,7 @@ TOLUA_API void tolua_array (lua_State* L, const char* name, lua_CFunction get, l
TOLUA_API void tolua_dobuffer(lua_State* L, char* B, unsigned int size, const char* name) { TOLUA_API void tolua_dobuffer(lua_State* L, char* B, unsigned int size, const char* name) {
#ifdef LUA_VERSION_NUM /* lua 5.1 */ #ifdef LUA_VERSION_NUM /* lua 5.1 */
luaL_loadbuffer(L, B, size, name) || lua_pcall(L, 0, 0, 0); if (!luaL_loadbuffer(L, B, size, name)) lua_pcall(L, 0, 0, 0);
#else #else
lua_dobuffer(L, B, size, name); lua_dobuffer(L, B, size, name);
#endif #endif