Skip to content

Commit 98e7ef7

Browse files
committed
---
yaml --- r: 38375 b: refs/heads/try c: 5cfde77 h: refs/heads/master i: 38373: c3842af 38371: 8cf8642 38367: d1fb349 v: v3
1 parent 7eba6c2 commit 98e7ef7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1794
-1737
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 09bb07bed9166105ea961a42b5fff7739ae0d2e9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5-
refs/heads/try: 349e772bc5184cde5f8d836575ab68c78bd93bcc
5+
refs/heads/try: 5cfde77bca32bd956be4a0db65887d9efd333d2b
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/src/compiletest/compiletest.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ fn is_test(config: config, testfile: &Path) -> bool {
211211

212212
fn make_test(config: config, testfile: &Path) ->
213213
test::TestDesc {
214-
test::TestDesc {
214+
{
215215
name: make_test_name(config, testfile),
216216
testfn: make_test_closure(config, testfile),
217217
ignore: header::is_test_ignored(config, testfile),

branches/try/src/libcargo/cargo.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ fn load_crate(filename: &Path) -> Option<Crate> {
403403
let e = @{
404404
mut deps: ~[]
405405
};
406-
let v = visit::mk_simple_visitor(@visit::SimpleVisitor {
406+
let v = visit::mk_simple_visitor(@{
407407
visit_view_item: |a| goto_view_item(sess, e, a),
408408
visit_item: |a| goto_item(e, a),
409409
.. *visit::default_simple_visitor()

branches/try/src/libcore/io.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ impl BytesReader: Reader {
503503
let count = uint::min(len, self.bytes.len() - self.pos);
504504
505505
let view = vec::view(self.bytes, self.pos, self.bytes.len());
506-
vec::bytes::memcpy(bytes, view, count);
506+
vec::bytes::copy_memory(bytes, view, count);
507507
508508
self.pos += count;
509509
@@ -950,7 +950,7 @@ impl BytesWriter: Writer {
950950
951951
{
952952
let view = vec::mut_view(bytes, self.pos, count);
953-
vec::bytes::memcpy(view, v, v_len);
953+
vec::bytes::copy_memory(view, v, v_len);
954954
}
955955
956956
self.pos += v_len;

branches/try/src/libcore/libc.rs

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,8 @@ pub mod types {
400400
pub type ssize_t = i64;
401401
}
402402
pub mod posix01 {
403-
use libc::types::common::c99::{uint8_t, uint32_t, int32_t};
404403
use libc::types::os::arch::c95::{c_long, time_t};
404+
use libc::types::os::arch::c99::{uint8_t, uint32_t, int32_t};
405405
use libc::types::os::arch::posix88::{dev_t, gid_t, ino_t};
406406
use libc::types::os::arch::posix88::{mode_t, off_t};
407407
use libc::types::os::arch::posix88::{uid_t};
@@ -513,12 +513,6 @@ pub mod types {
513513
pub mod bsd44 {
514514
}
515515
pub mod extra {
516-
use libc::types::common::c95::c_void;
517-
use libc::types::os::arch::c95::{c_char, c_int, c_uint};
518-
use libc::types::os::arch::c95::{c_long, c_ulong};
519-
use libc::types::os::arch::c95::{wchar_t};
520-
use libc::types::os::arch::c99::{c_ulonglong};
521-
522516
pub type BOOL = c_int;
523517
pub type BYTE = u8;
524518
pub type CCHAR = c_char;
@@ -600,10 +594,10 @@ pub mod types {
600594
pub type ssize_t = i32;
601595
}
602596
pub mod posix01 {
603-
use libc::types::common::c99::{int32_t, int64_t, uint32_t};
604597
use libc::types::os::arch::c95::{c_long, time_t};
598+
use libc::types::os::arch::c99::{uint32_t, int32_t, int64_t};
605599
use libc::types::os::arch::posix88::{dev_t, gid_t, ino_t,
606-
mode_t, off_t, uid_t};
600+
mode_t, uid_t};
607601

608602
pub type nlink_t = u16;
609603
pub type blksize_t = i64;
@@ -1137,9 +1131,6 @@ pub mod funcs {
11371131
#[nolink]
11381132
#[abi = "cdecl"]
11391133
pub extern mod stat_ {
1140-
use libc::types::os::common::posix01::stat;
1141-
use libc::types::os::arch::c95::{c_int, c_char};
1142-
11431134
#[link_name = "_chmod"]
11441135
fn chmod(path: *c_char, mode: c_int) -> c_int;
11451136

@@ -1156,9 +1147,6 @@ pub mod funcs {
11561147
#[nolink]
11571148
#[abi = "cdecl"]
11581149
pub extern mod stdio {
1159-
use libc::types::common::c95::FILE;
1160-
use libc::types::os::arch::c95::{c_int, c_char};
1161-
11621150
#[link_name = "_popen"]
11631151
fn popen(command: *c_char, mode: *c_char) -> *FILE;
11641152

@@ -1175,8 +1163,6 @@ pub mod funcs {
11751163
#[nolink]
11761164
#[abi = "cdecl"]
11771165
pub extern mod fcntl {
1178-
use libc::types::os::arch::c95::{c_int, c_char};
1179-
11801166
#[link_name = "_open"]
11811167
fn open(path: *c_char, oflag: c_int, mode: c_int) -> c_int;
11821168

@@ -1193,11 +1179,6 @@ pub mod funcs {
11931179
#[nolink]
11941180
#[abi = "cdecl"]
11951181
pub extern mod unistd {
1196-
use libc::types::common::c95::c_void;
1197-
use libc::types::os::arch::c95::{c_int, c_uint, c_char,
1198-
c_long, size_t};
1199-
use libc::types::os::arch::c99::intptr_t;
1200-
12011182
#[link_name = "_access"]
12021183
fn access(path: *c_char, amode: c_int) -> c_int;
12031184

@@ -1492,10 +1473,6 @@ pub mod funcs {
14921473

14931474
#[cfg(target_os = "win32")]
14941475
pub mod extra {
1495-
use libc::types::os::arch::c95::c_int;
1496-
use libc::types::os::arch::extra::{DWORD, HMODULE, LPCWSTR, LPWSTR};
1497-
use libc::types::os::arch::extra::{BOOL, LPSECURITY_ATTRIBUTES};
1498-
14991476
#[abi = "stdcall"]
15001477
pub extern mod kernel32 {
15011478
fn GetEnvironmentVariableW(n: LPCWSTR,

branches/try/src/libcore/os.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ extern mod rustrt {
6464
fn rust_set_exit_status(code: libc::intptr_t);
6565
}
6666

67-
pub const tmpbuf_sz : uint = 1000u;
67+
68+
const tmpbuf_sz : uint = 1000u;
6869

6970
pub fn getcwd() -> Path {
7071
Path(rustrt::rust_getcwd())
@@ -91,9 +92,7 @@ pub mod win32 {
9192
use libc;
9293
use vec;
9394
use str;
94-
use option::{None, Option};
9595
use option;
96-
use os::tmpbuf_sz;
9796
use libc::types::os::arch::extra::DWORD;
9897

9998
pub fn fill_utf16_buf_and_decode(f: fn(*mut u16, DWORD) -> DWORD)
@@ -255,7 +254,7 @@ mod global_env {
255254

256255
#[cfg(windows)]
257256
pub fn getenv(n: &str) -> Option<~str> {
258-
use os::win32::{as_utf16_p, fill_utf16_buf_and_decode};
257+
use os::win32::*;
259258
do as_utf16_p(n) |u| {
260259
do fill_utf16_buf_and_decode() |buf, sz| {
261260
libc::GetEnvironmentVariableW(u, buf, sz)
@@ -276,7 +275,7 @@ mod global_env {
276275

277276
#[cfg(windows)]
278277
pub fn setenv(n: &str, v: &str) {
279-
use os::win32::as_utf16_p;
278+
use os::win32::*;
280279
do as_utf16_p(n) |nbuf| {
281280
do as_utf16_p(v) |vbuf| {
282281
libc::SetEnvironmentVariableW(nbuf, vbuf);
@@ -429,7 +428,7 @@ pub fn self_exe_path() -> Option<Path> {
429428

430429
#[cfg(windows)]
431430
fn load_self() -> Option<~str> {
432-
use os::win32::fill_utf16_buf_and_decode;
431+
use os::win32::*;
433432
do fill_utf16_buf_and_decode() |buf, sz| {
434433
libc::GetModuleFileNameW(0u as libc::DWORD, buf, sz)
435434
}
@@ -592,7 +591,7 @@ pub fn make_dir(p: &Path, mode: c_int) -> bool {
592591

593592
#[cfg(windows)]
594593
fn mkdir(p: &Path, _mode: c_int) -> bool {
595-
use os::win32::as_utf16_p;
594+
use os::win32::*;
596595
// FIXME: turn mode into something useful? #2623
597596
do as_utf16_p(p.to_str()) |buf| {
598597
libc::CreateDirectoryW(buf, unsafe {
@@ -640,7 +639,7 @@ pub fn remove_dir(p: &Path) -> bool {
640639
641640
#[cfg(windows)]
642641
fn rmdir(p: &Path) -> bool {
643-
use os::win32::as_utf16_p;
642+
use os::win32::*;
644643
return do as_utf16_p(p.to_str()) |buf| {
645644
libc::RemoveDirectoryW(buf) != (0 as libc::BOOL)
646645
};
@@ -659,7 +658,7 @@ pub fn change_dir(p: &Path) -> bool {
659658
660659
#[cfg(windows)]
661660
fn chdir(p: &Path) -> bool {
662-
use os::win32::as_utf16_p;
661+
use os::win32::*;
663662
return do as_utf16_p(p.to_str()) |buf| {
664663
libc::SetCurrentDirectoryW(buf) != (0 as libc::BOOL)
665664
};
@@ -679,7 +678,7 @@ pub fn copy_file(from: &Path, to: &Path) -> bool {
679678
680679
#[cfg(windows)]
681680
fn do_copy_file(from: &Path, to: &Path) -> bool {
682-
use os::win32::as_utf16_p;
681+
use os::win32::*;
683682
return do as_utf16_p(from.to_str()) |fromp| {
684683
do as_utf16_p(to.to_str()) |top| {
685684
libc::CopyFileW(fromp, top, (0 as libc::BOOL)) !=
@@ -739,7 +738,7 @@ pub fn remove_file(p: &Path) -> bool {
739738

740739
#[cfg(windows)]
741740
fn unlink(p: &Path) -> bool {
742-
use os::win32::as_utf16_p;
741+
use os::win32::*;
743742
return do as_utf16_p(p.to_str()) |buf| {
744743
libc::DeleteFileW(buf) != (0 as libc::BOOL)
745744
};

branches/try/src/libcore/ptr.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pub pure fn is_not_null<T>(ptr: *const T) -> bool { !is_null(ptr) }
114114
* and destination may not overlap.
115115
*/
116116
#[inline(always)]
117-
pub unsafe fn memcpy<T>(dst: *mut T, src: *const T, count: uint) {
117+
pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
118118
let n = count * sys::size_of::<T>();
119119
libc_::memcpy(dst as *mut c_void, src as *c_void, n as size_t);
120120
}
@@ -126,13 +126,13 @@ pub unsafe fn memcpy<T>(dst: *mut T, src: *const T, count: uint) {
126126
* and destination may overlap.
127127
*/
128128
#[inline(always)]
129-
pub unsafe fn memmove<T>(dst: *mut T, src: *const T, count: uint) {
129+
pub unsafe fn copy_overlapping_memory<T>(dst: *mut T, src: *const T, count: uint) {
130130
let n = count * sys::size_of::<T>();
131131
libc_::memmove(dst as *mut c_void, src as *c_void, n as size_t);
132132
}
133133

134134
#[inline(always)]
135-
pub unsafe fn memset<T>(dst: *mut T, c: int, count: uint) {
135+
pub unsafe fn set_memory<T>(dst: *mut T, c: int, count: uint) {
136136
let n = count * sys::size_of::<T>();
137137
libc_::memset(dst as *mut c_void, c as libc::c_int, n as size_t);
138138
}
@@ -306,13 +306,13 @@ pub fn test() {
306306
let mut v0 = ~[32000u16, 32001u16, 32002u16];
307307
let mut v1 = ~[0u16, 0u16, 0u16];
308308

309-
ptr::memcpy(ptr::mut_offset(vec::raw::to_mut_ptr(v1), 1u),
309+
ptr::copy_memory(ptr::mut_offset(vec::raw::to_mut_ptr(v1), 1u),
310310
ptr::offset(vec::raw::to_ptr(v0), 1u), 1u);
311311
assert (v1[0] == 0u16 && v1[1] == 32001u16 && v1[2] == 0u16);
312-
ptr::memcpy(vec::raw::to_mut_ptr(v1),
312+
ptr::copy_memory(vec::raw::to_mut_ptr(v1),
313313
ptr::offset(vec::raw::to_ptr(v0), 2u), 1u);
314314
assert (v1[0] == 32002u16 && v1[1] == 32001u16 && v1[2] == 0u16);
315-
ptr::memcpy(ptr::mut_offset(vec::raw::to_mut_ptr(v1), 2u),
315+
ptr::copy_memory(ptr::mut_offset(vec::raw::to_mut_ptr(v1), 2u),
316316
vec::raw::to_ptr(v0), 1u);
317317
assert (v1[0] == 32002u16 && v1[1] == 32001u16 && v1[2] == 32000u16);
318318
}

branches/try/src/libcore/stackwalk.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,5 @@ extern mod rustrt {
9999
#[abi = "rust-intrinsic"]
100100
extern mod rusti {
101101
#[legacy_exports];
102-
fn frame_address(f: &once fn(++x: *u8));
102+
fn frame_address(f: fn(++x: *u8));
103103
}

branches/try/src/libcore/str.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ pub fn push_str_no_overallocate(lhs: &mut ~str, rhs: &str) {
169169
do as_buf(rhs) |rbuf, _rlen| {
170170
let dst = ptr::offset(lbuf, llen);
171171
let dst = ::cast::transmute_mut_unsafe(dst);
172-
ptr::memcpy(dst, rbuf, rlen);
172+
ptr::copy_memory(dst, rbuf, rlen);
173173
}
174174
}
175175
raw::set_len(lhs, llen + rlen);
@@ -186,7 +186,7 @@ pub fn push_str(lhs: &mut ~str, rhs: &str) {
186186
do as_buf(rhs) |rbuf, _rlen| {
187187
let dst = ptr::offset(lbuf, llen);
188188
let dst = ::cast::transmute_mut_unsafe(dst);
189-
ptr::memcpy(dst, rbuf, rlen);
189+
ptr::copy_memory(dst, rbuf, rlen);
190190
}
191191
}
192192
raw::set_len(lhs, llen + rlen);
@@ -1967,7 +1967,7 @@ pub mod raw {
19671967
pub unsafe fn from_buf_len(buf: *const u8, len: uint) -> ~str {
19681968
let mut v: ~[u8] = vec::with_capacity(len + 1);
19691969
vec::as_mut_buf(v, |vbuf, _len| {
1970-
ptr::memcpy(vbuf, buf as *u8, len)
1970+
ptr::copy_memory(vbuf, buf as *u8, len)
19711971
});
19721972
vec::raw::set_len(&mut v, len);
19731973
v.push(0u8);
@@ -2024,7 +2024,7 @@ pub mod raw {
20242024
do vec::as_imm_buf(v) |vbuf, _vlen| {
20252025
let vbuf = ::cast::transmute_mut_unsafe(vbuf);
20262026
let src = ptr::offset(sbuf, begin);
2027-
ptr::memcpy(vbuf, src, end - begin);
2027+
ptr::copy_memory(vbuf, src, end - begin);
20282028
}
20292029
vec::raw::set_len(&mut v, end - begin);
20302030
v.push(0u8);

0 commit comments

Comments
 (0)