Merge pull request #2762 from Ms2ger/warnings

Fix some build warnings. r=me
This commit is contained in:
Simon Sapin 2014-07-04 14:15:38 +01:00
commit 52e55a2770
13 changed files with 36 additions and 55 deletions

View file

@ -47,15 +47,15 @@ extern crate core_text;
pub use compositor_task::{CompositorChan, CompositorTask}; pub use compositor_task::{CompositorChan, CompositorTask};
pub use constellation::Constellation; pub use constellation::Constellation;
mod compositor_task; pub mod compositor_task;
mod compositor_data; mod compositor_data;
mod compositor; mod compositor;
mod headless; mod headless;
mod pipeline; pub mod pipeline;
mod constellation; pub mod constellation;
mod windowing; mod windowing;

View file

@ -6,7 +6,7 @@ pub use windowing;
use compositor; use compositor;
use headless; use headless;
use constellation::SendableFrameTree; pub use constellation::SendableFrameTree;
use windowing::{ApplicationMethods, WindowMethods}; use windowing::{ApplicationMethods, WindowMethods};
use platform::Application; use platform::Application;

View file

@ -42,7 +42,7 @@ pub struct Constellation {
pub compositor_chan: CompositorChan, pub compositor_chan: CompositorChan,
pub resource_task: ResourceTask, pub resource_task: ResourceTask,
pub image_cache_task: ImageCacheTask, pub image_cache_task: ImageCacheTask,
pub pipelines: HashMap<PipelineId, Rc<Pipeline>>, pipelines: HashMap<PipelineId, Rc<Pipeline>>,
navigation_context: NavigationContext, navigation_context: NavigationContext,
next_pipeline_id: PipelineId, next_pipeline_id: PipelineId,
pending_frames: Vec<FrameChange>, pending_frames: Vec<FrameChange>,

View file

@ -85,22 +85,20 @@ macro_rules! glfw_callback(
/// The type of a window. /// The type of a window.
pub struct Window { pub struct Window {
pub glfw: glfw::Glfw, glfw: glfw::Glfw,
pub glfw_window: glfw::Window, glfw_window: glfw::Window,
pub events: Receiver<(f64, glfw::WindowEvent)>, events: Receiver<(f64, glfw::WindowEvent)>,
pub event_queue: RefCell<Vec<WindowEvent>>, event_queue: RefCell<Vec<WindowEvent>>,
pub drag_origin: Point2D<c_int>, mouse_down_button: Cell<Option<glfw::MouseButton>>,
mouse_down_point: Cell<Point2D<c_int>>,
pub mouse_down_button: Cell<Option<glfw::MouseButton>>, ready_state: Cell<ReadyState>,
pub mouse_down_point: Cell<Point2D<c_int>>, render_state: Cell<RenderState>,
pub ready_state: Cell<ReadyState>, last_title_set_time: Cell<Timespec>,
pub render_state: Cell<RenderState>,
pub last_title_set_time: Cell<Timespec>,
} }
impl WindowMethods<Application> for Window { impl WindowMethods<Application> for Window {
@ -121,8 +119,6 @@ impl WindowMethods<Application> for Window {
event_queue: RefCell::new(vec!()), event_queue: RefCell::new(vec!()),
drag_origin: Point2D(0 as c_int, 0),
mouse_down_button: Cell::new(None), mouse_down_button: Cell::new(None),
mouse_down_point: Cell::new(Point2D(0 as c_int, 0)), mouse_down_point: Cell::new(Point2D(0 as c_int, 0)),

View file

@ -8,7 +8,7 @@
#![feature(globs, macro_rules, phase, thread_local)] #![feature(globs, macro_rules, phase, thread_local)]
#![feature(phase)] #![feature(phase)]
#[phase(syntax, link)] #[phase(plugin, link)]
extern crate log; extern crate log;
extern crate rustuv; extern crate rustuv;

View file

@ -950,9 +950,10 @@ pub struct cef_scheme_registrar {
// per unique |scheme_name| value. If |scheme_name| is already registered or // per unique |scheme_name| value. If |scheme_name| is already registered or
// if an error occurs this function will return false (0). // if an error occurs this function will return false (0).
/// ///
add_custom_scheme: extern "C" fn(registrar: *mut cef_scheme_registrar, _add_custom_scheme: extern "C" fn(registrar: *mut cef_scheme_registrar,
scheme_name: *cef_string_t, scheme_name: *cef_string_t,
is_standard: c_int, is_local: c_int, is_display_isolated: c_int), is_standard: c_int, is_local: c_int,
is_display_isolated: c_int),
} }
/// ///

View file

@ -37,7 +37,7 @@ fn fixed_to_float_ft(f: i32) -> f64 {
} }
pub struct FontTable { pub struct FontTable {
bogus: () _bogus: ()
} }
impl FontTableMethods for FontTable { impl FontTableMethods for FontTable {

View file

@ -53,7 +53,6 @@ pub struct ShapedGlyphData {
} }
pub struct ShapedGlyphEntry { pub struct ShapedGlyphEntry {
cluster: int,
codepoint: GlyphId, codepoint: GlyphId,
advance: Au, advance: Au,
offset: Option<Point2D<Au>>, offset: Option<Point2D<Au>>,
@ -123,7 +122,6 @@ impl ShapedGlyphData {
}; };
ShapedGlyphEntry { ShapedGlyphEntry {
cluster: (*glyph_info_i).cluster as int,
codepoint: (*glyph_info_i).codepoint as GlyphId, codepoint: (*glyph_info_i).codepoint as GlyphId,
advance: x_advance, advance: x_advance,
offset: offset, offset: offset,

View file

@ -76,7 +76,7 @@ impl FloatedBlockInfo {
/// The solutions for the heights-and-margins constraint equation. /// The solutions for the heights-and-margins constraint equation.
struct HeightConstraintSolution { struct HeightConstraintSolution {
top: Au, top: Au,
bottom: Au, _bottom: Au,
height: Au, height: Au,
margin_top: Au, margin_top: Au,
margin_bottom: Au margin_bottom: Au
@ -87,7 +87,7 @@ impl HeightConstraintSolution {
-> HeightConstraintSolution { -> HeightConstraintSolution {
HeightConstraintSolution { HeightConstraintSolution {
top: top, top: top,
bottom: bottom, _bottom: bottom,
height: height, height: height,
margin_top: margin_top, margin_top: margin_top,
margin_bottom: margin_bottom, margin_bottom: margin_bottom,

View file

@ -33,15 +33,13 @@ pub struct FlowList {
/// Double-ended FlowList iterator /// Double-ended FlowList iterator
pub struct FlowListIterator<'a> { pub struct FlowListIterator<'a> {
head: &'a Link, head: &'a Link,
tail: Rawlink,
nelem: uint, nelem: uint,
} }
/// Double-ended mutable FlowList iterator /// Double-ended mutable FlowList iterator
pub struct MutFlowListIterator<'a> { pub struct MutFlowListIterator<'a> {
list: &'a mut FlowList, _list: &'a mut FlowList,
head: Rawlink, head: Rawlink,
tail: Rawlink,
nelem: uint, nelem: uint,
} }
@ -59,13 +57,6 @@ impl Rawlink {
unsafe { mem::transmute(n) } unsafe { mem::transmute(n) }
} }
fn from_optional_flow_ref(flow_ref: &Option<FlowRef>) -> Rawlink {
match *flow_ref {
None => Rawlink::none(),
Some(ref flow_ref) => Rawlink::some(flow_ref.get()),
}
}
pub unsafe fn resolve_mut(&self) -> Option<&mut Flow> { pub unsafe fn resolve_mut(&self) -> Option<&mut Flow> {
if self.obj.is_null() { if self.obj.is_null() {
None None
@ -204,7 +195,6 @@ impl FlowList {
FlowListIterator { FlowListIterator {
nelem: self.len(), nelem: self.len(),
head: &self.list_head, head: &self.list_head,
tail: Rawlink::from_optional_flow_ref(&self.list_tail)
} }
} }
@ -218,8 +208,7 @@ impl FlowList {
MutFlowListIterator { MutFlowListIterator {
nelem: self.len(), nelem: self.len(),
head: head_raw, head: head_raw,
tail: Rawlink::from_optional_flow_ref(&self.list_tail), _list: self
list: self
} }
} }
} }

View file

@ -109,7 +109,7 @@ pub fn WrapCallThisObject<T: Reflectable>(cx: *mut JSContext,
pub struct CallSetup { pub struct CallSetup {
cx: *mut JSContext, cx: *mut JSContext,
handling: ExceptionHandling _handling: ExceptionHandling
} }
impl CallSetup { impl CallSetup {
@ -118,7 +118,7 @@ impl CallSetup {
let cx = win.deref().get_cx(); let cx = win.deref().get_cx();
CallSetup { CallSetup {
cx: cx, cx: cx,
handling: handling _handling: handling
} }
} }

View file

@ -306,13 +306,13 @@ fn parse_one_simple_selector(iter: &mut Iter, namespaces: &NamespaceMap, inside_
-> SimpleSelectorParseResult { -> SimpleSelectorParseResult {
match iter.peek() { match iter.peek() {
Some(&IDHash(_)) => match iter.next() { Some(&IDHash(_)) => match iter.next() {
Some(IDHash(id)) => SimpleSelectorResult(IDSelector(id.into_owned())), Some(IDHash(id)) => SimpleSelectorResult(IDSelector(id)),
_ => fail!("Implementation error, this should not happen."), _ => fail!("Implementation error, this should not happen."),
}, },
Some(&Delim('.')) => { Some(&Delim('.')) => {
iter.next(); iter.next();
match iter.next() { match iter.next() {
Some(Ident(class)) => SimpleSelectorResult(ClassSelector(class.into_owned())), Some(Ident(class)) => SimpleSelectorResult(ClassSelector(class)),
_ => InvalidSimpleSelector, _ => InvalidSimpleSelector,
} }
} }
@ -455,16 +455,16 @@ fn parse_attribute_selector(content: Vec<ComponentValue>, namespaces: &Namespace
}};) }};)
let result = match iter.next() { let result = match iter.next() {
None => AttrExists(attr), // [foo] None => AttrExists(attr), // [foo]
Some(Delim('=')) => AttrEqual(attr, (get_value!()).into_owned()), // [foo=bar] Some(Delim('=')) => AttrEqual(attr, (get_value!())), // [foo=bar]
Some(IncludeMatch) => AttrIncludes(attr, (get_value!()).into_owned()), // [foo~=bar] Some(IncludeMatch) => AttrIncludes(attr, (get_value!())), // [foo~=bar]
Some(DashMatch) => { Some(DashMatch) => {
let value = get_value!(); let value = get_value!();
let dashing_value = format!("{}-", value); let dashing_value = format!("{}-", value);
AttrDashMatch(attr, value.into_owned(), dashing_value) // [foo|=bar] AttrDashMatch(attr, value, dashing_value) // [foo|=bar]
}, },
Some(PrefixMatch) => AttrPrefixMatch(attr, (get_value!()).into_owned()), // [foo^=bar] Some(PrefixMatch) => AttrPrefixMatch(attr, (get_value!())), // [foo^=bar]
Some(SubstringMatch) => AttrSubstringMatch(attr, (get_value!()).into_owned()), // [foo*=bar] Some(SubstringMatch) => AttrSubstringMatch(attr, (get_value!())), // [foo*=bar]
Some(SuffixMatch) => AttrSuffixMatch(attr, (get_value!()).into_owned()), // [foo$=bar] Some(SuffixMatch) => AttrSuffixMatch(attr, (get_value!())), // [foo$=bar]
_ => return None _ => return None
}; };
skip_whitespace(iter); skip_whitespace(iter);
@ -551,7 +551,7 @@ fn parse_negation(arguments: Vec<ComponentValue>, namespaces: &NamespaceMap)
#[inline] #[inline]
fn get_next_ident(iter: &mut Iter) -> String { fn get_next_ident(iter: &mut Iter) -> String {
match iter.next() { match iter.next() {
Some(Ident(value)) => value.into_owned(), Some(Ident(value)) => value,
_ => fail!("Implementation error, this should not happen."), _ => fail!("Implementation error, this should not happen."),
} }
} }

View file

@ -22,9 +22,6 @@ pub struct Stylesheet {
/// List of rules in the order they were found (important for /// List of rules in the order they were found (important for
/// cascading order) /// cascading order)
pub rules: Vec<CSSRule>, pub rules: Vec<CSSRule>,
namespaces: NamespaceMap,
encoding: EncodingRef,
base_url: Url,
} }
@ -120,7 +117,7 @@ impl Stylesheet {
} }
state = next_state; state = next_state;
} }
Stylesheet{ rules: rules, namespaces: namespaces, encoding: encoding, base_url: base_url } Stylesheet{ rules: rules }
} }
} }