mirror of https://github.com/axmolengine/axmol.git
Merge pull request #3288 from minggo/ndk-r9-fixes
Fix build with -Werror=format-security (default in Android NDK r9)
This commit is contained in:
commit
5e8c3a54c1
|
@ -74,7 +74,7 @@ SimpleAudioEngine::SimpleAudioEngine()
|
|||
|
||||
const char* deviceModel = methodInfo.env->GetStringUTFChars(jstr, NULL);
|
||||
|
||||
LOGD(deviceModel);
|
||||
LOGD("%s", deviceModel);
|
||||
|
||||
if (strcmp(I9100_MODEL, deviceModel) == 0)
|
||||
{
|
||||
|
|
|
@ -371,7 +371,7 @@ void OpenSLEngine::createEngine(void* pHandle)
|
|||
const char* errorInfo = dlerror();
|
||||
if (errorInfo)
|
||||
{
|
||||
LOGD(errorInfo);
|
||||
LOGD("%s", errorInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ bool SimpleAudioEngineOpenSL::initEngine()
|
|||
const char* errorInfo = dlerror();
|
||||
if (errorInfo)
|
||||
{
|
||||
LOGD(errorInfo);
|
||||
LOGD("%s", errorInfo);
|
||||
bRet = false;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -35,14 +35,11 @@ NS_CC_BEGIN
|
|||
// XXX deprecated
|
||||
void CCLog(const char * pszFormat, ...)
|
||||
{
|
||||
char buf[MAX_LEN];
|
||||
|
||||
va_list args;
|
||||
va_start(args, pszFormat);
|
||||
vsnprintf(buf, MAX_LEN, pszFormat, args);
|
||||
__android_log_vprint(ANDROID_LOG_DEBUG, "cocos2d-x debug info", pszFormat, args);
|
||||
va_end(args);
|
||||
|
||||
__android_log_print(ANDROID_LOG_DEBUG, "cocos2d-x debug info", buf);
|
||||
}
|
||||
|
||||
void log(const char * pszFormat, ...)
|
||||
|
@ -64,7 +61,7 @@ void MessageBox(const char * pszMsg, const char * pszTitle)
|
|||
|
||||
void LuaLog(const char * pszFormat)
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_DEBUG, "cocos2d-x debug info", pszFormat);
|
||||
__android_log_write(ANDROID_LOG_DEBUG, "cocos2d-x debug info", pszFormat);
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -228,7 +228,7 @@ unsigned char* FileUtilsAndroid::doGetFileData(const char* filename, const char*
|
|||
{
|
||||
std::string msg = "Get data from file(";
|
||||
msg.append(filename).append(") failed!");
|
||||
CCLOG(msg.c_str());
|
||||
CCLOG("%s", msg.c_str());
|
||||
}
|
||||
|
||||
return pData;
|
||||
|
|
Loading…
Reference in New Issue