Repair RIMOV damage to libstd
This commit is contained in:
parent
5e55fe8758
commit
dafd759b20
@ -233,7 +233,7 @@ pub fn Bitv (nbits: uint, init: bool) -> Bitv {
|
||||
let nelems = nbits/uint_bits +
|
||||
if nbits % uint_bits == 0 {0} else {1};
|
||||
let elem = if init {!0} else {0};
|
||||
let s = cast_to_mut(from_elem(nelems, elem));
|
||||
let s = from_elem(nelems, elem);
|
||||
Big(~BigBitv(move s))
|
||||
};
|
||||
Bitv {rep: move rep, nbits: nbits}
|
||||
@ -518,7 +518,7 @@ impl Bitv: Clone {
|
||||
Bitv{nbits: self.nbits, rep: Small(~SmallBitv{bits: b.bits})}
|
||||
}
|
||||
Big(ref b) => {
|
||||
let st = cast_to_mut(from_elem(self.nbits / uint_bits + 1, 0));
|
||||
let mut st = from_elem(self.nbits / uint_bits + 1, 0);
|
||||
let len = st.len();
|
||||
for uint::range(0, len) |i| { st[i] = b.storage[i]; };
|
||||
Bitv{nbits: self.nbits, rep: Big(~BigBitv{storage: move st})}
|
||||
|
@ -209,7 +209,7 @@ pub mod chained {
|
||||
fn rehash() {
|
||||
let n_old_chains = self.chains.len();
|
||||
let n_new_chains: uint = uint::next_power_of_two(n_old_chains+1u);
|
||||
let new_chains = chains(n_new_chains);
|
||||
let mut new_chains = chains(n_new_chains);
|
||||
for self.each_entry |entry| {
|
||||
let idx = entry.hash % n_new_chains;
|
||||
entry.next = new_chains[idx];
|
||||
@ -459,7 +459,7 @@ pub mod chained {
|
||||
}
|
||||
|
||||
fn chains<K,V>(nchains: uint) -> ~[Option<@Entry<K,V>>] {
|
||||
vec::cast_to_mut(vec::from_elem(nchains, None))
|
||||
vec::from_elem(nchains, None)
|
||||
}
|
||||
|
||||
pub fn mk<K:Eq IterBytes Hash, V: Copy>() -> T<K,V> {
|
||||
|
@ -1168,8 +1168,7 @@ pub mod node {
|
||||
}
|
||||
|
||||
pub fn start(node: @Node) -> T {
|
||||
let stack = vec::cast_to_mut(
|
||||
vec::from_elem(height(node)+1u, node));
|
||||
let stack = vec::from_elem(height(node)+1u, node);
|
||||
T {
|
||||
stack: stack,
|
||||
stackpos: 0,
|
||||
|
@ -67,13 +67,13 @@ const k3: u32 = 0xCA62C1D6u32;
|
||||
/// Construct a `sha` object
|
||||
pub fn sha1() -> Sha1 {
|
||||
type Sha1State =
|
||||
{h: ~[u32],
|
||||
{h: ~[mut u32],
|
||||
mut len_low: u32,
|
||||
mut len_high: u32,
|
||||
mut msg_block: ~[u8],
|
||||
msg_block: ~[mut u8],
|
||||
mut msg_block_idx: uint,
|
||||
mut computed: bool,
|
||||
work_buf: @~[u32]};
|
||||
work_buf: @~[mut u32]};
|
||||
|
||||
fn add_input(st: &Sha1State, msg: &[const u8]) {
|
||||
assert (!st.computed);
|
||||
|
@ -97,7 +97,7 @@ fn new_sem_and_signal(count: int, num_condvars: uint)
|
||||
for num_condvars.times {
|
||||
queues.push(new_waitqueue());
|
||||
}
|
||||
new_sem(count, vec::cast_to_mut(move queues))
|
||||
new_sem(count, queues)
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user