From 63ce8adfad324948d62ac12899480ba2500935d2 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 17 Apr 2013 17:05:39 +0800 Subject: [PATCH] fixed #2059: Fix complication errors on Android. --- cocos2dx/support/ccUTF8.cpp | 2 +- cocos2dx/support/ccUTF8.h | 2 +- scripting/javascript/bindings/ScriptingCore.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos2dx/support/ccUTF8.cpp b/cocos2dx/support/ccUTF8.cpp index 53d90b13d6..963d5cd2c4 100644 --- a/cocos2dx/support/ccUTF8.cpp +++ b/cocos2dx/support/ccUTF8.cpp @@ -275,7 +275,7 @@ cc_utf8_get_char (const char * p) } -unsigned short* cc_utf8_to_utf16(const char* str_old, size_t length/* = -1 */, size_t* rUtf16Size/* = NULL */) +unsigned short* cc_utf8_to_utf16(const char* str_old, int length/* = -1 */, int* rUtf16Size/* = NULL */) { int len = cc_utf8_strlen(str_old, length); if (rUtf16Size != NULL) { diff --git a/cocos2dx/support/ccUTF8.h b/cocos2dx/support/ccUTF8.h index e8799e8733..87c7a465b8 100644 --- a/cocos2dx/support/ccUTF8.h +++ b/cocos2dx/support/ccUTF8.h @@ -59,7 +59,7 @@ CC_DLL std::vector cc_utf16_vec_from_utf16_str(const unsigned sh * * Return value: the newly created utf8 string. * */ -CC_DLL unsigned short* cc_utf8_to_utf16(const char* str_old, size_t length = -1, size_t* rUtf16Size = NULL); +CC_DLL unsigned short* cc_utf8_to_utf16(const char* str_old, int length = -1, int* rUtf16Size = NULL); /** * cc_utf16_to_utf8: diff --git a/scripting/javascript/bindings/ScriptingCore.cpp b/scripting/javascript/bindings/ScriptingCore.cpp index 2a2f32ad70..f10ae9da45 100644 --- a/scripting/javascript/bindings/ScriptingCore.cpp +++ b/scripting/javascript/bindings/ScriptingCore.cpp @@ -1530,7 +1530,7 @@ jsval c_string_to_jsval(JSContext* cx, const char* v, size_t length /* = -1 */) return JSVAL_NULL; } jsval ret = JSVAL_NULL; - size_t utf16_size = 0; + int utf16_size = 0; jschar* strUTF16 = (jschar*)cc_utf8_to_utf16(v, length, &utf16_size); if (strUTF16 && utf16_size > 0) {