Skip to content

Commit f87ea51

Browse files
committed
---
yaml --- r: 11098 b: refs/heads/master c: 159aebc h: refs/heads/master v: v3
1 parent b324e8b commit f87ea51

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 45bcef78e37fe259f8b4dc17414fcc2b4ae947b7
2+
refs/heads/master: 159aebc28bdd3e7667cb269d64dee844699dc3b0
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/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)