From 9e05f300f3cc9c27adbcdfe25af445ae92286065 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 20 Dec 2013 21:16:46 +0800 Subject: [PATCH] [Data Refactor] compilation error fix. --- cocos/2d/CCUserDefault.cpp | 2 +- cocos/2d/CCUserDefault.mm | 2 +- cocos/2d/platform/CCSAXParser.cpp | 2 +- cocos/2d/platform/CCSAXParser.h | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cocos/2d/CCUserDefault.cpp b/cocos/2d/CCUserDefault.cpp index 3bfb0d9142..90e721e436 100644 --- a/cocos/2d/CCUserDefault.cpp +++ b/cocos/2d/CCUserDefault.cpp @@ -289,7 +289,7 @@ string UserDefault::getStringForKey(const char* pKey, const std::string & defaul Data UserDefault::getDataForKey(const char* pKey) { - return getDataForKey(pKey, NULL); + return getDataForKey(pKey, Data::Null); } Data UserDefault::getDataForKey(const char* pKey, const Data& defaultValue) diff --git a/cocos/2d/CCUserDefault.mm b/cocos/2d/CCUserDefault.mm index 4280eb135f..6193113a85 100644 --- a/cocos/2d/CCUserDefault.mm +++ b/cocos/2d/CCUserDefault.mm @@ -365,7 +365,7 @@ string UserDefault::getStringForKey(const char* pKey, const std::string & defaul Data UserDefault::getDataForKey(const char* pKey) { - return getDataForKey(pKey, NULL); + return getDataForKey(pKey, Data::Null); } Data UserDefault::getDataForKey(const char* pKey, const Data& defaultValue) diff --git a/cocos/2d/platform/CCSAXParser.cpp b/cocos/2d/platform/CCSAXParser.cpp index e66bef90da..0c5282bfe1 100644 --- a/cocos/2d/platform/CCSAXParser.cpp +++ b/cocos/2d/platform/CCSAXParser.cpp @@ -111,7 +111,7 @@ bool SAXParser::parse(const char* xmlData, size_t dataLength) return tinyDoc.Accept( &printer ); } -bool SAXParser::parse(const char *pszFile) +bool SAXParser::parse(const std::string& filename) { bool ret = false; Data data = FileUtils::getInstance()->getDataFromFile(filename); diff --git a/cocos/2d/platform/CCSAXParser.h b/cocos/2d/platform/CCSAXParser.h index 09d5152563..63665f4ec7 100644 --- a/cocos/2d/platform/CCSAXParser.h +++ b/cocos/2d/platform/CCSAXParser.h @@ -26,7 +26,7 @@ #include "CCPlatformConfig.h" #include "platform/CCCommon.h" -#include "string.h" // for size_t +#include NS_CC_BEGIN @@ -87,7 +87,7 @@ public: * @js NA * @lua NA */ - bool parse(const char *file); + bool parse(const std::string& filename); /** * @js NA * @lua NA