Skip to content

Commit d46e565

Browse files
committed
---
yaml --- r: 52198 b: refs/heads/dist-snap c: 360982f h: refs/heads/master v: v3
1 parent 6afc807 commit d46e565

Some content is hidden

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

98 files changed

+1847
-1822
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: 44d4d6de762f3f9aae1fedcf454c66b79b3ad58d
10-
refs/heads/dist-snap: 5cfde77bca32bd956be4a0db65887d9efd333d2b
10+
refs/heads/dist-snap: 360982f24ffa306b294e61c6a4d9ec57e8a780ca
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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-
{
214+
test::TestDesc {
215215
name: make_test_name(config, testfile),
216216
testfn: make_test_closure(config, testfile),
217217
ignore: header::is_test_ignored(config, testfile),

branches/dist-snap/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(@{
406+
let v = visit::mk_simple_visitor(@visit::SimpleVisitor {
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/dist-snap/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::copy_memory(bytes, view, count);
506+
vec::bytes::memcpy(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::copy_memory(view, v, v_len);
953+
vec::bytes::memcpy(view, v, v_len);
954954
}
955955
956956
self.pos += v_len;

branches/dist-snap/src/libcore/libc.rs

Lines changed: 26 additions & 3 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};
403404
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,6 +513,12 @@ 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+
516522
pub type BOOL = c_int;
517523
pub type BYTE = u8;
518524
pub type CCHAR = c_char;
@@ -594,10 +600,10 @@ pub mod types {
594600
pub type ssize_t = i32;
595601
}
596602
pub mod posix01 {
603+
use libc::types::common::c99::{int32_t, int64_t, uint32_t};
597604
use libc::types::os::arch::c95::{c_long, time_t};
598-
use libc::types::os::arch::c99::{uint32_t, int32_t, int64_t};
599605
use libc::types::os::arch::posix88::{dev_t, gid_t, ino_t,
600-
mode_t, uid_t};
606+
mode_t, off_t, uid_t};
601607

602608
pub type nlink_t = u16;
603609
pub type blksize_t = i64;
@@ -1131,6 +1137,9 @@ pub mod funcs {
11311137
#[nolink]
11321138
#[abi = "cdecl"]
11331139
pub extern mod stat_ {
1140+
use libc::types::os::common::posix01::stat;
1141+
use libc::types::os::arch::c95::{c_int, c_char};
1142+
11341143
#[link_name = "_chmod"]
11351144
fn chmod(path: *c_char, mode: c_int) -> c_int;
11361145

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

@@ -1163,6 +1175,8 @@ pub mod funcs {
11631175
#[nolink]
11641176
#[abi = "cdecl"]
11651177
pub extern mod fcntl {
1178+
use libc::types::os::arch::c95::{c_int, c_char};
1179+
11661180
#[link_name = "_open"]
11671181
fn open(path: *c_char, oflag: c_int, mode: c_int) -> c_int;
11681182

@@ -1179,6 +1193,11 @@ pub mod funcs {
11791193
#[nolink]
11801194
#[abi = "cdecl"]
11811195
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+
11821201
#[link_name = "_access"]
11831202
fn access(path: *c_char, amode: c_int) -> c_int;
11841203

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

14741493
#[cfg(target_os = "win32")]
14751494
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+
14761499
#[abi = "stdcall"]
14771500
pub extern mod kernel32 {
14781501
fn GetEnvironmentVariableW(n: LPCWSTR,

branches/dist-snap/src/libcore/os.rs

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

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

7069
pub fn getcwd() -> Path {
7170
Path(rustrt::rust_getcwd())
@@ -92,7 +91,9 @@ pub mod win32 {
9291
use libc;
9392
use vec;
9493
use str;
94+
use option::{None, Option};
9595
use option;
96+
use os::tmpbuf_sz;
9697
use libc::types::os::arch::extra::DWORD;
9798

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

255256
#[cfg(windows)]
256257
pub fn getenv(n: &str) -> Option<~str> {
257-
use os::win32::*;
258+
use os::win32::{as_utf16_p, fill_utf16_buf_and_decode};
258259
do as_utf16_p(n) |u| {
259260
do fill_utf16_buf_and_decode() |buf, sz| {
260261
libc::GetEnvironmentVariableW(u, buf, sz)
@@ -275,7 +276,7 @@ mod global_env {
275276

276277
#[cfg(windows)]
277278
pub fn setenv(n: &str, v: &str) {
278-
use os::win32::*;
279+
use os::win32::as_utf16_p;
279280
do as_utf16_p(n) |nbuf| {
280281
do as_utf16_p(v) |vbuf| {
281282
libc::SetEnvironmentVariableW(nbuf, vbuf);
@@ -428,7 +429,7 @@ pub fn self_exe_path() -> Option<Path> {
428429

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

592593
#[cfg(windows)]
593594
fn mkdir(p: &Path, _mode: c_int) -> bool {
594-
use os::win32::*;
595+
use os::win32::as_utf16_p;
595596
// FIXME: turn mode into something useful? #2623
596597
do as_utf16_p(p.to_str()) |buf| {
597598
libc::CreateDirectoryW(buf, unsafe {
@@ -639,7 +640,7 @@ pub fn remove_dir(p: &Path) -> bool {
639640
640641
#[cfg(windows)]
641642
fn rmdir(p: &Path) -> bool {
642-
use os::win32::*;
643+
use os::win32::as_utf16_p;
643644
return do as_utf16_p(p.to_str()) |buf| {
644645
libc::RemoveDirectoryW(buf) != (0 as libc::BOOL)
645646
};
@@ -658,7 +659,7 @@ pub fn change_dir(p: &Path) -> bool {
658659
659660
#[cfg(windows)]
660661
fn chdir(p: &Path) -> bool {
661-
use os::win32::*;
662+
use os::win32::as_utf16_p;
662663
return do as_utf16_p(p.to_str()) |buf| {
663664
libc::SetCurrentDirectoryW(buf) != (0 as libc::BOOL)
664665
};
@@ -678,7 +679,7 @@ pub fn copy_file(from: &Path, to: &Path) -> bool {
678679
679680
#[cfg(windows)]
680681
fn do_copy_file(from: &Path, to: &Path) -> bool {
681-
use os::win32::*;
682+
use os::win32::as_utf16_p;
682683
return do as_utf16_p(from.to_str()) |fromp| {
683684
do as_utf16_p(to.to_str()) |top| {
684685
libc::CopyFileW(fromp, top, (0 as libc::BOOL)) !=
@@ -738,7 +739,7 @@ pub fn remove_file(p: &Path) -> bool {
738739

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

branches/dist-snap/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 copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
117+
pub unsafe fn memcpy<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 copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
126126
* and destination may overlap.
127127
*/
128128
#[inline(always)]
129-
pub unsafe fn copy_overlapping_memory<T>(dst: *mut T, src: *const T, count: uint) {
129+
pub unsafe fn memmove<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 set_memory<T>(dst: *mut T, c: int, count: uint) {
135+
pub unsafe fn memset<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::copy_memory(ptr::mut_offset(vec::raw::to_mut_ptr(v1), 1u),
309+
ptr::memcpy(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::copy_memory(vec::raw::to_mut_ptr(v1),
312+
ptr::memcpy(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::copy_memory(ptr::mut_offset(vec::raw::to_mut_ptr(v1), 2u),
315+
ptr::memcpy(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/dist-snap/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: fn(++x: *u8));
102+
fn frame_address(f: &once fn(++x: *u8));
103103
}

branches/dist-snap/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::copy_memory(dst, rbuf, rlen);
172+
ptr::memcpy(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::copy_memory(dst, rbuf, rlen);
189+
ptr::memcpy(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::copy_memory(vbuf, buf as *u8, len)
1970+
ptr::memcpy(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::copy_memory(vbuf, src, end - begin);
2027+
ptr::memcpy(vbuf, src, end - begin);
20282028
}
20292029
vec::raw::set_len(&mut v, end - begin);
20302030
v.push(0u8);

0 commit comments

Comments
 (0)