auto merge of #483 : oncemoreification/servo/fix_some_warnings, r=brson

Less yelling: https://github.com/mozilla/servo/issues/455
This commit is contained in:
bors-servo 2013-05-25 16:30:33 -07:00
commit 5be7bfa14f
4 changed files with 29 additions and 22 deletions

View file

@ -165,7 +165,11 @@ impl Drop for Shaper {
impl Shaper {
pub fn new(font: @mut Font) -> Shaper {
let font_ptr: *mut Font = &mut *font;
// Indirection for Rust Issue #6248, dynamic freeze scope artifically extended
let font_ptr = {
let borrowed_font= &mut *font;
borrowed_font as *mut Font
};
let hb_face: *hb_face_t = hb_face_create_for_tables(get_font_table_func,
font_ptr as *c_void,
null());

View file

@ -43,8 +43,7 @@ priv struct ImageState {
pub impl LocalImageCache {
/// The local cache will only do a single remote request for a given
/// URL in each 'round'. Layout should call this each time it begins
// FIXME: 'pub' is an unexpected token?
/* pub */ fn next_round(&mut self, on_image_available: @fn() -> ~fn(ImageResponseMsg)) {
pub fn next_round(&mut self, on_image_available: @fn() -> ~fn(ImageResponseMsg)) {
self.round_number += 1;
self.on_image_available = Some(on_image_available);
}
@ -135,7 +134,7 @@ pub impl LocalImageCache {
}
priv fn get_state(&self, url: &Url) -> @mut ImageState {
*do self.state_map.find_or_insert_with(url.clone()) |_| {
let state = do self.state_map.find_or_insert_with(url.clone()) |_| {
let new_state = @mut ImageState {
prefetched: false,
decoded: false,
@ -143,7 +142,8 @@ pub impl LocalImageCache {
last_response: ImageNotReady
};
new_state
}
};
*state // Unborrowing the state
}
}

View file

@ -174,7 +174,7 @@ fn run_main_loop(po: Port<Msg>, script_chan: SharedChan<ScriptMsg>, opts: &Opts,
};
// Set the layer's transform.
let mut origin = Point2D(buffer.rect.origin.x as f32,
let origin = Point2D(buffer.rect.origin.x as f32,
buffer.rect.origin.y as f32);
let transform = original_layer_transform.translate(origin.x,
origin.y,

View file

@ -201,8 +201,11 @@ impl ScriptContext {
window_size: Size2D(800, 600),
damage: MatchSelectorsDamage,
};
let script_context_ptr: *ScriptContext = &*script_context;
// Indirection for Rust Issue #6248, dynamic freeze scope artifically extended
let script_context_ptr = {
let borrowed_ctx= &mut *script_context;
borrowed_ctx as *mut ScriptContext
};
js_context.set_cx_private(script_context_ptr as *());
unsafe {