Skip to content

Commit 39b3a05

Browse files
Fix nits.
1 parent d0b7515 commit 39b3a05

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

src/libextra/arc.rs

+9-8
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@ impl<T:Send> MutexArc<T> {
182182
* Create a mutex-protected Arc with the supplied data and a specified number
183183
* of condvars (as sync::Mutex::new_with_condvars).
184184
*/
185-
pub fn new_with_condvars(user_data: T,
186-
num_condvars: uint) -> MutexArc<T> {
187-
let data =
188-
MutexArcInner { lock: Mutex::new_with_condvars(num_condvars),
189-
failed: false, data: user_data };
185+
pub fn new_with_condvars(user_data: T, num_condvars: uint) -> MutexArc<T> {
186+
let data = MutexArcInner {
187+
lock: Mutex::new_with_condvars(num_condvars),
188+
failed: false, data: user_data
189+
};
190190
MutexArc { x: UnsafeAtomicRcBox::new(data) }
191191
}
192192

@@ -333,9 +333,10 @@ impl<T:Freeze + Send> RWArc<T> {
333333
* of condvars (as sync::RWLock::new_with_condvars).
334334
*/
335335
pub fn new_with_condvars(user_data: T, num_condvars: uint) -> RWArc<T> {
336-
let data =
337-
RWArcInner { lock: RWLock::new_with_condvars(num_condvars),
338-
failed: false, data: user_data };
336+
let data = RWArcInner {
337+
lock: RWLock::new_with_condvars(num_condvars),
338+
failed: false, data: user_data
339+
};
339340
RWArc { x: UnsafeAtomicRcBox::new(data), }
340341
}
341342

src/libstd/unstable/sync.rs

+7-9
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,11 @@ impl<T> Drop for UnsafeAtomicRcBox<T>{
236236

237237
/****************************************************************************/
238238

239-
enum RTLittleLock {
240-
// We know nothing about the runtime's representation of the
241-
// little lock so we leave the definition empty.
242-
}
239+
#[allow(non_camel_case_types)] // runtime type
240+
type rust_little_lock = *libc::c_void;
243241

244242
pub struct LittleLock {
245-
l: *RTLittleLock,
243+
l: rust_little_lock,
246244
}
247245

248246
impl Drop for LittleLock {
@@ -351,10 +349,10 @@ impl<T:Send> Exclusive<T> {
351349
}
352350

353351
extern {
354-
fn rust_create_little_lock() -> *RTLittleLock;
355-
fn rust_destroy_little_lock(lock: *RTLittleLock);
356-
fn rust_lock_little_lock(lock: *RTLittleLock);
357-
fn rust_unlock_little_lock(lock: *RTLittleLock);
352+
fn rust_create_little_lock() -> rust_little_lock;
353+
fn rust_destroy_little_lock(lock: rust_little_lock);
354+
fn rust_lock_little_lock(lock: rust_little_lock);
355+
fn rust_unlock_little_lock(lock: rust_little_lock);
358356
}
359357

360358
#[cfg(test)]

0 commit comments

Comments
 (0)