From f0eae8f1c19a051ab750383e479f979c32d4598a Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 7 Sep 2012 14:50:47 -0700 Subject: Convert field terminators to commas. Stop parsing semis. --- src/libstd/arc.rs | 16 ++++++++-------- src/libstd/arena.rs | 6 +++--- src/libstd/cell.rs | 2 +- src/libstd/comm.rs | 4 ++-- src/libstd/map.rs | 16 ++++++++-------- src/libstd/sync.rs | 42 +++++++++++++++++++++--------------------- 6 files changed, 43 insertions(+), 43 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/arc.rs b/src/libstd/arc.rs index d8c32a26434..b5af4af06c3 100644 --- a/src/libstd/arc.rs +++ b/src/libstd/arc.rs @@ -19,7 +19,7 @@ export RWARC, rw_arc_with_condvars, RWWriteMode, RWReadMode; export unwrap_rw_arc; /// As sync::condvar, a mechanism for unlock-and-descheduling and signalling. -struct Condvar { is_mutex: bool; failed: &mut bool; cond: &sync::Condvar; } +struct Condvar { is_mutex: bool, failed: &mut bool, cond: &sync::Condvar } impl &Condvar { /// Atomically exit the associated ARC and block until a signal is sent. @@ -69,7 +69,7 @@ impl &Condvar { ****************************************************************************/ /// An atomically reference counted wrapper for shared immutable state. -struct ARC { x: SharedMutableState; } +struct ARC { x: SharedMutableState } /// Create an atomically reference counted wrapper. fn ARC(+data: T) -> ARC { @@ -114,9 +114,9 @@ fn unwrap(+rc: ARC) -> T { ****************************************************************************/ #[doc(hidden)] -struct MutexARCInner { lock: Mutex; failed: bool; data: T; } +struct MutexARCInner { lock: Mutex, failed: bool, data: T } /// An ARC with mutable data protected by a blocking mutex. -struct MutexARC { x: SharedMutableState>; } +struct MutexARC { x: SharedMutableState> } /// Create a mutex-protected ARC with the supplied data. fn MutexARC(+user_data: T) -> MutexARC { @@ -222,7 +222,7 @@ fn check_poison(is_mutex: bool, failed: bool) { #[doc(hidden)] struct PoisonOnFail { - failed: &mut bool; + failed: &mut bool, drop { /* assert !*self.failed; -- might be false in case of cond.wait() */ if task::failing() { *self.failed = true; } @@ -240,7 +240,7 @@ fn PoisonOnFail(failed: &r/mut bool) -> PoisonOnFail/&r { ****************************************************************************/ #[doc(hidden)] -struct RWARCInner { lock: RWlock; failed: bool; data: T; } +struct RWARCInner { lock: RWlock, failed: bool, data: T } /** * A dual-mode ARC protected by a reader-writer lock. The data can be accessed * mutably or immutably, and immutably-accessing tasks may run concurrently. @@ -248,8 +248,8 @@ struct RWARCInner { lock: RWlock; failed: bool; data: T; } * Unlike mutex_arcs, rw_arcs are safe, because they cannot be nested. */ struct RWARC { - x: SharedMutableState>; - mut cant_nest: (); + x: SharedMutableState>, + mut cant_nest: () } /// Create a reader/writer ARC with the supplied data. diff --git a/src/libstd/arena.rs b/src/libstd/arena.rs index b59ec38b352..a9010759ef9 100644 --- a/src/libstd/arena.rs +++ b/src/libstd/arena.rs @@ -51,9 +51,9 @@ struct Arena { // The head is seperated out from the list as a unbenchmarked // microoptimization, to avoid needing to case on the list to // access the head. - priv mut head: Chunk; - priv mut pod_head: Chunk; - priv mut chunks: @List; + priv mut head: Chunk, + priv mut pod_head: Chunk, + priv mut chunks: @List, drop { unsafe { destroy_chunk(self.head); diff --git a/src/libstd/cell.rs b/src/libstd/cell.rs index 2325b0e092e..e67be74c642 100644 --- a/src/libstd/cell.rs +++ b/src/libstd/cell.rs @@ -5,7 +5,7 @@ /// Similar to a mutable option type, but friendlier. struct Cell { - mut value: Option; + mut value: Option } /// Creates a new full cell with the given value. diff --git a/src/libstd/comm.rs b/src/libstd/comm.rs index b9934e425b9..d286b496923 100644 --- a/src/libstd/comm.rs +++ b/src/libstd/comm.rs @@ -14,8 +14,8 @@ export DuplexStream; /// An extension of `pipes::stream` that allows both sending and receiving. struct DuplexStream : Channel, Recv, Selectable { - priv chan: Chan; - priv port: Port ; + priv chan: Chan, + priv port: Port , fn send(+x: T) { self.chan.send(x) diff --git a/src/libstd/map.rs b/src/libstd/map.rs index c7eba5bb8eb..3db1c3407df 100644 --- a/src/libstd/map.rs +++ b/src/libstd/map.rs @@ -113,17 +113,17 @@ mod chained { const initial_capacity: uint = 32u; // 2^5 struct entry { - hash: uint; - key: K; - value: V; - mut next: Option<@entry>; + hash: uint, + key: K, + value: V, + mut next: Option<@entry> } struct hashmap_ { - mut count: uint; - mut chains: ~[mut Option<@entry>]; - hasher: hashfn; - eqer: eqfn; + mut count: uint, + mut chains: ~[mut Option<@entry>], + hasher: hashfn, + eqer: eqfn } type t = @hashmap_; diff --git a/src/libstd/sync.rs b/src/libstd/sync.rs index 264bd45a130..45ab8d4c427 100644 --- a/src/libstd/sync.rs +++ b/src/libstd/sync.rs @@ -24,8 +24,8 @@ type WaitEnd = pipes::PortOne<()>; type SignalEnd = pipes::ChanOne<()>; // A doubly-ended queue of waiting tasks. #[doc(hidden)] -struct Waitqueue { head: pipes::Port; - tail: pipes::Chan; } +struct Waitqueue { head: pipes::Port, + tail: pipes::Chan } fn new_waitqueue() -> Waitqueue { let (block_tail, block_head) = pipes::stream(); @@ -63,11 +63,11 @@ fn broadcast_waitqueue(q: &Waitqueue) -> uint { // The building-block used to make semaphores, mutexes, and rwlocks. #[doc(hidden)] struct SemInner { - mut count: int; - waiters: Waitqueue; + mut count: int, + waiters: Waitqueue, // Can be either unit or another waitqueue. Some sems shouldn't come with // a condition variable attached, others should. - blocked: Q; + blocked: Q } #[doc(hidden)] enum Sem = Exclusive>; @@ -153,7 +153,7 @@ impl &Sem<~[mut Waitqueue]> { // FIXME(#3136) should go inside of access() #[doc(hidden)] struct SemRelease { - sem: &Sem<()>; + sem: &Sem<()>, drop { self.sem.release(); } } @@ -165,7 +165,7 @@ fn SemRelease(sem: &r/Sem<()>) -> SemRelease/&r { #[doc(hidden)] struct SemAndSignalRelease { - sem: &Sem<~[mut Waitqueue]>; + sem: &Sem<~[mut Waitqueue]>, drop { self.sem.release(); } } @@ -177,7 +177,7 @@ fn SemAndSignalRelease(sem: &r/Sem<~[mut Waitqueue]>) } /// A mechanism for atomic-unlock-and-deschedule blocking and signalling. -struct Condvar { priv sem: &Sem<~[mut Waitqueue]>; drop { } } +struct Condvar { priv sem: &Sem<~[mut Waitqueue]>, drop { } } impl &Condvar { /** @@ -245,7 +245,7 @@ impl &Condvar { // mutex during unwinding. As long as the wrapper (mutex, etc) is // bounded in when it gets released, this shouldn't hang forever. struct SemAndSignalReacquire { - sem: &Sem<~[mut Waitqueue]>; + sem: &Sem<~[mut Waitqueue]>, drop unsafe { // Needs to succeed, instead of itself dying. do task::unkillable { @@ -338,7 +338,7 @@ impl &Sem<~[mut Waitqueue]> { ****************************************************************************/ /// A counting, blocking, bounded-waiting semaphore. -struct Semaphore { priv sem: Sem<()>; } +struct Semaphore { priv sem: Sem<()> } /// Create a new semaphore with the specified count. fn semaphore(count: int) -> Semaphore { @@ -377,7 +377,7 @@ impl &Semaphore { * A task which fails while holding a mutex will unlock the mutex as it * unwinds. */ -struct Mutex { priv sem: Sem<~[mut Waitqueue]>; } +struct Mutex { priv sem: Sem<~[mut Waitqueue]> } /// Create a new mutex, with one associated condvar. fn Mutex() -> Mutex { mutex_with_condvars(1) } @@ -412,8 +412,8 @@ impl &Mutex { #[doc(hidden)] struct RWlockInner { - read_mode: bool; - read_count: uint; + read_mode: bool, + read_count: uint } /** @@ -424,9 +424,9 @@ struct RWlockInner { * unwinds. */ struct RWlock { - /* priv */ order_lock: Semaphore; - /* priv */ access_lock: Sem<~[mut Waitqueue]>; - /* priv */ state: Exclusive; + /* priv */ order_lock: Semaphore, + /* priv */ access_lock: Sem<~[mut Waitqueue]>, + /* priv */ state: Exclusive } /// Create a new rwlock, with one associated condvar. @@ -584,7 +584,7 @@ impl &RWlock { // FIXME(#3136) should go inside of read() #[doc(hidden)] struct RWlockReleaseRead { - lock: &RWlock; + lock: &RWlock, drop unsafe { do task::unkillable { let mut last_reader = false; @@ -613,7 +613,7 @@ fn RWlockReleaseRead(lock: &r/RWlock) -> RWlockReleaseRead/&r { // FIXME(#3136) should go inside of downgrade() #[doc(hidden)] struct RWlockReleaseDowngrade { - lock: &RWlock; + lock: &RWlock, drop unsafe { do task::unkillable { let mut writer_or_last_reader = false; @@ -647,9 +647,9 @@ fn RWlockReleaseDowngrade(lock: &r/RWlock) -> RWlockReleaseDowngrade/&r { } /// The "write permission" token used for rwlock.write_downgrade(). -struct RWlockWriteMode { /* priv */ lock: &RWlock; drop { } } +struct RWlockWriteMode { /* priv */ lock: &RWlock, drop { } } /// The "read permission" token used for rwlock.write_downgrade(). -struct RWlockReadMode { priv lock: &RWlock; drop { } } +struct RWlockReadMode { priv lock: &RWlock, drop { } } impl &RWlockWriteMode { /// Access the pre-downgrade rwlock in write mode. @@ -956,7 +956,7 @@ mod tests { assert woken == 0; } struct SendOnFailure { - c: pipes::Chan<()>; + c: pipes::Chan<()>, drop { self.c.send(()); } } -- cgit 1.4.1-3-g733a5