Rename std::vec::unsafe::ivec_repr to vec_repr. Issue #855

This commit is contained in:
Brian Anderson 2011-09-02 13:44:01 -07:00
parent 72c14d5a41
commit 1e8200dadd

View file

@ -341,21 +341,21 @@ iter iter2<@T>(v: &[T]) -> (uint, T) {
}
mod unsafe {
type ivec_repr = {mutable fill: uint,
mutable alloc: uint,
data: u8};
type vec_repr = {mutable fill: uint,
mutable alloc: uint,
data: u8};
fn from_buf<T>(ptr: *T, elts: uint) -> [T] {
ret rustrt::vec_from_buf_shared(ptr, elts);
}
fn set_len<T>(v: &mutable [T], new_len: uint) {
let repr: **ivec_repr = ::unsafe::reinterpret_cast(addr_of(v));
let repr: **vec_repr = ::unsafe::reinterpret_cast(addr_of(v));
(**repr).fill = new_len * sys::size_of::<T>();
}
fn to_ptr<T>(v: &[T]) -> *T {
let repr: **ivec_repr = ::unsafe::reinterpret_cast(addr_of(v));
let repr: **vec_repr = ::unsafe::reinterpret_cast(addr_of(v));
ret ::unsafe::reinterpret_cast(addr_of((**repr).data));
}
}