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 constellation::Constellation;
mod compositor_task;
pub mod compositor_task;
mod compositor_data;
mod compositor;
mod headless;
mod pipeline;
mod constellation;
pub mod pipeline;
pub mod constellation;
mod windowing;

View file

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

View file

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

View file

@ -85,22 +85,20 @@ macro_rules! glfw_callback(
/// The type of a window.
pub struct Window {
pub glfw: glfw::Glfw,
glfw: glfw::Glfw,
pub glfw_window: glfw::Window,
pub events: Receiver<(f64, glfw::WindowEvent)>,
glfw_window: glfw::Window,
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>>,
pub mouse_down_point: Cell<Point2D<c_int>>,
ready_state: Cell<ReadyState>,
render_state: Cell<RenderState>,
pub ready_state: Cell<ReadyState>,
pub render_state: Cell<RenderState>,
pub last_title_set_time: Cell<Timespec>,
last_title_set_time: Cell<Timespec>,
}
impl WindowMethods<Application> for Window {
@ -121,8 +119,6 @@ impl WindowMethods<Application> for Window {
event_queue: RefCell::new(vec!()),
drag_origin: Point2D(0 as c_int, 0),
mouse_down_button: Cell::new(None),
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(phase)]
#[phase(syntax, link)]
#[phase(plugin, link)]
extern crate log;
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
// 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,
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 {
bogus: ()
_bogus: ()
}
impl FontTableMethods for FontTable {

View file

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

View file

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

View file

@ -33,15 +33,13 @@ pub struct FlowList {
/// Double-ended FlowList iterator
pub struct FlowListIterator<'a> {
head: &'a Link,
tail: Rawlink,
nelem: uint,
}
/// Double-ended mutable FlowList iterator
pub struct MutFlowListIterator<'a> {
list: &'a mut FlowList,
_list: &'a mut FlowList,
head: Rawlink,
tail: Rawlink,
nelem: uint,
}
@ -59,13 +57,6 @@ impl Rawlink {
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> {
if self.obj.is_null() {
None
@ -204,7 +195,6 @@ impl FlowList {
FlowListIterator {
nelem: self.len(),
head: &self.list_head,
tail: Rawlink::from_optional_flow_ref(&self.list_tail)
}
}
@ -218,8 +208,7 @@ impl FlowList {
MutFlowListIterator {
nelem: self.len(),
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 {
cx: *mut JSContext,
handling: ExceptionHandling
_handling: ExceptionHandling
}
impl CallSetup {
@ -118,7 +118,7 @@ impl CallSetup {
let cx = win.deref().get_cx();
CallSetup {
cx: cx,
handling: handling
_handling: handling
}
}

View file

@ -306,13 +306,13 @@ fn parse_one_simple_selector(iter: &mut Iter, namespaces: &NamespaceMap, inside_
-> SimpleSelectorParseResult {
match iter.peek() {
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."),
},
Some(&Delim('.')) => {
iter.next();
match iter.next() {
Some(Ident(class)) => SimpleSelectorResult(ClassSelector(class.into_owned())),
Some(Ident(class)) => SimpleSelectorResult(ClassSelector(class)),
_ => InvalidSimpleSelector,
}
}
@ -455,16 +455,16 @@ fn parse_attribute_selector(content: Vec<ComponentValue>, namespaces: &Namespace
}};)
let result = match iter.next() {
None => AttrExists(attr), // [foo]
Some(Delim('=')) => AttrEqual(attr, (get_value!()).into_owned()), // [foo=bar]
Some(IncludeMatch) => AttrIncludes(attr, (get_value!()).into_owned()), // [foo~=bar]
Some(Delim('=')) => AttrEqual(attr, (get_value!())), // [foo=bar]
Some(IncludeMatch) => AttrIncludes(attr, (get_value!())), // [foo~=bar]
Some(DashMatch) => {
let value = get_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(SubstringMatch) => AttrSubstringMatch(attr, (get_value!()).into_owned()), // [foo*=bar]
Some(SuffixMatch) => AttrSuffixMatch(attr, (get_value!()).into_owned()), // [foo$=bar]
Some(PrefixMatch) => AttrPrefixMatch(attr, (get_value!())), // [foo^=bar]
Some(SubstringMatch) => AttrSubstringMatch(attr, (get_value!())), // [foo*=bar]
Some(SuffixMatch) => AttrSuffixMatch(attr, (get_value!())), // [foo$=bar]
_ => return None
};
skip_whitespace(iter);
@ -551,7 +551,7 @@ fn parse_negation(arguments: Vec<ComponentValue>, namespaces: &NamespaceMap)
#[inline]
fn get_next_ident(iter: &mut Iter) -> String {
match iter.next() {
Some(Ident(value)) => value.into_owned(),
Some(Ident(value)) => value,
_ => 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
/// cascading order)
pub rules: Vec<CSSRule>,
namespaces: NamespaceMap,
encoding: EncodingRef,
base_url: Url,
}
@ -120,7 +117,7 @@ impl Stylesheet {
}
state = next_state;
}
Stylesheet{ rules: rules, namespaces: namespaces, encoding: encoding, base_url: base_url }
Stylesheet{ rules: rules }
}
}