Skip to content

Commit 1db684f

Browse files
committed
int audit - std::sync
1 parent 5d8c9f5 commit 1db684f

13 files changed

+177
-177
lines changed

src/libstd/sync/barrier.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ use sync::{Mutex, Condvar};
3333
pub struct Barrier {
3434
lock: Mutex<BarrierState>,
3535
cvar: Condvar,
36-
num_threads: uint,
36+
num_threads: usize,
3737
}
3838

3939
// The inner state of a double barrier
4040
struct BarrierState {
41-
count: uint,
42-
generation_id: uint,
41+
count: usize,
42+
generation_id: usize,
4343
}
4444

4545
/// A result returned from wait.
@@ -54,7 +54,7 @@ impl Barrier {
5454
/// A barrier will block `n`-1 threads which call `wait` and then wake up
5555
/// all threads at once when the `n`th thread calls `wait`.
5656
#[stable(feature = "rust1", since = "1.0.0")]
57-
pub fn new(n: uint) -> Barrier {
57+
pub fn new(n: usize) -> Barrier {
5858
Barrier {
5959
lock: Mutex::new(BarrierState {
6060
count: 0,
@@ -115,7 +115,7 @@ mod tests {
115115

116116
#[test]
117117
fn test_barrier() {
118-
const N: uint = 10;
118+
const N: usize = 10;
119119

120120
let barrier = Arc::new(Barrier::new(N));
121121
let (tx, rx) = channel();

src/libstd/sync/condvar.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ impl StaticCondvar {
327327
}
328328

329329
fn verify(&self, mutex: &sys_mutex::Mutex) {
330-
let addr = mutex as *const _ as uint;
330+
let addr = mutex as *const _ as usize;
331331
match self.mutex.compare_and_swap(0, addr, Ordering::SeqCst) {
332332
// If we got out 0, then we have successfully bound the mutex to
333333
// this cvar.
@@ -388,7 +388,7 @@ mod tests {
388388

389389
#[test]
390390
fn notify_all() {
391-
const N: uint = 10;
391+
const N: usize = 10;
392392

393393
let data = Arc::new((Mutex::new(0), Condvar::new()));
394394
let (tx, rx) = channel();

src/libstd/sync/mpsc/blocking.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,17 @@ impl SignalToken {
6161
wake
6262
}
6363

64-
/// Convert to an unsafe uint value. Useful for storing in a pipe's state
64+
/// Convert to an unsafe usize value. Useful for storing in a pipe's state
6565
/// flag.
6666
#[inline]
67-
pub unsafe fn cast_to_uint(self) -> uint {
67+
pub unsafe fn cast_to_usize(self) -> usize {
6868
mem::transmute(self.inner)
6969
}
7070

71-
/// Convert from an unsafe uint value. Useful for retrieving a pipe's state
71+
/// Convert from an unsafe usize value. Useful for retrieving a pipe's state
7272
/// flag.
7373
#[inline]
74-
pub unsafe fn cast_from_uint(signal_ptr: uint) -> SignalToken {
74+
pub unsafe fn cast_from_usize(signal_ptr: usize) -> SignalToken {
7575
SignalToken { inner: mem::transmute(signal_ptr) }
7676
}
7777

0 commit comments

Comments
 (0)