Skip to content

Commit b2d744c

Browse files
committed
---
yaml --- r: 28157 b: refs/heads/try c: ee2ce03 h: refs/heads/master i: 28155: 65f8cc0 v: v3
1 parent cc9f41e commit b2d744c

File tree

5 files changed

+56
-42
lines changed

5 files changed

+56
-42
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
5-
refs/heads/try: aab4d6b8d73f029d178c3ac055152f57c7233995
5+
refs/heads/try: ee2ce036ccd53d8c19689d86cf8b3bd5cf37f40f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df

branches/try/src/libstd/sha1.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
export sha1;
2424

2525
/// The SHA-1 interface
26-
trait sha1 {
26+
trait Sha1 {
2727
/// Provide message input as bytes
2828
fn input((&[u8]));
2929
/// Provide message input as string
@@ -53,8 +53,8 @@ const k3: u32 = 0xCA62C1D6u32;
5353

5454

5555
/// Construct a `sha` object
56-
fn sha1() -> sha1 {
57-
type sha1state =
56+
fn sha1() -> Sha1 {
57+
type Sha1State =
5858
{h: ~[mut u32],
5959
mut len_low: u32,
6060
mut len_high: u32,
@@ -63,7 +63,7 @@ fn sha1() -> sha1 {
6363
mut computed: bool,
6464
work_buf: @~[mut u32]};
6565

66-
fn add_input(st: &sha1state, msg: &[u8]) {
66+
fn add_input(st: &Sha1State, msg: &[u8]) {
6767
assert (!st.computed);
6868
for vec::each(msg) |element| {
6969
st.msg_block[st.msg_block_idx] = element;
@@ -79,7 +79,7 @@ fn sha1() -> sha1 {
7979
if st.msg_block_idx == msg_block_len { process_msg_block(st); }
8080
}
8181
}
82-
fn process_msg_block(st: &sha1state) {
82+
fn process_msg_block(st: &Sha1State) {
8383
assert (vec::len(st.h) == digest_buf_len);
8484
assert (vec::len(*st.work_buf) == work_buf_len);
8585
let mut t: int; // Loop counter
@@ -158,7 +158,7 @@ fn sha1() -> sha1 {
158158
fn circular_shift(bits: u32, word: u32) -> u32 {
159159
return word << bits | word >> 32u32 - bits;
160160
}
161-
fn mk_result(st: &sha1state) -> ~[u8] {
161+
fn mk_result(st: &Sha1State) -> ~[u8] {
162162
if !(*st).computed { pad_msg(st); (*st).computed = true; }
163163
let mut rs: ~[u8] = ~[];
164164
for vec::each_mut((*st).h) |ptr_hpart| {
@@ -181,7 +181,7 @@ fn sha1() -> sha1 {
181181
* call process_msg_block() appropriately. When it returns, it
182182
* can be assumed that the message digest has been computed.
183183
*/
184-
fn pad_msg(st: &sha1state) {
184+
fn pad_msg(st: &Sha1State) {
185185
assert (vec::len((*st).msg_block) == msg_block_len);
186186

187187
/*
@@ -218,7 +218,7 @@ fn sha1() -> sha1 {
218218
process_msg_block(st);
219219
}
220220

221-
impl sha1state: sha1 {
221+
impl Sha1State: Sha1 {
222222
fn reset() {
223223
assert (vec::len(self.h) == digest_buf_len);
224224
self.len_low = 0u32;
@@ -253,7 +253,7 @@ fn sha1() -> sha1 {
253253
mut computed: false,
254254
work_buf: @vec::to_mut(vec::from_elem(work_buf_len, 0u32))
255255
};
256-
let sh = st as sha1;
256+
let sh = st as Sha1;
257257
sh.reset();
258258
return sh;
259259
}
@@ -263,7 +263,7 @@ mod tests {
263263

264264
#[test]
265265
fn test() unsafe {
266-
type test = {input: ~str, output: ~[u8]};
266+
type Test = {input: ~str, output: ~[u8]};
267267

268268
fn a_million_letter_a() -> ~str {
269269
let mut i = 0;
@@ -273,7 +273,7 @@ mod tests {
273273
}
274274
// Test messages from FIPS 180-1
275275

276-
let fips_180_1_tests: ~[test] =
276+
let fips_180_1_tests: ~[Test] =
277277
~[{input: ~"abc",
278278
output:
279279
~[0xA9u8, 0x99u8, 0x3Eu8, 0x36u8,
@@ -299,7 +299,7 @@ mod tests {
299299
0x65u8, 0x34u8, 0x01u8, 0x6Fu8]}];
300300
// Examples from wikipedia
301301

302-
let wikipedia_tests: ~[test] =
302+
let wikipedia_tests: ~[Test] =
303303
~[{input: ~"The quick brown fox jumps over the lazy dog",
304304
output:
305305
~[0x2fu8, 0xd4u8, 0xe1u8, 0xc6u8,

branches/try/src/libstd/std.rc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,33 @@ mod treemap;
7070

7171
// And ... other stuff
7272

73+
#[warn(non_camel_case_types)]
7374
mod ebml;
75+
#[warn(non_camel_case_types)]
7476
mod dbg;
77+
#[warn(non_camel_case_types)]
7578
mod getopts;
79+
#[warn(non_camel_case_types)]
7680
mod json;
81+
#[warn(non_camel_case_types)]
7782
mod sha1;
83+
#[warn(non_camel_case_types)]
7884
mod md4;
85+
#[warn(non_camel_case_types)]
7986
mod tempfile;
87+
#[warn(non_camel_case_types)]
8088
mod term;
89+
#[warn(non_camel_case_types)]
8190
mod time;
91+
#[warn(non_camel_case_types)]
8292
mod prettyprint;
93+
#[warn(non_camel_case_types)]
8394
mod arena;
95+
#[warn(non_camel_case_types)]
8496
mod par;
97+
#[warn(non_camel_case_types)]
8598
mod cmp;
99+
#[warn(non_camel_case_types)]
86100
mod base64;
87101

88102
#[cfg(unicode)]

branches/try/src/libstd/time.rs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import io::Reader;
66
import result::{Result, Ok, Err};
77

88
export
9-
timespec,
9+
Timespec,
1010
get_time,
1111
precise_time_ns,
1212
precise_time_s,
1313
tzset,
14-
tm,
14+
Tm,
1515
empty_tm,
1616
now,
1717
at,
@@ -26,20 +26,20 @@ extern mod rustrt {
2626

2727
fn rust_tzset();
2828
// FIXME: The i64 values can be passed by-val when #2064 is fixed.
29-
fn rust_gmtime(&&sec: i64, &&nsec: i32, &&result: tm);
30-
fn rust_localtime(&&sec: i64, &&nsec: i32, &&result: tm);
31-
fn rust_timegm(&&tm: tm, &sec: i64);
32-
fn rust_mktime(&&tm: tm, &sec: i64);
29+
fn rust_gmtime(&&sec: i64, &&nsec: i32, &&result: Tm);
30+
fn rust_localtime(&&sec: i64, &&nsec: i32, &&result: Tm);
31+
fn rust_timegm(&&tm: Tm, &sec: i64);
32+
fn rust_mktime(&&tm: Tm, &sec: i64);
3333
}
3434

3535
/// A record specifying a time value in seconds and nanoseconds.
36-
type timespec = {sec: i64, nsec: i32};
36+
type Timespec = {sec: i64, nsec: i32};
3737

3838
/**
3939
* Returns the current time as a `timespec` containing the seconds and
4040
* nanoseconds since 1970-01-01T00:00:00Z.
4141
*/
42-
fn get_time() -> timespec {
42+
fn get_time() -> Timespec {
4343
let mut sec = 0i64;
4444
let mut nsec = 0i32;
4545
rustrt::get_time(sec, nsec);
@@ -68,7 +68,7 @@ fn tzset() {
6868
rustrt::rust_tzset();
6969
}
7070

71-
type tm_ = {
71+
type Tm_ = {
7272
tm_sec: i32, // seconds after the minute ~[0-60]
7373
tm_min: i32, // minutes after the hour ~[0-59]
7474
tm_hour: i32, // hours after midnight ~[0-23]
@@ -83,12 +83,12 @@ type tm_ = {
8383
tm_nsec: i32, // nanoseconds
8484
};
8585

86-
enum tm {
87-
tm_(tm_)
86+
enum Tm {
87+
Tm_(Tm_)
8888
}
8989

90-
fn empty_tm() -> tm {
91-
tm_({
90+
fn empty_tm() -> Tm {
91+
Tm_({
9292
tm_sec: 0_i32,
9393
tm_min: 0_i32,
9494
tm_hour: 0_i32,
@@ -105,34 +105,34 @@ fn empty_tm() -> tm {
105105
}
106106

107107
/// Returns the specified time in UTC
108-
fn at_utc(clock: timespec) -> tm {
108+
fn at_utc(clock: Timespec) -> Tm {
109109
let mut {sec, nsec} = clock;
110110
let mut tm = empty_tm();
111111
rustrt::rust_gmtime(sec, nsec, tm);
112112
tm
113113
}
114114

115115
/// Returns the current time in UTC
116-
fn now_utc() -> tm {
116+
fn now_utc() -> Tm {
117117
at_utc(get_time())
118118
}
119119

120120
/// Returns the specified time in the local timezone
121-
fn at(clock: timespec) -> tm {
121+
fn at(clock: Timespec) -> Tm {
122122
let mut {sec, nsec} = clock;
123123
let mut tm = empty_tm();
124124
rustrt::rust_localtime(sec, nsec, tm);
125125
tm
126126
}
127127

128128
/// Returns the current time in the local timezone
129-
fn now() -> tm {
129+
fn now() -> Tm {
130130
at(get_time())
131131
}
132132

133133
/// Parses the time from the string according to the format string.
134-
fn strptime(s: &str, format: &str) -> Result<tm, ~str> {
135-
type tm_mut = {
134+
fn strptime(s: &str, format: &str) -> Result<Tm, ~str> {
135+
type TmMut = {
136136
mut tm_sec: i32,
137137
mut tm_min: i32,
138138
mut tm_hour: i32,
@@ -209,7 +209,7 @@ fn strptime(s: &str, format: &str) -> Result<tm, ~str> {
209209
}
210210
}
211211

212-
fn parse_type(s: &str, pos: uint, ch: char, tm: &tm_mut)
212+
fn parse_type(s: &str, pos: uint, ch: char, tm: &TmMut)
213213
-> Result<uint, ~str> {
214214
match ch {
215215
'A' => match match_strs(s, pos, ~[
@@ -554,7 +554,7 @@ fn strptime(s: &str, format: &str) -> Result<tm, ~str> {
554554
}
555555

556556
if pos == len && rdr.eof() {
557-
Ok(tm_({
557+
Ok(Tm_({
558558
tm_sec: tm.tm_sec,
559559
tm_min: tm.tm_min,
560560
tm_hour: tm.tm_hour,
@@ -572,8 +572,8 @@ fn strptime(s: &str, format: &str) -> Result<tm, ~str> {
572572
}
573573
}
574574

575-
fn strftime(format: &str, +tm: tm) -> ~str {
576-
fn parse_type(ch: char, tm: &tm) -> ~str {
575+
fn strftime(format: &str, +tm: Tm) -> ~str {
576+
fn parse_type(ch: char, tm: &Tm) -> ~str {
577577
//FIXME (#2350): Implement missing types.
578578
let die = || #fmt("strftime: can't understand this format %c ",
579579
ch);
@@ -740,9 +740,9 @@ fn strftime(format: &str, +tm: tm) -> ~str {
740740
buf
741741
}
742742

743-
impl tm {
743+
impl Tm {
744744
/// Convert time to the seconds from January 1, 1970
745-
fn to_timespec() -> timespec {
745+
fn to_timespec() -> Timespec {
746746
let mut sec = 0i64;
747747
if self.tm_gmtoff == 0_i32 {
748748
rustrt::rust_timegm(self, sec);
@@ -753,12 +753,12 @@ impl tm {
753753
}
754754

755755
/// Convert time to the local timezone
756-
fn to_local() -> tm {
756+
fn to_local() -> Tm {
757757
at(self.to_timespec())
758758
}
759759

760760
/// Convert time to the UTC
761-
fn to_utc() -> tm {
761+
fn to_utc() -> Tm {
762762
at_utc(self.to_timespec())
763763
}
764764

branches/try/src/rustc/middle/trans/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ fn get_dest_addr(dest: dest) -> ValueRef {
168168
}
169169
}
170170

171-
fn log_fn_time(ccx: @crate_ctxt, name: ~str, start: time::timespec,
172-
end: time::timespec) {
171+
fn log_fn_time(ccx: @crate_ctxt, name: ~str, start: time::Timespec,
172+
end: time::Timespec) {
173173
let elapsed = 1000 * ((end.sec - start.sec) as int) +
174174
((end.nsec as int) - (start.nsec as int)) / 1000000;
175175
vec::push(*ccx.stats.fn_times, {ident: name, time: elapsed});

0 commit comments

Comments
 (0)