diff options
author | Ms2ger <ms2ger@gmail.com> | 2015-03-20 14:30:30 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2015-03-20 17:57:49 +0100 |
commit | 1604515fd9456a8ee03791b38c63cb5818b68082 (patch) | |
tree | 9dc8e7d80f918823ffe49454c114af98bf436d81 /components/layout | |
parent | 717805a593b58c69763dcabadff0b4aff182c80b (diff) | |
download | servo-1604515fd9456a8ee03791b38c63cb5818b68082.tar.gz servo-1604515fd9456a8ee03791b38c63cb5818b68082.zip |
Fix various build warnings.
Diffstat (limited to 'components/layout')
-rw-r--r-- | components/layout/flow.rs | 14 | ||||
-rw-r--r-- | components/layout/flow_ref.rs | 4 | ||||
-rw-r--r-- | components/layout/parallel.rs | 10 |
3 files changed, 13 insertions, 15 deletions
diff --git a/components/layout/flow.rs b/components/layout/flow.rs index a49b8a18db7..17ee14f7e00 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -58,7 +58,7 @@ use std::fmt; use std::iter::Zip; use std::num::FromPrimitive; use std::raw; -use std::sync::atomic::{AtomicUint, Ordering}; +use std::sync::atomic::{AtomicUsize, Ordering}; use std::slice::IterMut; use style::computed_values::{clear, empty_cells, float, position, text_align}; use style::properties::ComputedValues; @@ -740,9 +740,9 @@ pub struct BaseFlow { /// NB: Must be the first element. /// /// The necessity of this will disappear once we have dynamically-sized types. - strong_ref_count: AtomicUint, + strong_ref_count: AtomicUsize, - weak_ref_count: AtomicUint, + weak_ref_count: AtomicUsize, pub restyle_damage: RestyleDamage, @@ -951,8 +951,8 @@ impl BaseFlow { damage.remove(RECONSTRUCT_FLOW); BaseFlow { - strong_ref_count: AtomicUint::new(1), - weak_ref_count: AtomicUint::new(1), + strong_ref_count: AtomicUsize::new(1), + weak_ref_count: AtomicUsize::new(1), restyle_damage: damage, children: FlowList::new(), intrinsic_inline_sizes: IntrinsicISizes::new(), @@ -982,11 +982,11 @@ impl BaseFlow { self.children.iter_mut() } - pub unsafe fn strong_ref_count<'a>(&'a self) -> &'a AtomicUint { + pub unsafe fn strong_ref_count<'a>(&'a self) -> &'a AtomicUsize { &self.strong_ref_count } - pub unsafe fn weak_ref_count<'a>(&'a self) -> &'a AtomicUint { + pub unsafe fn weak_ref_count<'a>(&'a self) -> &'a AtomicUsize { &self.weak_ref_count } diff --git a/components/layout/flow_ref.rs b/components/layout/flow_ref.rs index e7b23aac698..19bce56e391 100644 --- a/components/layout/flow_ref.rs +++ b/components/layout/flow_ref.rs @@ -102,9 +102,7 @@ impl Drop for FlowRef { let object_align = vtable[2]; let fake_data = heap::allocate(object_size, object_align); - ptr::copy_memory(fake_data, - flow_ref.object.data as *const u8, - object_size); + ptr::copy(fake_data, flow_ref.object.data as *const u8, object_size); let fake_box = raw::TraitObject { vtable: flow_ref.object.vtable, data: fake_data as *mut () }; let fake_flow = mem::transmute::<raw::TraitObject, Box<Flow>>(fake_box); diff --git a/components/layout/parallel.rs b/components/layout/parallel.rs index ee2ca416cd1..d65a14dadbd 100644 --- a/components/layout/parallel.rs +++ b/components/layout/parallel.rs @@ -25,7 +25,7 @@ use util::time::{TimeProfilerCategory, ProfilerMetadata, TimeProfilerChan, profi use util::workqueue::{WorkQueue, WorkUnit, WorkerProxy}; use std::mem; use std::ptr; -use std::sync::atomic::{AtomicInt, Ordering}; +use std::sync::atomic::{AtomicIsize, Ordering}; #[allow(dead_code)] fn static_assertion(node: UnsafeLayoutNode) { @@ -68,13 +68,13 @@ pub fn mut_borrowed_flow_to_unsafe_flow(flow: &mut Flow) -> UnsafeFlow { /// Information that we need stored in each DOM node. pub struct DomParallelInfo { /// The number of children that still need work done. - pub children_count: AtomicInt, + pub children_count: AtomicIsize, } impl DomParallelInfo { pub fn new() -> DomParallelInfo { DomParallelInfo { - children_count: AtomicInt::new(0), + children_count: AtomicIsize::new(0), } } } @@ -187,7 +187,7 @@ trait ParallelPostorderDomTraversal : PostorderDomTraversal { /// Information that we need stored in each flow. pub struct FlowParallelInfo { /// The number of children that still need work done. - pub children_count: AtomicInt, + pub children_count: AtomicIsize, /// The address of the parent flow. pub parent: UnsafeFlow, } @@ -195,7 +195,7 @@ pub struct FlowParallelInfo { impl FlowParallelInfo { pub fn new() -> FlowParallelInfo { FlowParallelInfo { - children_count: AtomicInt::new(0), + children_count: AtomicIsize::new(0), parent: null_unsafe_flow(), } } |