Skip to content

Commit 0ada7c7

Browse files
committed
Making fields in std and extra : private #4386
1 parent dadb6f0 commit 0ada7c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1504
-450
lines changed

src/libextra/arc.rs

+12-5
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ use std::borrow;
5050

5151
/// As sync::condvar, a mechanism for unlock-and-descheduling and signaling.
5252
pub struct Condvar<'self> {
53+
// all were already priv
5354
priv is_mutex: bool,
5455
priv failed: &'self mut bool,
5556
priv cond: &'self sync::Condvar<'self>
@@ -108,6 +109,7 @@ impl<'self> Condvar<'self> {
108109
****************************************************************************/
109110

110111
/// An atomically reference counted wrapper for shared immutable state.
112+
// all were already priv
111113
pub struct Arc<T> { priv x: UnsafeArc<T> }
112114

113115

@@ -162,6 +164,7 @@ struct MutexArcInner<T> { priv lock: Mutex, priv failed: bool, priv data: T }
162164

163165
/// An Arc with mutable data protected by a blocking mutex.
164166
#[no_freeze]
167+
//All were already priv
165168
pub struct MutexArc<T> { priv x: UnsafeArc<MutexArcInner<T>> }
166169

167170

@@ -344,6 +347,7 @@ struct RWArcInner<T> { priv lock: RWLock, priv failed: bool, priv data: T }
344347
*/
345348
#[no_freeze]
346349
pub struct RWArc<T> {
350+
// all were already priv
347351
priv x: UnsafeArc<RWArcInner<T>>,
348352
}
349353

@@ -521,15 +525,18 @@ fn borrow_rwlock<T:Freeze + Send>(state: *mut RWArcInner<T>) -> *RWLock {
521525

522526
/// The "write permission" token used for RWArc.write_downgrade().
523527
pub struct RWWriteMode<'self, T> {
524-
data: &'self mut T,
525-
token: sync::RWLockWriteMode<'self>,
526-
poison: PoisonOnFail,
528+
529+
/// reedlepee added priv in all the feilds below
530+
priv data: &'self mut T,
531+
priv token: sync::RWLockWriteMode<'self>,
532+
priv poison: PoisonOnFail,
527533
}
528534

529535
/// The "read permission" token used for RWArc.write_downgrade().
530536
pub struct RWReadMode<'self, T> {
531-
data: &'self T,
532-
token: sync::RWLockReadMode<'self>,
537+
/// reedlepee added priv in all the feilds below
538+
priv data: &'self T,
539+
priv token: sync::RWLockReadMode<'self>,
533540
}
534541

535542
impl<'self, T:Freeze + Send> RWWriteMode<'self, T> {

src/libextra/arena.rs

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ pub struct Arena {
6262
// The head is separated out from the list as a unbenchmarked
6363
// microoptimization, to avoid needing to case on the list to
6464
// access the head.
65+
/// no change by reedlepee all were already priv
6566
priv head: Chunk,
6667
priv pod_head: Chunk,
6768
priv chunks: @mut MutList<Chunk>,

src/libextra/base64.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ pub enum CharacterSet {
2121

2222
/// Contains configuration parameters for `to_base64`.
2323
pub struct Config {
24+
/// all were made priv by reedlepee
2425
/// Character set to use
25-
char_set: CharacterSet,
26+
priv char_set: CharacterSet,
2627
/// True to pad output with `=` characters
27-
pad: bool,
28+
priv pad: bool,
2829
/// `Some(len)` to wrap lines at `len`, `None` to disable line wrapping
29-
line_length: Option<uint>
30+
priv line_length: Option<uint>
3031
}
3132

3233
/// Configuration for RFC 4648 standard base64 encoding

src/libextra/bitv.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,11 @@ enum Op {Union, Intersect, Assign, Difference}
225225
/// The bitvector type
226226
#[deriving(Clone)]
227227
pub struct Bitv {
228+
/// all were made priv by reedlepee
228229
/// Internal representation of the bit vector (small or large)
229-
rep: BitvVariant,
230+
priv rep: BitvVariant,
230231
/// The number of valid bits in the internal representation
231-
nbits: uint
232+
priv nbits: uint
232233
}
233234

234235
fn die() -> ! {
@@ -573,6 +574,7 @@ fn iterate_bits(base: uint, bits: uint, f: &fn(uint) -> bool) -> bool {
573574

574575
/// An iterator for `Bitv`.
575576
pub struct BitvIterator<'self> {
577+
/// all were already priv
576578
priv bitv: &'self Bitv,
577579
priv next_idx: uint,
578580
priv end_idx: uint,
@@ -634,6 +636,7 @@ impl<'self> RandomAccessIterator<bool> for BitvIterator<'self> {
634636
/// as a `uint`.
635637
#[deriving(Clone)]
636638
pub struct BitvSet {
639+
// all were already priv!!
637640
priv size: uint,
638641

639642
// In theory this is a `Bitv` instead of always a `BigBitv`, but knowing that
@@ -900,6 +903,7 @@ impl BitvSet {
900903
}
901904

902905
pub struct BitvSetIterator<'self> {
906+
// all were already priv
903907
priv set: &'self BitvSet,
904908
priv next_idx: uint
905909
}

src/libextra/c_vec.rs

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ use std::util;
4444
* The type representing a foreign chunk of memory
4545
*/
4646
pub struct CVec<T> {
47+
/// No change all were allready priv!!
4748
priv base: *mut T,
4849
priv len: uint,
4950
priv rsrc: @DtorRes,

src/libextra/comm.rs

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ use std::comm;
2323

2424
/// An extension of `pipes::stream` that allows both sending and receiving.
2525
pub struct DuplexStream<T, U> {
26+
// all were already priv
2627
priv chan: Chan<T>,
2728
priv port: Port<U>,
2829
}
@@ -91,8 +92,10 @@ pub fn DuplexStream<T:Send,U:Send>()
9192
}
9293

9394
/// An extension of `pipes::stream` that provides synchronous message sending.
95+
// all were already priv
9496
pub struct SyncChan<T> { priv duplex_stream: DuplexStream<T, ()> }
9597
/// An extension of `pipes::stream` that acknowledges each message received.
98+
// all were already priv
9699
pub struct SyncPort<T> { priv duplex_stream: DuplexStream<(), T> }
97100

98101
impl<T: Send> GenericChan<T> for SyncChan<T> {

src/libextra/crypto/cryptoutil.rs

+2
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ macro_rules! impl_fixed_buffer( ($name:ident, $size:expr) => (
284284

285285
/// A fixed size buffer of 64 bytes useful for cryptographic operations.
286286
pub struct FixedBuffer64 {
287+
// already priv
287288
priv buffer: [u8, ..64],
288289
priv buffer_idx: uint,
289290
}
@@ -302,6 +303,7 @@ impl_fixed_buffer!(FixedBuffer64, 64)
302303

303304
/// A fixed size buffer of 128 bytes useful for cryptographic operations.
304305
pub struct FixedBuffer128 {
306+
// already priv
305307
priv buffer: [u8, ..128],
306308
priv buffer_idx: uint,
307309
}

src/libextra/crypto/md5.rs

+1
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ static C4: [u32, ..16] = [
159159

160160
/// The MD5 Digest algorithm
161161
pub struct Md5 {
162+
// already priv
162163
priv length_bytes: u64,
163164
priv buffer: FixedBuffer64,
164165
priv state: Md5State,

src/libextra/crypto/sha1.rs

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ static K3: u32 = 0xCA62C1D6u32;
4343

4444
/// Structure representing the state of a Sha1 computation
4545
pub struct Sha1 {
46+
// already priv
4647
priv h: [u32, ..DIGEST_BUF_LEN],
4748
priv length_bits: u64,
4849
priv buffer: FixedBuffer64,

src/libextra/crypto/sha2.rs

+6
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ impl Engine512 {
234234

235235
/// The SHA-512 hash algorithm
236236
pub struct Sha512 {
237+
// already priv
237238
priv engine: Engine512
238239
}
239240

@@ -287,6 +288,7 @@ static H512: [u64, ..8] = [
287288

288289
/// The SHA-384 hash algorithm
289290
pub struct Sha384 {
291+
// already priv
290292
priv engine: Engine512
291293
}
292294

@@ -338,6 +340,7 @@ static H384: [u64, ..8] = [
338340

339341
/// The SHA-512 hash algorithm with digest truncated to 256 bits
340342
pub struct Sha512Trunc256 {
343+
// already priv
341344
priv engine: Engine512
342345
}
343346

@@ -387,6 +390,7 @@ static H512_TRUNC_256: [u64, ..8] = [
387390

388391
/// The SHA-512 hash algorithm with digest truncated to 224 bits
389392
pub struct Sha512Trunc224 {
393+
// already priv
390394
priv engine: Engine512
391395
}
392396

@@ -643,6 +647,7 @@ impl Engine256 {
643647

644648
/// The SHA-256 hash algorithm
645649
pub struct Sha256 {
650+
// already priv
646651
priv engine: Engine256
647652
}
648653

@@ -696,6 +701,7 @@ static H256: [u32, ..8] = [
696701

697702
/// The SHA-224 hash algorithm
698703
pub struct Sha224 {
704+
// already priv
699705
priv engine: Engine256
700706
}
701707

src/libextra/dlist.rs

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ use container::Deque;
3232

3333
/// A doubly-linked list.
3434
pub struct DList<T> {
35+
// all were already priv
3536
priv length: uint,
3637
priv list_head: Link<T>,
3738
priv list_tail: Rawlink<Node<T>>,
@@ -49,13 +50,15 @@ struct Node<T> {
4950
/// Double-ended DList iterator
5051
#[deriving(Clone)]
5152
pub struct DListIterator<'self, T> {
53+
// all were already priv
5254
priv head: &'self Link<T>,
5355
priv tail: Rawlink<Node<T>>,
5456
priv nelem: uint,
5557
}
5658

5759
/// Double-ended mutable DList iterator
5860
pub struct MutDListIterator<'self, T> {
61+
// all were already priv
5962
priv list: &'self mut DList<T>,
6063
priv head: Rawlink<Node<T>>,
6164
priv tail: Rawlink<Node<T>>,
@@ -65,6 +68,7 @@ pub struct MutDListIterator<'self, T> {
6568
/// DList consuming iterator
6669
#[deriving(Clone)]
6770
pub struct MoveIterator<T> {
71+
// all were already priv
6872
priv list: DList<T>
6973
}
7074

src/libextra/ebml.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ struct EbmlState {
3030

3131
#[deriving(Clone)]
3232
pub struct Doc {
33+
// all these should be public
3334
data: @~[u8],
3435
start: uint,
3536
end: uint,
@@ -50,7 +51,9 @@ impl Doc {
5051
}
5152

5253
pub struct TaggedDoc {
53-
tag: uint,
54+
// was made privv by reedlepee
55+
priv tag: uint,
56+
// should be public
5457
doc: Doc,
5558
}
5659

@@ -284,6 +287,7 @@ pub mod reader {
284287
pub fn doc_as_i64(d: Doc) -> i64 { doc_as_u64(d) as i64 }
285288

286289
pub struct Decoder {
290+
// all were already priv
287291
priv parent: Doc,
288292
priv pos: uint,
289293
}
@@ -618,8 +622,10 @@ pub mod writer {
618622

619623
// ebml writing
620624
pub struct Encoder {
621-
writer: @io::Writer,
622-
priv size_positions: ~[uint],
625+
/// should be public!!
626+
writer: @io::Writer,
627+
/// this was already privv!!
628+
priv size_positions: ~[uint],
623629
}
624630

625631
impl Clone for Encoder {

src/libextra/enum_set.rs

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
pub struct EnumSet<E> {
1919
// We must maintain the invariant that no bits are set
2020
// for which no variant exists
21+
// all were already priv
2122
priv bits: uint
2223
}
2324

@@ -100,6 +101,7 @@ impl<E:CLike> BitAnd<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
100101

101102
/// An iterator over an EnumSet
102103
pub struct EnumSetIterator<E> {
104+
// all were already priv
103105
priv index: uint,
104106
priv bits: uint,
105107
}

src/libextra/fileinput.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,10 @@ file is `stdin`.
109109
*/
110110
#[deriving(Clone)]
111111
pub struct FileInputState {
112-
current_path: Option<Path>,
113-
line_num: uint,
114-
line_num_file: uint
112+
// all were priv made by reedlepee
113+
priv current_path: Option<Path>,
114+
priv line_num: uint,
115+
priv line_num_file: uint
115116
}
116117

117118
impl FileInputState {
@@ -155,7 +156,8 @@ struct FileInput_ {
155156
// "self.fi" -> "self." and renaming FileInput_. Documentation above
156157
// will likely have to be updated to use `let mut in = ...`.
157158
pub struct FileInput {
158-
fi: @mut FileInput_
159+
/// all were made priv by reedlepee
160+
priv fi: @mut FileInput_
159161
}
160162

161163
impl FileInput {

src/libextra/future.rs

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ use std::util::replace;
3232

3333
/// A type encapsulating the result of a computation which may not be complete
3434
pub struct Future<A> {
35+
// all were already privv!!
3536
priv state: FutureState<A>,
3637
}
3738

src/libextra/getopts.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,16 @@ pub enum Occur {
112112
/// A description of a possible option.
113113
#[deriving(Clone, Eq)]
114114
pub struct Opt {
115+
116+
/// reedlepee added priv infront of them!!
115117
/// Name of the option
116118
name: Name,
117-
/// Wheter it has an argument
119+
/// Wheter it has an argument... should be public!!
118120
hasarg: HasArg,
119-
/// How often it can occur
121+
/// How often it can occur... should be private !!
120122
occur: Occur,
121123
/// Which options it aliases
122-
aliases: ~[Opt],
124+
priv aliases: ~[Opt],
123125
}
124126

125127
/// Describes wether an option is given at all or has a value.
@@ -133,11 +135,14 @@ enum Optval {
133135
/// of matches and a vector of free strings.
134136
#[deriving(Clone, Eq)]
135137
pub struct Matches {
138+
139+
/// reedlepee added priv infront of all
136140
/// Options that matched
137-
opts: ~[Opt],
141+
priv opts: ~[Opt],
138142
/// Values of the Options that matched
139-
vals: ~[~[Optval]],
143+
priv vals: ~[~[Optval]],
140144
/// Free string fragments
145+
// public
141146
free: ~[~str]
142147
}
143148

0 commit comments

Comments
 (0)