mirror of https://github.com/axmolengine/axmol.git
Fix build with -Werror=format-security (default in Android NDK r9)
This commit is contained in:
parent
b06d34e090
commit
3ea77ec933
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -331,7 +331,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;
|
||||
}
|
||||
|
|
|
@ -34,14 +34,11 @@ NS_CC_BEGIN
|
|||
|
||||
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 CCMessageBox(const char * pszMsg, const char * pszTitle)
|
||||
|
@ -51,7 +48,7 @@ void CCMessageBox(const char * pszMsg, const char * pszTitle)
|
|||
|
||||
void CCLuaLog(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
|
||||
|
|
|
@ -153,7 +153,7 @@ unsigned char* CCFileUtilsAndroid::getFileData(const char* pszFileName, const ch
|
|||
{
|
||||
std::string msg = "Get data from file(";
|
||||
msg.append(pszFileName).append(") failed!");
|
||||
CCLOG(msg.c_str());
|
||||
CCLOG("%s", msg.c_str());
|
||||
}
|
||||
|
||||
return pData;
|
||||
|
|
Loading…
Reference in New Issue