Use *mut T for the T* pointers in SpiderMonkey.

This commit is contained in:
Ms2ger 2014-05-26 18:19:44 +02:00
parent 3e4b2c1c7b
commit d5cb4377ef
18 changed files with 294 additions and 308 deletions

View file

@ -643,7 +643,7 @@ impl ScriptTask {
fn new_rt_and_cx() -> (js::rust::rt, Rc<Cx>) {
let js_runtime = js::rust::rt();
assert!({
let ptr: *JSRuntime = (*js_runtime).ptr;
let ptr: *mut JSRuntime = (*js_runtime).ptr;
ptr.is_not_null()
});
unsafe {
@ -652,18 +652,18 @@ impl ScriptTask {
// to retrieve the default callback is as the result of
// JS_SetWrapObjectCallbacks, which is why we call it twice.
let callback = JS_SetWrapObjectCallbacks((*js_runtime).ptr,
ptr::null(),
wrap_for_same_compartment,
None,
Some(wrap_for_same_compartment),
None);
JS_SetWrapObjectCallbacks((*js_runtime).ptr,
callback,
wrap_for_same_compartment,
Some(wrap_for_same_compartment),
Some(pre_wrap));
}
let js_context = js_runtime.cx();
assert!({
let ptr: *JSContext = (*js_context).ptr;
let ptr: *mut JSContext = (*js_context).ptr;
ptr.is_not_null()
});
js_context.set_default_options_and_version();
@ -675,7 +675,7 @@ impl ScriptTask {
(js_runtime, js_context)
}
pub fn get_cx(&self) -> *JSContext {
pub fn get_cx(&self) -> *mut JSContext {
(**self.js_context.borrow().get_ref()).ptr
}
@ -835,11 +835,11 @@ impl ScriptTask {
// TODO: Support extra arguments. This requires passing a `*JSVal` array as `argv`.
let cx = self.get_cx();
with_compartment(cx, this_value, || {
let rval = NullValue();
let mut rval = NullValue();
unsafe {
JS_CallFunctionValue(cx, this_value,
*timer_handle.data.funval,
0, ptr::null(), &rval);
0, ptr::mut_null(), &mut rval);
}
});
@ -1242,7 +1242,7 @@ impl ScriptTask {
}
/// Shuts down layout for the given page tree.
fn shut_down_layout(page_tree: &Rc<Page>, rt: *JSRuntime) {
fn shut_down_layout(page_tree: &Rc<Page>, rt: *mut JSRuntime) {
for page in page_tree.iter() {
page.join_layout();