From 7a2ab2784dff3f63ac1b3e4966c037190e36f86f Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 28 Mar 2015 22:30:55 +0100 Subject: [PATCH 1/5] Use usize for UnsafeLayoutNode. --- components/layout/wrapper.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index 101249b4747a..3f40945ec7d8 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -1135,11 +1135,11 @@ pub trait PostorderNodeMutTraversal { /// Opaque type stored in type-unsafe work queues for parallel layout. /// Must be transmutable to and from LayoutNode/ThreadSafeLayoutNode. -pub type UnsafeLayoutNode = (uint, uint); +pub type UnsafeLayoutNode = (usize, usize); pub fn layout_node_to_unsafe_layout_node(node: &LayoutNode) -> UnsafeLayoutNode { unsafe { - let ptr: uint = mem::transmute_copy(node); + let ptr: usize = mem::transmute_copy(node); (ptr, 0) } } From 40c710ab199fc93ea7869f588be9a96463125c76 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 28 Mar 2015 22:32:43 +0100 Subject: [PATCH 2/5] Pass u32 to LayoutNode::dump_indent. --- components/layout/wrapper.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index 3f40945ec7d8..9e3a6be89a4c 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -248,7 +248,7 @@ impl<'ln> LayoutNode<'ln> { self.dump_indent(0); } - fn dump_indent(self, indent: uint) { + fn dump_indent(self, indent: u32) { let mut s = String::new(); for _ in range(0, indent) { s.push_str(" "); From da1e3a3f11838285ec46282a46c438c8ee2a1481 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 28 Mar 2015 22:37:41 +0100 Subject: [PATCH 3/5] Use usize for debug ids. --- components/layout/construct.rs | 2 +- components/layout/flow.rs | 4 ++-- components/layout/wrapper.rs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/layout/construct.rs b/components/layout/construct.rs index 675f49a2be84..ec40dad1199c 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -88,7 +88,7 @@ impl ConstructionResult { (*self).clone() } - pub fn debug_id(&self) -> uint { + pub fn debug_id(&self) -> usize { match self { &ConstructionResult::None => 0u, &ConstructionResult::ConstructionItem(_) => 0u, diff --git a/components/layout/flow.rs b/components/layout/flow.rs index 2840f0714111..976ddbc405b9 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -991,9 +991,9 @@ impl BaseFlow { &self.weak_ref_count } - pub fn debug_id(&self) -> uint { + pub fn debug_id(&self) -> usize { let p = self as *const _; - p as uint + p as usize } /// Ensures that all display list items generated by this flow are within the flow's overflow diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index 9e3a6be89a4c..01128cd808b9 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -267,10 +267,10 @@ impl<'ln> LayoutNode<'ln> { self.type_id(), self.has_changed(), self.is_dirty(), self.has_dirty_descendants()) } - pub fn flow_debug_id(self) -> uint { + pub fn flow_debug_id(self) -> usize { let layout_data_ref = self.borrow_layout_data(); match *layout_data_ref { - None => 0u, + None => 0, Some(ref layout_data) => layout_data.data.flow_construction_result.debug_id() } } @@ -806,7 +806,7 @@ impl<'ln> ThreadSafeLayoutNode<'ln> { self.node.debug_id() } - pub fn flow_debug_id(self) -> uint { + pub fn flow_debug_id(self) -> usize { self.node.flow_debug_id() } From d521cd006ef3e7120c81d8a96efd42e55aed5abd Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 28 Mar 2015 22:42:14 +0100 Subject: [PATCH 4/5] Remove the unused FloatedBlockInfo::index field. --- components/layout/block.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/components/layout/block.rs b/components/layout/block.rs index abaa80a06ab1..36cdc1ab9887 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -72,9 +72,6 @@ pub struct FloatedBlockInfo { /// box). pub float_ceiling: Au, - /// Index into the fragment list for inline floats - pub index: Option, - /// Left or right? pub float_kind: FloatKind, } @@ -84,7 +81,6 @@ impl FloatedBlockInfo { FloatedBlockInfo { containing_inline_size: Au(0), float_ceiling: Au(0), - index: None, float_kind: float_kind, } } From 9904216d76ac8a44f8afd4733df792bad82a8aba Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 28 Mar 2015 22:46:16 +0100 Subject: [PATCH 5/5] Use u32 for generation numbers. --- components/layout/context.rs | 2 +- components/layout/layout_task.rs | 2 +- components/layout/traversal.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/layout/context.rs b/components/layout/context.rs index 6c87ef637425..abb510df0d2a 100644 --- a/components/layout/context.rs +++ b/components/layout/context.rs @@ -86,7 +86,7 @@ pub struct SharedLayoutContext { /// Starts at zero, and increased by one every time a layout completes. /// This can be used to easily check for invalid stale data. - pub generation: uint, + pub generation: u32, } pub struct SharedLayoutContextWrapper(pub *const SharedLayoutContext); diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 3a5110339342..ffaf9c5edcbb 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -107,7 +107,7 @@ pub struct LayoutTaskData { /// Starts at zero, and increased by one every time a layout completes. /// This can be used to easily check for invalid stale data. - pub generation: uint, + pub generation: u32, /// A queued response for the union of the content boxes of a node. pub content_box_response: Rect, diff --git a/components/layout/traversal.rs b/components/layout/traversal.rs index a206bf75b4a0..4474cc684a67 100644 --- a/components/layout/traversal.rs +++ b/components/layout/traversal.rs @@ -28,7 +28,7 @@ use std::mem; /// Every time we do another layout, the old bloom filters are invalid. This is /// detected by ticking a generation number every layout. -type Generation = uint; +type Generation = u32; /// A pair of the bloom filter used for css selector matching, and the node to /// which it applies. This is used to efficiently do `Descendant` selector