Merge pull request #2386 from dumganhar/master

fixed #2059: Fix complication errors on Android.
This commit is contained in:
James Chen 2013-04-17 02:09:11 -07:00
commit 62f3528282
3 changed files with 3 additions and 3 deletions

View File

@ -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); int len = cc_utf8_strlen(str_old, length);
if (rUtf16Size != NULL) { if (rUtf16Size != NULL) {

View File

@ -59,7 +59,7 @@ CC_DLL std::vector<unsigned short> cc_utf16_vec_from_utf16_str(const unsigned sh
* *
* Return value: the newly created utf8 string. * 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: * cc_utf16_to_utf8:

View File

@ -1530,7 +1530,7 @@ jsval c_string_to_jsval(JSContext* cx, const char* v, size_t length /* = -1 */)
return JSVAL_NULL; return JSVAL_NULL;
} }
jsval ret = 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); jschar* strUTF16 = (jschar*)cc_utf8_to_utf16(v, length, &utf16_size);
if (strUTF16 && utf16_size > 0) { if (strUTF16 && utf16_size > 0) {