Fix upstream build breaks from reinterpret_cast

This commit is contained in:
Brian J. Burg 2012-09-05 12:10:26 -07:00
parent 4ef4c36fa7
commit 1b54eacbe1
23 changed files with 98 additions and 99 deletions

View file

@ -63,7 +63,7 @@ unsafe fn domstring_to_jsval(cx: *JSContext, str: DOMString) -> jsval {
}
str(s) => {
str::as_buf(s, |buf, len| {
let cbuf = unsafe::reinterpret_cast(buf);
let cbuf = unsafe::reinterpret_cast(&buf);
RUST_STRING_TO_JSVAL(JS_NewStringCopyN(cx, cbuf, len as libc::size_t))
})
}
@ -73,7 +73,7 @@ unsafe fn domstring_to_jsval(cx: *JSContext, str: DOMString) -> jsval {
fn get_compartment(cx: *JSContext) -> *bare_compartment {
unsafe {
let priv: *libc::c_void = JS_GetContextPrivate(cx);
let compartment: *bare_compartment = unsafe::reinterpret_cast(priv);
let compartment: *bare_compartment = unsafe::reinterpret_cast(&priv);
assert cx == (*compartment).cx.ptr;
compartment
}