From e6c04dea0325af808198306e283c17f90d31fc26 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Mon, 27 May 2013 18:14:00 -0400 Subject: [PATCH] fix casts on 32-bit --- src/libstd/cast.rs | 2 +- src/libstd/ptr.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstd/cast.rs b/src/libstd/cast.rs index 9ef5d8ad6f7..30ad41f0ca2 100644 --- a/src/libstd/cast.rs +++ b/src/libstd/cast.rs @@ -33,7 +33,7 @@ pub unsafe fn transmute_copy(src: &T) -> U { let mut dest: U = intrinsics::uninit(); let dest_ptr: *mut u8 = transmute(&mut dest); let src_ptr: *u8 = transmute(src); - intrinsics::memcpy32(dest_ptr, src_ptr, sys::size_of::() as u64); + intrinsics::memcpy32(dest_ptr, src_ptr, sys::size_of::() as u32); dest } diff --git a/src/libstd/ptr.rs b/src/libstd/ptr.rs index e787558c6e4..309129b7f13 100644 --- a/src/libstd/ptr.rs +++ b/src/libstd/ptr.rs @@ -109,7 +109,7 @@ pub unsafe fn copy_memory(dst: *mut T, src: *const T, count: uint) { #[cfg(target_word_size = "32", not(stage0))] pub unsafe fn copy_memory(dst: *mut T, src: *const T, count: uint) { use unstable::intrinsics::memmove32; - memmove32(dst, src, count as u32); + memmove32(dst, src as *T, count as u32); } #[inline(always)]