Skip to content

Commit

Permalink
Merge pull request #2762 from Ms2ger/warnings
Browse files Browse the repository at this point in the history
Fix some build warnings. r=me
  • Loading branch information
SimonSapin committed Jul 4, 2014
2 parents 19560c0 + 2aad653 commit 52e55a2
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 55 deletions.
6 changes: 3 additions & 3 deletions src/components/compositing/compositing.rs
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/components/compositing/compositor_task.rs
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/components/compositing/constellation.rs
Expand Up @@ -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>,
Expand Down
22 changes: 9 additions & 13 deletions src/components/compositing/platform/common/glfw_windowing.rs
Expand Up @@ -85,22 +85,20 @@ macro_rules! glfw_callback(

/// The type of a window.
pub struct Window {
pub glfw: glfw::Glfw,

pub glfw_window: glfw::Window,
pub events: Receiver<(f64, glfw::WindowEvent)>,
glfw: glfw::Glfw,

pub event_queue: RefCell<Vec<WindowEvent>>,
glfw_window: glfw::Window,
events: Receiver<(f64, glfw::WindowEvent)>,

pub drag_origin: Point2D<c_int>,
event_queue: RefCell<Vec<WindowEvent>>,

pub mouse_down_button: Cell<Option<glfw::MouseButton>>,
pub mouse_down_point: Cell<Point2D<c_int>>,
mouse_down_button: Cell<Option<glfw::MouseButton>>,
mouse_down_point: Cell<Point2D<c_int>>,

pub ready_state: Cell<ReadyState>,
pub render_state: Cell<RenderState>,
ready_state: Cell<ReadyState>,
render_state: Cell<RenderState>,

pub last_title_set_time: Cell<Timespec>,
last_title_set_time: Cell<Timespec>,
}

impl WindowMethods<Application> for Window {
Expand All @@ -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)),

Expand Down
2 changes: 1 addition & 1 deletion src/components/embedding/embedding.rs
Expand Up @@ -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;
Expand Down
7 changes: 4 additions & 3 deletions src/components/embedding/types.rs
Expand Up @@ -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,
scheme_name: *cef_string_t,
is_standard: c_int, is_local: c_int, is_display_isolated: c_int),
_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),
}

///
Expand Down
2 changes: 1 addition & 1 deletion src/components/gfx/platform/linux/font.rs
Expand Up @@ -37,7 +37,7 @@ fn fixed_to_float_ft(f: i32) -> f64 {
}

pub struct FontTable {
bogus: ()
_bogus: ()
}

impl FontTableMethods for FontTable {
Expand Down
2 changes: 0 additions & 2 deletions src/components/gfx/text/shaping/harfbuzz.rs
Expand Up @@ -53,7 +53,6 @@ pub struct ShapedGlyphData {
}

pub struct ShapedGlyphEntry {
cluster: int,
codepoint: GlyphId,
advance: Au,
offset: Option<Point2D<Au>>,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/block.rs
Expand Up @@ -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
Expand All @@ -87,7 +87,7 @@ impl HeightConstraintSolution {
-> HeightConstraintSolution {
HeightConstraintSolution {
top: top,
bottom: bottom,
_bottom: bottom,
height: height,
margin_top: margin_top,
margin_bottom: margin_bottom,
Expand Down
15 changes: 2 additions & 13 deletions src/components/layout/flow_list.rs
Expand Up @@ -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,
}

Expand All @@ -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
Expand Down Expand Up @@ -204,7 +195,6 @@ impl FlowList {
FlowListIterator {
nelem: self.len(),
head: &self.list_head,
tail: Rawlink::from_optional_flow_ref(&self.list_tail)
}
}

Expand All @@ -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
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/script/dom/bindings/callback.rs
Expand Up @@ -109,7 +109,7 @@ pub fn WrapCallThisObject<T: Reflectable>(cx: *mut JSContext,

pub struct CallSetup {
cx: *mut JSContext,
handling: ExceptionHandling
_handling: ExceptionHandling
}

impl CallSetup {
Expand All @@ -118,7 +118,7 @@ impl CallSetup {
let cx = win.deref().get_cx();
CallSetup {
cx: cx,
handling: handling
_handling: handling
}
}

Expand Down
18 changes: 9 additions & 9 deletions src/components/style/selectors.rs
Expand Up @@ -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,
}
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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."),
}
}
Expand Down
5 changes: 1 addition & 4 deletions src/components/style/stylesheets.rs
Expand Up @@ -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,
}


Expand Down Expand Up @@ -120,7 +117,7 @@ impl Stylesheet {
}
state = next_state;
}
Stylesheet{ rules: rules, namespaces: namespaces, encoding: encoding, base_url: base_url }
Stylesheet{ rules: rules }
}
}

Expand Down

0 comments on commit 52e55a2

Please sign in to comment.