Fix some unused variable compiler warnings.

This commit is contained in:
Brian J. Burg 2012-09-19 17:49:55 -07:00
parent da7ae8a280
commit f3a8253bc8
7 changed files with 19 additions and 21 deletions

View file

@ -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 // TODO: complete me
Value(LengthSize(Px(14.0))) Value(LengthSize(Px(14.0)))
} }
@ -86,8 +86,8 @@ mod test {
fn should_match_font_sizes() { fn should_match_font_sizes() {
let input = ~"* {font-size:12px; font-size:inherit; font-size:200%; font-size:x-small}"; 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 token_port = spawn_css_lexer_from_string(input);
let actual_rule = build_stylesheet(token_port); let _actual_rule = build_stylesheet(token_port);
let expected_rule : Stylesheet = ~[~(~[~Element(~"*", ~[])], let _expected_rule : Stylesheet = ~[~(~[~Element(~"*", ~[])],
~[FontSize(Specified(LengthSize(Px(12.0)))), ~[FontSize(Specified(LengthSize(Px(12.0)))),
FontSize(Specified(PercentSize(100.0))), FontSize(Specified(PercentSize(100.0))),
FontSize(Specified(PercentSize(200.0))), FontSize(Specified(PercentSize(200.0))),
@ -101,8 +101,8 @@ mod test {
fn should_match_width_height() { fn should_match_width_height() {
let input = ~"* {width:20%; height:auto; width:20px; width:3in; height:70px; height:30px}"; let input = ~"* {width:20%; height:auto; width:20px; width:3in; height:70px; height:30px}";
let token_port = spawn_css_lexer_from_string(input); let token_port = spawn_css_lexer_from_string(input);
let actual_rule = build_stylesheet(token_port); let _actual_rule = build_stylesheet(token_port);
let expected_rule : Stylesheet = ~[~(~[~Element(~"*", ~[])], let _expected_rule : Stylesheet = ~[~(~[~Element(~"*", ~[])],
~[Width(Specified(BoxPercent(20.0))), ~[Width(Specified(BoxPercent(20.0))),
Height(Specified(BoxAuto)), Height(Specified(BoxAuto)),
Width(Specified(BoxLength(Px(20.0)))), Width(Specified(BoxLength(Px(20.0)))),

View file

@ -146,8 +146,6 @@ pub fn draw_glyphs(ctx: &RenderContext, bounds: Rect<au>, text_run: &GlyphRun) {
AzReleaseColorPattern}; AzReleaseColorPattern};
use azure::cairo::bindgen::cairo_scaled_font_destroy; use azure::cairo::bindgen::cairo_scaled_font_destroy;
let draw_target = ctx.canvas.azure_draw_target;
// FIXME: font should be accessible from GlyphRun // FIXME: font should be accessible from GlyphRun
let font = ctx.font_cache.get_test_font(); let font = ctx.font_cache.get_test_font();

View file

@ -367,7 +367,7 @@ impl @RenderBox {
* `origin` - Total offset from display list root flow to this box's owning flow * `origin` - Total offset from display list root flow to this box's owning flow
* `list` - List to which items should be appended * `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) { offset: &Point2D<au>, list: &dl::DisplayList) {
if !self.data.position.intersects(dirty) { if !self.data.position.intersects(dirty) {
return; return;
@ -478,7 +478,7 @@ impl @FlowContext : DebugMethods {
}, },
BlockFlow(d) => { BlockFlow(d) => {
match d.box { 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", None => ~"BlockFlow",
} }
}, },

View file

@ -77,7 +77,7 @@ impl @FlowContext : BlockLayout {
/* TODO: floats */ /* TODO: floats */
/* TODO: absolute contexts */ /* TODO: absolute contexts */
/* TODO: inline-blocks */ /* TODO: inline-blocks */
fn bubble_widths_block(ctx: &LayoutContext) { fn bubble_widths_block(_ctx: &LayoutContext) {
assert self.starts_block_flow(); assert self.starts_block_flow();
let mut min_width = au(0); 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 Dual boxes consume some width first, and the remainder is assigned to
all child (block) contexts. */ all child (block) contexts. */
fn assign_widths_block(ctx: &LayoutContext) { fn assign_widths_block(_ctx: &LayoutContext) {
assert self.starts_block_flow(); assert self.starts_block_flow();
let mut remaining_width = self.data.position.size.width; 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 mut left_used = au(0);
/* Let the box consume some width. It will return the amount remaining /* 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(); assert self.starts_block_flow();
let mut cur_y = au(0); let mut cur_y = au(0);
@ -143,13 +143,13 @@ impl @FlowContext : BlockLayout {
self.data.position.size.height = cur_y; self.data.position.size.height = cur_y;
let used_top = au(0); let _used_top = au(0);
let used_bot = au(0); let _used_bot = au(0);
do self.with_block_box |box| { do self.with_block_box |box| {
box.data.position.origin.y = au(0); box.data.position.origin.y = au(0);
box.data.position.size.height = cur_y; 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();
} }
} }

View file

@ -139,7 +139,7 @@ impl LayoutTreeBuilder {
} }
} }
fn fixup_split_inline(foo: @FlowContext) { fn fixup_split_inline(_foo: @FlowContext) {
// TODO: finish me. // TODO: finish me.
fail ~"TODO: handle case where an inline is split by a block" fail ~"TODO: handle case where an inline is split by a block"
} }

View file

@ -67,7 +67,7 @@ impl @FlowContext : InlineLayout {
} }
} }
fn bubble_widths_inline(ctx: &LayoutContext) { fn bubble_widths_inline(_ctx: &LayoutContext) {
assert self.starts_inline_flow(); assert self.starts_inline_flow();
let mut min_width = au(0); let mut min_width = au(0);
@ -87,7 +87,7 @@ impl @FlowContext : InlineLayout {
/* Recursively (top-down) determines the actual width of child /* Recursively (top-down) determines the actual width of child
contexts and boxes. When called on this context, the context has contexts and boxes. When called on this context, the context has
had its width set by the parent context. */ 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(); assert self.starts_inline_flow();
/* Perform inline flow with the available width. */ /* Perform inline flow with the available width. */
@ -138,7 +138,7 @@ impl @FlowContext : InlineLayout {
} // fn assign_widths_inline } // 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 // Don't need to set box or ctx heights, since that is done
// during inline flowing. // during inline flowing.
} }

View file

@ -102,7 +102,7 @@ fn calc_min_break_width(font: &Font, text: &str) -> au {
} }
/// Iterates over all the indivisible substrings /// 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) { f: fn((&r/str)) -> bool) {
let mut curr = text; let mut curr = text;