Bug 453094 - Some strong type conversion make GCC not complain; r=jorendorff sr=peterv

This commit is contained in:
Bo Yang 2009-01-02 07:21:26 +01:00
parent c0e84d173f
commit 86206e20f5

View File

@ -348,7 +348,7 @@ xpc_qsDOMString::xpc_qsDOMString(JSContext *cx, jsval *pval)
typedef implementation_type::char_traits traits;
jsval v;
JSString *s;
const jschar *chars;
const PRUnichar *chars;
size_t len;
v = *pval;
@ -376,7 +376,7 @@ xpc_qsDOMString::xpc_qsDOMString(JSContext *cx, jsval *pval)
}
len = JS_GetStringLength(s);
chars = (len == 0 ? traits::sEmptyBuffer : JS_GetStringChars(s));
chars = (len == 0 ? traits::sEmptyBuffer : (const PRUnichar*)JS_GetStringChars(s));
new(mBuf) implementation_type(chars, len);
mValid = JS_TRUE;
}
@ -387,7 +387,7 @@ xpc_qsAString::xpc_qsAString(JSContext *cx, jsval *pval)
typedef implementation_type::char_traits traits;
jsval v;
JSString *s;
const jschar *chars;
const PRUnichar *chars;
size_t len;
v = *pval;
@ -415,7 +415,7 @@ xpc_qsAString::xpc_qsAString(JSContext *cx, jsval *pval)
}
len = JS_GetStringLength(s);
chars = (len == 0 ? traits::sEmptyBuffer : JS_GetStringChars(s));
chars = (len == 0 ? traits::sEmptyBuffer : (const PRUnichar*)JS_GetStringChars(s));
new(mBuf) implementation_type(chars, len);
mValid = JS_TRUE;
}
@ -720,7 +720,7 @@ xpc_qsJsvalToWcharStr(JSContext *cx, jsval *pval, PRUnichar **pstr)
*pval = STRING_TO_JSVAL(str); // Root the new string.
}
*pstr = JS_GetStringChars(str);
*pstr = (PRUnichar*)JS_GetStringChars(str);
return JS_TRUE;
}