Skip to content

Commit a9798c2

Browse files
author
Palmer Cox
committed
Rename struct fields with uppercase characters in their names to use lowercase
1 parent 935c912 commit a9798c2

File tree

8 files changed

+68
-68
lines changed

8 files changed

+68
-68
lines changed

src/librustc/lib/llvm.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,20 +1868,20 @@ impl TypeNames {
18681868
/* Memory-managed interface to target data. */
18691869

18701870
pub struct target_data_res {
1871-
TD: TargetDataRef,
1871+
td: TargetDataRef,
18721872
}
18731873

18741874
impl Drop for target_data_res {
18751875
fn drop(&mut self) {
18761876
unsafe {
1877-
llvm::LLVMDisposeTargetData(self.TD);
1877+
llvm::LLVMDisposeTargetData(self.td);
18781878
}
18791879
}
18801880
}
18811881

18821882
pub fn target_data_res(td: TargetDataRef) -> target_data_res {
18831883
target_data_res {
1884-
TD: td
1884+
td: td
18851885
}
18861886
}
18871887

@@ -1904,20 +1904,20 @@ pub fn mk_target_data(string_rep: &str) -> TargetData {
19041904
/* Memory-managed interface to pass managers. */
19051905

19061906
pub struct pass_manager_res {
1907-
PM: PassManagerRef,
1907+
pm: PassManagerRef,
19081908
}
19091909

19101910
impl Drop for pass_manager_res {
19111911
fn drop(&mut self) {
19121912
unsafe {
1913-
llvm::LLVMDisposePassManager(self.PM);
1913+
llvm::LLVMDisposePassManager(self.pm);
19141914
}
19151915
}
19161916
}
19171917

19181918
pub fn pass_manager_res(pm: PassManagerRef) -> pass_manager_res {
19191919
pass_manager_res {
1920-
PM: pm
1920+
pm: pm
19211921
}
19221922
}
19231923

@@ -1971,20 +1971,20 @@ impl Drop for ObjectFile {
19711971
/* Memory-managed interface to section iterators. */
19721972

19731973
pub struct section_iter_res {
1974-
SI: SectionIteratorRef,
1974+
si: SectionIteratorRef,
19751975
}
19761976

19771977
impl Drop for section_iter_res {
19781978
fn drop(&mut self) {
19791979
unsafe {
1980-
llvm::LLVMDisposeSectionIterator(self.SI);
1980+
llvm::LLVMDisposeSectionIterator(self.si);
19811981
}
19821982
}
19831983
}
19841984

19851985
pub fn section_iter_res(si: SectionIteratorRef) -> section_iter_res {
19861986
section_iter_res {
1987-
SI: si
1987+
si: si
19881988
}
19891989
}
19901990

src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1853,7 +1853,7 @@ pub fn create_entry_wrapper(ccx: @CrateContext,
18531853
llvm::LLVMAppendBasicBlockInContext(ccx.llcx, llfn, buf)
18541854
}
18551855
});
1856-
let bld = ccx.builder.B;
1856+
let bld = ccx.builder.b;
18571857
unsafe {
18581858
llvm::LLVMPositionBuilderAtEnd(bld, llbb);
18591859

src/librustc/middle/trans/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub fn noname() -> *c_char {
3636
impl<'a> Builder<'a> {
3737
pub fn new(ccx: &'a CrateContext) -> Builder<'a> {
3838
Builder {
39-
llbuilder: ccx.builder.B,
39+
llbuilder: ccx.builder.b,
4040
ccx: ccx,
4141
}
4242
}

src/librustc/middle/trans/common.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,20 +164,20 @@ pub struct Stats {
164164
}
165165

166166
pub struct BuilderRef_res {
167-
B: BuilderRef,
167+
b: BuilderRef,
168168
}
169169

170170
impl Drop for BuilderRef_res {
171171
fn drop(&mut self) {
172172
unsafe {
173-
llvm::LLVMDisposeBuilder(self.B);
173+
llvm::LLVMDisposeBuilder(self.b);
174174
}
175175
}
176176
}
177177

178178
pub fn BuilderRef_res(b: BuilderRef) -> BuilderRef_res {
179179
BuilderRef_res {
180-
B: b
180+
b: b
181181
}
182182
}
183183

src/librustc/middle/trans/debuginfo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2171,7 +2171,7 @@ fn set_debug_location(cx: &CrateContext, debug_location: DebugLocation) {
21712171
};
21722172

21732173
unsafe {
2174-
llvm::LLVMSetCurrentDebugLocation(cx.builder.B, metadata_node);
2174+
llvm::LLVMSetCurrentDebugLocation(cx.builder.b, metadata_node);
21752175
}
21762176

21772177
debug_context(cx).current_debug_location.set(debug_location);

src/librustc/middle/trans/foreign.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ pub fn trans_rust_fn_with_foreign_abi(ccx: @CrateContext,
499499
"the block".with_c_str(
500500
|s| llvm::LLVMAppendBasicBlockInContext(ccx.llcx, llwrapfn, s));
501501

502-
let builder = ccx.builder.B;
502+
let builder = ccx.builder.b;
503503
llvm::LLVMPositionBuilderAtEnd(builder, the_block);
504504

505505
// Array for the arguments we will pass to the rust function.

src/librustc/util/sha2.rs

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -269,39 +269,39 @@ pub trait Digest {
269269
// A structure that represents that state of a digest computation for the SHA-2 512 family of digest
270270
// functions
271271
struct Engine256State {
272-
H0: u32,
273-
H1: u32,
274-
H2: u32,
275-
H3: u32,
276-
H4: u32,
277-
H5: u32,
278-
H6: u32,
279-
H7: u32,
272+
h0: u32,
273+
h1: u32,
274+
h2: u32,
275+
h3: u32,
276+
h4: u32,
277+
h5: u32,
278+
h6: u32,
279+
h7: u32,
280280
}
281281

282282
impl Engine256State {
283283
fn new(h: &[u32, ..8]) -> Engine256State {
284284
return Engine256State {
285-
H0: h[0],
286-
H1: h[1],
287-
H2: h[2],
288-
H3: h[3],
289-
H4: h[4],
290-
H5: h[5],
291-
H6: h[6],
292-
H7: h[7]
285+
h0: h[0],
286+
h1: h[1],
287+
h2: h[2],
288+
h3: h[3],
289+
h4: h[4],
290+
h5: h[5],
291+
h6: h[6],
292+
h7: h[7]
293293
};
294294
}
295295

296296
fn reset(&mut self, h: &[u32, ..8]) {
297-
self.H0 = h[0];
298-
self.H1 = h[1];
299-
self.H2 = h[2];
300-
self.H3 = h[3];
301-
self.H4 = h[4];
302-
self.H5 = h[5];
303-
self.H6 = h[6];
304-
self.H7 = h[7];
297+
self.h0 = h[0];
298+
self.h1 = h[1];
299+
self.h2 = h[2];
300+
self.h3 = h[3];
301+
self.h4 = h[4];
302+
self.h5 = h[5];
303+
self.h6 = h[6];
304+
self.h7 = h[7];
305305
}
306306

307307
fn process_block(&mut self, data: &[u8]) {
@@ -329,14 +329,14 @@ impl Engine256State {
329329
((x >> 17) | (x << 15)) ^ ((x >> 19) | (x << 13)) ^ (x >> 10)
330330
}
331331

332-
let mut a = self.H0;
333-
let mut b = self.H1;
334-
let mut c = self.H2;
335-
let mut d = self.H3;
336-
let mut e = self.H4;
337-
let mut f = self.H5;
338-
let mut g = self.H6;
339-
let mut h = self.H7;
332+
let mut a = self.h0;
333+
let mut b = self.h1;
334+
let mut c = self.h2;
335+
let mut d = self.h3;
336+
let mut e = self.h4;
337+
let mut f = self.h5;
338+
let mut g = self.h6;
339+
let mut h = self.h7;
340340

341341
let mut w = [0u32, ..64];
342342

@@ -393,14 +393,14 @@ impl Engine256State {
393393
sha2_round!(b, c, d, e, f, g, h, a, K32, t + 7);
394394
}
395395

396-
self.H0 += a;
397-
self.H1 += b;
398-
self.H2 += c;
399-
self.H3 += d;
400-
self.H4 += e;
401-
self.H5 += f;
402-
self.H6 += g;
403-
self.H7 += h;
396+
self.h0 += a;
397+
self.h1 += b;
398+
self.h2 += c;
399+
self.h3 += d;
400+
self.h4 += e;
401+
self.h5 += f;
402+
self.h6 += g;
403+
self.h7 += h;
404404
}
405405
}
406406

@@ -494,14 +494,14 @@ impl Digest for Sha256 {
494494
fn result(&mut self, out: &mut [u8]) {
495495
self.engine.finish();
496496

497-
write_u32_be(out.mut_slice(0, 4), self.engine.state.H0);
498-
write_u32_be(out.mut_slice(4, 8), self.engine.state.H1);
499-
write_u32_be(out.mut_slice(8, 12), self.engine.state.H2);
500-
write_u32_be(out.mut_slice(12, 16), self.engine.state.H3);
501-
write_u32_be(out.mut_slice(16, 20), self.engine.state.H4);
502-
write_u32_be(out.mut_slice(20, 24), self.engine.state.H5);
503-
write_u32_be(out.mut_slice(24, 28), self.engine.state.H6);
504-
write_u32_be(out.mut_slice(28, 32), self.engine.state.H7);
497+
write_u32_be(out.mut_slice(0, 4), self.engine.state.h0);
498+
write_u32_be(out.mut_slice(4, 8), self.engine.state.h1);
499+
write_u32_be(out.mut_slice(8, 12), self.engine.state.h2);
500+
write_u32_be(out.mut_slice(12, 16), self.engine.state.h3);
501+
write_u32_be(out.mut_slice(16, 20), self.engine.state.h4);
502+
write_u32_be(out.mut_slice(20, 24), self.engine.state.h5);
503+
write_u32_be(out.mut_slice(24, 28), self.engine.state.h6);
504+
write_u32_be(out.mut_slice(28, 32), self.engine.state.h7);
505505
}
506506

507507
fn reset(&mut self) {

src/libstd/io/net/udp.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl UdpSocket {
3636
}
3737

3838
pub fn connect(self, other: SocketAddr) -> UdpStream {
39-
UdpStream { socket: self, connectedTo: other }
39+
UdpStream { socket: self, connected_to: other }
4040
}
4141

4242
pub fn socket_name(&mut self) -> IoResult<SocketAddr> {
@@ -59,7 +59,7 @@ impl Clone for UdpSocket {
5959

6060
pub struct UdpStream {
6161
priv socket: UdpSocket,
62-
priv connectedTo: SocketAddr
62+
priv connected_to: SocketAddr
6363
}
6464

6565
impl UdpStream {
@@ -72,7 +72,7 @@ impl UdpStream {
7272

7373
impl Reader for UdpStream {
7474
fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> {
75-
let peer = self.connectedTo;
75+
let peer = self.connected_to;
7676
self.as_socket(|sock| {
7777
match sock.recvfrom(buf) {
7878
Ok((_nread, src)) if src != peer => Ok(0),
@@ -85,7 +85,7 @@ impl Reader for UdpStream {
8585

8686
impl Writer for UdpStream {
8787
fn write(&mut self, buf: &[u8]) -> IoResult<()> {
88-
let connected_to = self.connectedTo;
88+
let connected_to = self.connected_to;
8989
self.as_socket(|sock| sock.sendto(buf, connected_to))
9090
}
9191
}

0 commit comments

Comments
 (0)