Skip to content

Commit

Permalink
Fix some unused variable compiler warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian J. Burg committed Sep 20, 2012
1 parent da7ae8a commit f3a8253
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 21 deletions.
10 changes: 5 additions & 5 deletions src/servo/css/parser_util.rs
Expand Up @@ -51,7 +51,7 @@ fn parse_relative_size(str: ~str) -> ParseResult<RelativeSize> {
}
}

fn parse_font_size(str: ~str) -> ParseResult<CSSFontSize> {
fn parse_font_size(_str: ~str) -> ParseResult<CSSFontSize> {
// TODO: complete me
Value(LengthSize(Px(14.0)))
}
Expand Down Expand Up @@ -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))),
Expand All @@ -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)))),
Expand Down
2 changes: 0 additions & 2 deletions src/servo/gfx/render_task.rs
Expand Up @@ -146,8 +146,6 @@ pub fn draw_glyphs(ctx: &RenderContext, bounds: Rect<au>, 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();

Expand Down
4 changes: 2 additions & 2 deletions src/servo/layout/base.rs
Expand Up @@ -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<au>,
fn build_display_list(_builder: &dl::DisplayListBuilder, dirty: &Rect<au>,
offset: &Point2D<au>, list: &dl::DisplayList) {
if !self.data.position.intersects(dirty) {
return;
Expand Down Expand Up @@ -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",
}
},
Expand Down
14 changes: 7 additions & 7 deletions src/servo/layout/block.rs
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand All @@ -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);
Expand All @@ -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();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/servo/layout/box_builder.rs
Expand Up @@ -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"
}
Expand Down
6 changes: 3 additions & 3 deletions src/servo/layout/inline.rs
Expand Up @@ -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);
Expand All @@ -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. */
Expand Down Expand Up @@ -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.
}
Expand Down
2 changes: 1 addition & 1 deletion src/servo/text/text_run.rs
Expand Up @@ -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;
Expand Down

0 comments on commit f3a8253

Please sign in to comment.