From e39c68e3078ebc481cce817ef03177995f2f630c Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sun, 29 Mar 2015 12:43:44 +0200 Subject: [PATCH 1/6] Use usize in flow_list. --- components/layout/flow_list.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/layout/flow_list.rs b/components/layout/flow_list.rs index 20c69b6081c..ea11b545dac 100644 --- a/components/layout/flow_list.rs +++ b/components/layout/flow_list.rs @@ -102,7 +102,7 @@ impl FlowList { /// O(1) #[inline] - pub fn len(&self) -> uint { + pub fn len(&self) -> usize { self.flows.len() } } @@ -115,7 +115,7 @@ impl<'a> Iterator for FlowListIterator<'a> { } #[inline] - fn size_hint(&self) -> (uint, Option) { + fn size_hint(&self) -> (usize, Option) { self.it.size_hint() } } @@ -128,7 +128,7 @@ impl<'a> Iterator for MutFlowListIterator<'a> { } #[inline] - fn size_hint(&self) -> (uint, Option) { + fn size_hint(&self) -> (usize, Option) { self.it.size_hint() } } From 339ab881a271894b5a320096a641cf6f7a535632 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sun, 29 Mar 2015 12:45:07 +0200 Subject: [PATCH 2/6] Use usize in ApplicableDeclarationsCacheQuery's hash method. --- components/layout/css/matching.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/layout/css/matching.rs b/components/layout/css/matching.rs index 8d25f7007f5..b28067d9dae 100644 --- a/components/layout/css/matching.rs +++ b/components/layout/css/matching.rs @@ -122,7 +122,7 @@ impl<'a> PartialEq for ApplicableDeclarationsC impl<'a> Hash for ApplicableDeclarationsCacheQuery<'a> { fn hash(&self, state: &mut H) { for declaration in self.declarations.iter() { - let ptr: uint = unsafe { + let ptr: usize = unsafe { mem::transmute_copy(declaration) }; ptr.hash(state); From 803eba0e59e1851324c6f25af90114b44f4c9ebe Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sun, 29 Mar 2015 12:45:19 +0200 Subject: [PATCH 3/6] Use usize for cache sizes. --- components/layout/css/matching.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/layout/css/matching.rs b/components/layout/css/matching.rs index b28067d9dae..86575886f04 100644 --- a/components/layout/css/matching.rs +++ b/components/layout/css/matching.rs @@ -130,7 +130,7 @@ impl<'a> Hash for ApplicableDeclarationsCacheQuery<'a> { } } -static APPLICABLE_DECLARATIONS_CACHE_SIZE: uint = 32; +static APPLICABLE_DECLARATIONS_CACHE_SIZE: usize = 32; pub struct ApplicableDeclarationsCache { cache: SimpleHashCache>, @@ -331,7 +331,7 @@ impl StyleSharingCandidate { } } -static STYLE_SHARING_CANDIDATE_CACHE_SIZE: uint = 40; +static STYLE_SHARING_CANDIDATE_CACHE_SIZE: usize = 40; impl StyleSharingCandidateCache { pub fn new() -> StyleSharingCandidateCache { From d2252a7214b7e50dcf9930f4cd3dd67dbbe98706 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sun, 29 Mar 2015 12:46:28 +0200 Subject: [PATCH 4/6] Use usize for cache indices. --- components/layout/css/matching.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/layout/css/matching.rs b/components/layout/css/matching.rs index 86575886f04..400f8693231 100644 --- a/components/layout/css/matching.rs +++ b/components/layout/css/matching.rs @@ -351,7 +351,7 @@ impl StyleSharingCandidateCache { } } - pub fn touch(&mut self, index: uint) { + pub fn touch(&mut self, index: usize) { self.cache.touch(index) } } @@ -363,7 +363,7 @@ pub enum StyleSharingResult { CannotShare(bool), /// The node's style can be shared. The integer specifies the index in the LRU cache that was /// hit and the damage that was done. - StyleWasShared(uint, RestyleDamage), + StyleWasShared(usize, RestyleDamage), } pub trait MatchMethods { From 95004ee4b69f707f1488446d74d24799b45f2a5b Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sun, 29 Mar 2015 12:47:25 +0200 Subject: [PATCH 5/6] Use usize for Floats::len. --- components/layout/floats.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/layout/floats.rs b/components/layout/floats.rs index 9c83322c1c7..736b311bd57 100644 --- a/components/layout/floats.rs +++ b/components/layout/floats.rs @@ -153,7 +153,7 @@ impl Floats { } } - pub fn len(&self) -> uint { + pub fn len(&self) -> usize { self.list.floats.len() } From 865d4b4eb42915ec8974fc49f1a78fc747077997 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sun, 29 Mar 2015 12:51:27 +0200 Subject: [PATCH 6/6] Use usize for UnsafeFlow. --- components/layout/parallel.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/layout/parallel.rs b/components/layout/parallel.rs index ee076763c24..57b74ac66e4 100644 --- a/components/layout/parallel.rs +++ b/components/layout/parallel.rs @@ -35,7 +35,7 @@ fn static_assertion(node: UnsafeLayoutNode) { } /// Vtable + pointer representation of a Flow trait object. -pub type UnsafeFlow = (uint, uint); +pub type UnsafeFlow = (usize, usize); fn null_unsafe_flow() -> UnsafeFlow { (0, 0)