Skip to content

Commit

Permalink
fix casts on 32-bit
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed May 27, 2013
1 parent 1484661 commit e6c04de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libstd/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub unsafe fn transmute_copy<T, U>(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::<U>() as u64);
intrinsics::memcpy32(dest_ptr, src_ptr, sys::size_of::<U>() as u32);
dest
}

Expand Down
2 changes: 1 addition & 1 deletion src/libstd/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
#[cfg(target_word_size = "32", not(stage0))]
pub unsafe fn copy_memory<T>(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)]
Expand Down

5 comments on commit e6c04de

@bors
Copy link
Contributor

@bors bors commented on e6c04de May 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on e6c04de May 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging thestinger/rust/swap_fast = e6c04de into auto

@bors
Copy link
Contributor

@bors bors commented on e6c04de May 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thestinger/rust/swap_fast = e6c04de merged ok, testing candidate = dbc5758

@bors
Copy link
Contributor

@bors bors commented on e6c04de May 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on e6c04de May 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding incoming to auto = dbc5758

Please sign in to comment.