From f3a8253bc8728e67f88334ef0c7d4b0590557d28 Mon Sep 17 00:00:00 2001 From: "Brian J. Burg" Date: Wed, 19 Sep 2012 17:49:55 -0700 Subject: [PATCH] Fix some unused variable compiler warnings. --- src/servo/css/parser_util.rs | 10 +++++----- src/servo/gfx/render_task.rs | 2 -- src/servo/layout/base.rs | 4 ++-- src/servo/layout/block.rs | 14 +++++++------- src/servo/layout/box_builder.rs | 2 +- src/servo/layout/inline.rs | 6 +++--- src/servo/text/text_run.rs | 2 +- 7 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/servo/css/parser_util.rs b/src/servo/css/parser_util.rs index 19c159aceed9..0c680ec9137c 100644 --- a/src/servo/css/parser_util.rs +++ b/src/servo/css/parser_util.rs @@ -51,7 +51,7 @@ fn parse_relative_size(str: ~str) -> ParseResult { } } -fn parse_font_size(str: ~str) -> ParseResult { +fn parse_font_size(_str: ~str) -> ParseResult { // TODO: complete me Value(LengthSize(Px(14.0))) } @@ -86,8 +86,8 @@ mod test { fn should_match_font_sizes() { let input = ~"* {font-size:12px; font-size:inherit; font-size:200%; font-size:x-small}"; let token_port = spawn_css_lexer_from_string(input); - let actual_rule = build_stylesheet(token_port); - let expected_rule : Stylesheet = ~[~(~[~Element(~"*", ~[])], + let _actual_rule = build_stylesheet(token_port); + let _expected_rule : Stylesheet = ~[~(~[~Element(~"*", ~[])], ~[FontSize(Specified(LengthSize(Px(12.0)))), FontSize(Specified(PercentSize(100.0))), FontSize(Specified(PercentSize(200.0))), @@ -101,8 +101,8 @@ mod test { fn should_match_width_height() { let input = ~"* {width:20%; height:auto; width:20px; width:3in; height:70px; height:30px}"; let token_port = spawn_css_lexer_from_string(input); - let actual_rule = build_stylesheet(token_port); - let expected_rule : Stylesheet = ~[~(~[~Element(~"*", ~[])], + let _actual_rule = build_stylesheet(token_port); + let _expected_rule : Stylesheet = ~[~(~[~Element(~"*", ~[])], ~[Width(Specified(BoxPercent(20.0))), Height(Specified(BoxAuto)), Width(Specified(BoxLength(Px(20.0)))), diff --git a/src/servo/gfx/render_task.rs b/src/servo/gfx/render_task.rs index 6e438f4cef92..b1214a6c70ab 100644 --- a/src/servo/gfx/render_task.rs +++ b/src/servo/gfx/render_task.rs @@ -146,8 +146,6 @@ pub fn draw_glyphs(ctx: &RenderContext, bounds: Rect, text_run: &GlyphRun) { AzReleaseColorPattern}; use azure::cairo::bindgen::cairo_scaled_font_destroy; - let draw_target = ctx.canvas.azure_draw_target; - // FIXME: font should be accessible from GlyphRun let font = ctx.font_cache.get_test_font(); diff --git a/src/servo/layout/base.rs b/src/servo/layout/base.rs index 98980704dfb8..1bde59b569b1 100644 --- a/src/servo/layout/base.rs +++ b/src/servo/layout/base.rs @@ -367,7 +367,7 @@ impl @RenderBox { * `origin` - Total offset from display list root flow to this box's owning flow * `list` - List to which items should be appended */ - fn build_display_list(builder: &dl::DisplayListBuilder, dirty: &Rect, + fn build_display_list(_builder: &dl::DisplayListBuilder, dirty: &Rect, offset: &Point2D, list: &dl::DisplayList) { if !self.data.position.intersects(dirty) { return; @@ -478,7 +478,7 @@ impl @FlowContext : DebugMethods { }, BlockFlow(d) => { match d.box { - Some(b) => fmt!("BlockFlow(box=b%?)", d.box.get().id), + Some(_b) => fmt!("BlockFlow(box=b%?)", d.box.get().id), None => ~"BlockFlow", } }, diff --git a/src/servo/layout/block.rs b/src/servo/layout/block.rs index d0bb7ed15471..38203596b684 100644 --- a/src/servo/layout/block.rs +++ b/src/servo/layout/block.rs @@ -77,7 +77,7 @@ impl @FlowContext : BlockLayout { /* TODO: floats */ /* TODO: absolute contexts */ /* TODO: inline-blocks */ - fn bubble_widths_block(ctx: &LayoutContext) { + fn bubble_widths_block(_ctx: &LayoutContext) { assert self.starts_block_flow(); let mut min_width = au(0); @@ -109,11 +109,11 @@ impl @FlowContext : BlockLayout { Dual boxes consume some width first, and the remainder is assigned to all child (block) contexts. */ - fn assign_widths_block(ctx: &LayoutContext) { + fn assign_widths_block(_ctx: &LayoutContext) { assert self.starts_block_flow(); let mut remaining_width = self.data.position.size.width; - let mut right_used = au(0); + let mut _right_used = au(0); let mut left_used = au(0); /* Let the box consume some width. It will return the amount remaining @@ -131,7 +131,7 @@ impl @FlowContext : BlockLayout { } } - fn assign_height_block(ctx: &LayoutContext) { + fn assign_height_block(_ctx: &LayoutContext) { assert self.starts_block_flow(); let mut cur_y = au(0); @@ -143,13 +143,13 @@ impl @FlowContext : BlockLayout { self.data.position.size.height = cur_y; - let used_top = au(0); - let used_bot = au(0); + let _used_top = au(0); + let _used_bot = au(0); do self.with_block_box |box| { box.data.position.origin.y = au(0); box.data.position.size.height = cur_y; - let (used_top, used_bot) = box.get_used_height(); + let (_used_top, _used_bot) = box.get_used_height(); } } diff --git a/src/servo/layout/box_builder.rs b/src/servo/layout/box_builder.rs index d0089d423db4..8d6048f883a1 100644 --- a/src/servo/layout/box_builder.rs +++ b/src/servo/layout/box_builder.rs @@ -139,7 +139,7 @@ impl LayoutTreeBuilder { } } - fn fixup_split_inline(foo: @FlowContext) { + fn fixup_split_inline(_foo: @FlowContext) { // TODO: finish me. fail ~"TODO: handle case where an inline is split by a block" } diff --git a/src/servo/layout/inline.rs b/src/servo/layout/inline.rs index f052dcf2ba9c..fe1e2527fdb1 100644 --- a/src/servo/layout/inline.rs +++ b/src/servo/layout/inline.rs @@ -67,7 +67,7 @@ impl @FlowContext : InlineLayout { } } - fn bubble_widths_inline(ctx: &LayoutContext) { + fn bubble_widths_inline(_ctx: &LayoutContext) { assert self.starts_inline_flow(); let mut min_width = au(0); @@ -87,7 +87,7 @@ impl @FlowContext : InlineLayout { /* Recursively (top-down) determines the actual width of child contexts and boxes. When called on this context, the context has had its width set by the parent context. */ - fn assign_widths_inline(ctx: &LayoutContext) { + fn assign_widths_inline(_ctx: &LayoutContext) { assert self.starts_inline_flow(); /* Perform inline flow with the available width. */ @@ -138,7 +138,7 @@ impl @FlowContext : InlineLayout { } // fn assign_widths_inline - fn assign_height_inline(ctx: &LayoutContext) { + fn assign_height_inline(_ctx: &LayoutContext) { // Don't need to set box or ctx heights, since that is done // during inline flowing. } diff --git a/src/servo/text/text_run.rs b/src/servo/text/text_run.rs index c0ca6622aefc..45d56a2ceaae 100644 --- a/src/servo/text/text_run.rs +++ b/src/servo/text/text_run.rs @@ -102,7 +102,7 @@ fn calc_min_break_width(font: &Font, text: &str) -> au { } /// Iterates over all the indivisible substrings -fn iter_indivisible_slices(font: &Font, text: &r/str, +fn iter_indivisible_slices(_font: &Font, text: &r/str, f: fn((&r/str)) -> bool) { let mut curr = text;