From e1098232eb958d3d3e22f094a41437002731b473 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 4 Jul 2014 11:54:19 +0200 Subject: [PATCH 1/5] Fix some exported private type warnings. --- src/components/compositing/compositing.rs | 6 +++--- src/components/compositing/compositor_task.rs | 2 +- src/components/compositing/constellation.rs | 2 +- .../platform/common/glfw_windowing.rs | 20 +++++++++---------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/components/compositing/compositing.rs b/src/components/compositing/compositing.rs index 737acce3b84..b944567549d 100644 --- a/src/components/compositing/compositing.rs +++ b/src/components/compositing/compositing.rs @@ -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; diff --git a/src/components/compositing/compositor_task.rs b/src/components/compositing/compositor_task.rs index faf34915a84..1b8e9653744 100644 --- a/src/components/compositing/compositor_task.rs +++ b/src/components/compositing/compositor_task.rs @@ -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; diff --git a/src/components/compositing/constellation.rs b/src/components/compositing/constellation.rs index f5215be1555..f6d12ebcedd 100644 --- a/src/components/compositing/constellation.rs +++ b/src/components/compositing/constellation.rs @@ -42,7 +42,7 @@ pub struct Constellation { pub compositor_chan: CompositorChan, pub resource_task: ResourceTask, pub image_cache_task: ImageCacheTask, - pub pipelines: HashMap>, + pipelines: HashMap>, navigation_context: NavigationContext, next_pipeline_id: PipelineId, pending_frames: Vec, diff --git a/src/components/compositing/platform/common/glfw_windowing.rs b/src/components/compositing/platform/common/glfw_windowing.rs index ca42af1f13f..ae4eaf57bb6 100644 --- a/src/components/compositing/platform/common/glfw_windowing.rs +++ b/src/components/compositing/platform/common/glfw_windowing.rs @@ -85,22 +85,22 @@ 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>, + event_queue: RefCell>, - pub drag_origin: Point2D, + drag_origin: Point2D, - pub mouse_down_button: Cell>, - pub mouse_down_point: Cell>, + mouse_down_button: Cell>, + mouse_down_point: Cell>, - pub ready_state: Cell, - pub render_state: Cell, + ready_state: Cell, + render_state: Cell, - pub last_title_set_time: Cell, + last_title_set_time: Cell, } impl WindowMethods for Window { From 1fe1d03b02dc1d36ad7159a4cfe24f671a2c2e48 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 4 Jul 2014 11:54:46 +0200 Subject: [PATCH 2/5] Fix a deprecated phase warning. --- src/components/embedding/embedding.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/embedding/embedding.rs b/src/components/embedding/embedding.rs index 601d70d4c57..6d5eb46316f 100644 --- a/src/components/embedding/embedding.rs +++ b/src/components/embedding/embedding.rs @@ -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; From cfa9aaac081a5c33b5b31b82ef578c1c26e253b0 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 4 Jul 2014 11:56:18 +0200 Subject: [PATCH 3/5] Remove some unused fields. --- .../compositing/platform/common/glfw_windowing.rs | 4 ---- src/components/gfx/text/shaping/harfbuzz.rs | 2 -- src/components/layout/flow_list.rs | 11 ----------- src/components/style/stylesheets.rs | 5 +---- 4 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/components/compositing/platform/common/glfw_windowing.rs b/src/components/compositing/platform/common/glfw_windowing.rs index ae4eaf57bb6..8fea3535fc9 100644 --- a/src/components/compositing/platform/common/glfw_windowing.rs +++ b/src/components/compositing/platform/common/glfw_windowing.rs @@ -92,8 +92,6 @@ pub struct Window { event_queue: RefCell>, - drag_origin: Point2D, - mouse_down_button: Cell>, mouse_down_point: Cell>, @@ -121,8 +119,6 @@ impl WindowMethods 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)), diff --git a/src/components/gfx/text/shaping/harfbuzz.rs b/src/components/gfx/text/shaping/harfbuzz.rs index 251ddb8ab36..b6646db771a 100644 --- a/src/components/gfx/text/shaping/harfbuzz.rs +++ b/src/components/gfx/text/shaping/harfbuzz.rs @@ -53,7 +53,6 @@ pub struct ShapedGlyphData { } pub struct ShapedGlyphEntry { - cluster: int, codepoint: GlyphId, advance: Au, offset: Option>, @@ -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, diff --git a/src/components/layout/flow_list.rs b/src/components/layout/flow_list.rs index e136c29282f..1bb30572da9 100644 --- a/src/components/layout/flow_list.rs +++ b/src/components/layout/flow_list.rs @@ -33,7 +33,6 @@ pub struct FlowList { /// Double-ended FlowList iterator pub struct FlowListIterator<'a> { head: &'a Link, - tail: Rawlink, nelem: uint, } @@ -41,7 +40,6 @@ pub struct FlowListIterator<'a> { pub struct MutFlowListIterator<'a> { 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) -> 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,7 +208,6 @@ impl FlowList { MutFlowListIterator { nelem: self.len(), head: head_raw, - tail: Rawlink::from_optional_flow_ref(&self.list_tail), list: self } } diff --git a/src/components/style/stylesheets.rs b/src/components/style/stylesheets.rs index cfe1c52a1c4..801fa70d095 100644 --- a/src/components/style/stylesheets.rs +++ b/src/components/style/stylesheets.rs @@ -22,9 +22,6 @@ pub struct Stylesheet { /// List of rules in the order they were found (important for /// cascading order) pub rules: Vec, - 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 } } } From 11aa36619d119a7a462b50b91083d43169905fba Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 4 Jul 2014 11:56:55 +0200 Subject: [PATCH 4/5] Mark some unused fields. --- src/components/embedding/types.rs | 7 ++++--- src/components/gfx/platform/linux/font.rs | 2 +- src/components/layout/block.rs | 4 ++-- src/components/layout/flow_list.rs | 4 ++-- src/components/script/dom/bindings/callback.rs | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/components/embedding/types.rs b/src/components/embedding/types.rs index a4f538a6bba..c01e1ec0cf1 100644 --- a/src/components/embedding/types.rs +++ b/src/components/embedding/types.rs @@ -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), } /// diff --git a/src/components/gfx/platform/linux/font.rs b/src/components/gfx/platform/linux/font.rs index e61d092ae07..1299315ade2 100644 --- a/src/components/gfx/platform/linux/font.rs +++ b/src/components/gfx/platform/linux/font.rs @@ -37,7 +37,7 @@ fn fixed_to_float_ft(f: i32) -> f64 { } pub struct FontTable { - bogus: () + _bogus: () } impl FontTableMethods for FontTable { diff --git a/src/components/layout/block.rs b/src/components/layout/block.rs index 5e0b4a23670..36b525924a7 100644 --- a/src/components/layout/block.rs +++ b/src/components/layout/block.rs @@ -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, diff --git a/src/components/layout/flow_list.rs b/src/components/layout/flow_list.rs index 1bb30572da9..19ccb68727e 100644 --- a/src/components/layout/flow_list.rs +++ b/src/components/layout/flow_list.rs @@ -38,7 +38,7 @@ pub struct FlowListIterator<'a> { /// Double-ended mutable FlowList iterator pub struct MutFlowListIterator<'a> { - list: &'a mut FlowList, + _list: &'a mut FlowList, head: Rawlink, nelem: uint, } @@ -208,7 +208,7 @@ impl FlowList { MutFlowListIterator { nelem: self.len(), head: head_raw, - list: self + _list: self } } } diff --git a/src/components/script/dom/bindings/callback.rs b/src/components/script/dom/bindings/callback.rs index 7a261bf7cc7..8b0c1879dd3 100644 --- a/src/components/script/dom/bindings/callback.rs +++ b/src/components/script/dom/bindings/callback.rs @@ -109,7 +109,7 @@ pub fn WrapCallThisObject(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 } } From 2aad6539e44ab04eb551ae9f8351b9013289f200 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 4 Jul 2014 11:57:08 +0200 Subject: [PATCH 5/5] Remove some deprecated into_owned calls. --- src/components/style/selectors.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/style/selectors.rs b/src/components/style/selectors.rs index d19d7d9d480..951f85b8e20 100644 --- a/src/components/style/selectors.rs +++ b/src/components/style/selectors.rs @@ -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, 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, 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."), } }