Fix all gcc warnings in NaCl build.

This commit is contained in:
Sam Clegg 2013-03-04 10:21:45 -08:00
parent 38878b084b
commit 4d0aa01c4b
10 changed files with 14 additions and 15 deletions

View File

@ -208,7 +208,6 @@ namespace CocosDenshion
ALenum format;
int result;
int section;
int err;
unsigned int size = 0;
if (ov_fopen(pszFilePath, &ogg_file) < 0)

View File

@ -34,6 +34,7 @@ NS_CC_BEGIN
CCApplication* CCApplication::sm_pSharedApplication = 0;
bool CCApplication::s_running = false;
/*
static long getCurrentMillSecond()
{
long lLastTime;
@ -43,6 +44,7 @@ static long getCurrentMillSecond()
lLastTime = stCurrentTime.tv_sec * 1000 + stCurrentTime.tv_usec * 0.001;
return lLastTime;
}
*/
CCApplication::CCApplication()
{

View File

@ -44,7 +44,7 @@ private:
CCFileUtilsNaCl() {}
public:
/* override funtions */
bool init() {}
bool init() { return true; }
virtual std::string getWritablePath();
virtual bool isFileExist(const std::string& strFilePath);
};

View File

@ -78,7 +78,8 @@ public:
iMaxLineHeight = 0;
//Free all text lines
size_t size = vLines.size();
for (int i=0; i<size; ++i) {
for (size_t i=0; i<size; ++i)
{
TextLine line = vLines[i];
free(line.text);
}
@ -330,8 +331,6 @@ public:
bool getBitmap(const char *text, int nWidth, int nHeight, CCImage::ETextAlign eAlignMask, const char * pFontName, float fontSize)
{
FT_Error iError;
bool bRet = false;
if (libError)
return false;
@ -427,7 +426,7 @@ private:
int openFont(const std::string& fontName, uint fontSize, const std::string& fontNameOrig);
std::string fileNameExtension(const std::string& pathName);
int m_cachedSize;
uint m_cachedSize;
FT_Face m_cachedFont;
std::string m_cachedFontname;
std::string m_cachedFontnameOrig;

View File

@ -265,10 +265,10 @@ bool CCTexturePVR::unpackPVRv2Data(unsigned char* data, unsigned int len)
//Make sure that tag is in correct formatting
pvrTag = CC_SWAP_INT32_LITTLE_TO_HOST(header->pvrTag);
if (gPVRTexIdentifier[0] != ((pvrTag >> 0) & 0xff) ||
gPVRTexIdentifier[1] != ((pvrTag >> 8) & 0xff) ||
gPVRTexIdentifier[2] != ((pvrTag >> 16) & 0xff) ||
gPVRTexIdentifier[3] != ((pvrTag >> 24) & 0xff))
if (gPVRTexIdentifier[0] != (char)(((pvrTag >> 0) & 0xff)) ||
gPVRTexIdentifier[1] != (char)(((pvrTag >> 8) & 0xff)) ||
gPVRTexIdentifier[2] != (char)(((pvrTag >> 16) & 0xff)) ||
gPVRTexIdentifier[3] != (char)(((pvrTag >> 24) & 0xff)))
{
return false;
}

View File

@ -52,11 +52,12 @@ void downloadFiles(MainThreadRunner* runner, const char** filenames, int num_fil
void* cocos_main(void* arg)
{
CocosPepperInstance* instance = (CocosPepperInstance*)arg;
fprintf(stderr, "in cocos_main\n");
#ifdef OLD_NACL_MOUNTS
// TODO(sbc): remove this hack an replace with some kind of URL mount
CocosPepperInstance* instance = (CocosPepperInstance*)arg;
mkdir("ipad", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
mkdir("iphone", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
mkdir("fonts", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
@ -71,7 +72,6 @@ void* cocos_main(void* arg)
downloadFiles(instance->m_runner, filenames, sizeof(filenames)/sizeof(char*));
#endif
CCEGLView* eglView = CCEGLView::sharedOpenGLView();
fprintf(stderr, "calling application->run\n");
int rtn = CCApplication::sharedApplication()->run();
fprintf(stderr, "app run returned: %d\n", rtn);

View File

@ -38,6 +38,7 @@ public:
Test::Step(settings);
b2Sweep sweepA;
sweepA.alpha0 = 0;
sweepA.c0.Set(24.0f, -60.0f);
sweepA.a0 = 2.95f;
sweepA.c = sweepA.c0;
@ -45,6 +46,7 @@ public:
sweepA.localCenter.SetZero();
b2Sweep sweepB;
sweepB.alpha0 = 0;
sweepB.c0.Set(53.474274f, -50.252514f);
sweepB.a0 = 513.36676f; // - 162.0f * b2_pi;
sweepB.c.Set(54.595478f, -51.083473f);

View File

@ -129,7 +129,6 @@ void* cocos_main(void* arg)
downloadFiles(instance->m_runner, filenames, sizeof(filenames)/sizeof(char*));
#endif
CCEGLView* eglView = CCEGLView::sharedOpenGLView();
fprintf(stderr, "calling application->run\n");
int rtn = CCApplication::sharedApplication()->run();
fprintf(stderr, "app run returned: %d\n", rtn);

View File

@ -73,7 +73,6 @@ void* cocos_main(void* arg)
downloadFiles(instance->m_runner, filenames, sizeof(filenames)/sizeof(char*));
#endif
CCEGLView* eglView = CCEGLView::sharedOpenGLView();
fprintf(stderr, "calling application->run\n");
int rtn = CCApplication::sharedApplication()->run();
fprintf(stderr, "app run returned: %d\n", rtn);

View File

@ -133,7 +133,6 @@ void* cocos_main(void* arg)
downloadFiles(instance->m_runner, filenames, sizeof(filenames)/sizeof(char*));
#endif
CCEGLView* eglView = CCEGLView::sharedOpenGLView();
fprintf(stderr, "calling application->run\n");
int rtn = CCApplication::sharedApplication()->run();
fprintf(stderr, "app run returned: %d\n", rtn);