Skip to content

Commit e196003

Browse files
committed
---
yaml --- r: 14104 b: refs/heads/try c: 159aebc h: refs/heads/master v: v3
1 parent 8d957a6 commit e196003

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 45bcef78e37fe259f8b4dc17414fcc2b4ae947b7
5+
refs/heads/try: 159aebc28bdd3e7667cb269d64dee844699dc3b0
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/libcore/ptr.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,19 @@ Function: memcpy
5959
Copies data from one src to dst that is not overlapping each other.
6060
Count is the number of elements to copy and not the number of bytes.
6161
*/
62-
unsafe fn memcpy<T>(dst: *T, src: *T, count: uint) { rusti::memcpy(dst, src, count); }
62+
unsafe fn memcpy<T>(dst: *T, src: *T, count: uint) {
63+
rusti::memcpy(dst, src, count);
64+
}
6365

6466
/*
6567
Function: memmove
6668
6769
Copies data from one src to dst, overlap between the two pointers may occur.
6870
Count is the number of elements to copy and not the number of bytes.
6971
*/
70-
unsafe fn memmove<T>(dst: *T, src: *T, count: uint) { rusti::memcpy(dst, src, count); }
72+
unsafe fn memmove<T>(dst: *T, src: *T, count: uint) {
73+
rusti::memcpy(dst, src, count);
74+
}
7175

7276
#[test]
7377
fn test() unsafe {
@@ -87,11 +91,14 @@ fn test() unsafe {
8791

8892
let v0 = [32000u16, 32001u16, 32002u16];
8993
let v1 = [0u16, 0u16, 0u16];
90-
91-
ptr::memcpy(ptr::offset(vec::unsafe::to_ptr(v1), 1u), ptr::offset(vec::unsafe::to_ptr(v0), 1u), 1u);
94+
95+
ptr::memcpy(ptr::offset(vec::unsafe::to_ptr(v1), 1u),
96+
ptr::offset(vec::unsafe::to_ptr(v0), 1u), 1u);
9297
assert (v1[0] == 0u16 && v1[1] == 32001u16 && v1[2] == 0u16);
93-
ptr::memcpy(vec::unsafe::to_ptr(v1), ptr::offset(vec::unsafe::to_ptr(v0), 2u), 1u);
98+
ptr::memcpy(vec::unsafe::to_ptr(v1),
99+
ptr::offset(vec::unsafe::to_ptr(v0), 2u), 1u);
94100
assert (v1[0] == 32002u16 && v1[1] == 32001u16 && v1[2] == 0u16);
95-
ptr::memcpy(ptr::offset(vec::unsafe::to_ptr(v1), 2u), vec::unsafe::to_ptr(v0), 1u);
101+
ptr::memcpy(ptr::offset(vec::unsafe::to_ptr(v1), 2u),
102+
vec::unsafe::to_ptr(v0), 1u);
96103
assert (v1[0] == 32002u16 && v1[1] == 32001u16 && v1[2] == 32000u16);
97104
}

0 commit comments

Comments
 (0)