Rename struct fields with uppercase characters in their names to use lowercase

This commit is contained in:
Palmer Cox 2014-02-16 01:02:31 -05:00
parent 935c912335
commit a9798c25df
8 changed files with 68 additions and 68 deletions

View file

@ -1868,20 +1868,20 @@ impl TypeNames {
/* Memory-managed interface to target data. */
pub struct target_data_res {
TD: TargetDataRef,
td: TargetDataRef,
}
impl Drop for target_data_res {
fn drop(&mut self) {
unsafe {
llvm::LLVMDisposeTargetData(self.TD);
llvm::LLVMDisposeTargetData(self.td);
}
}
}
pub fn target_data_res(td: TargetDataRef) -> target_data_res {
target_data_res {
TD: td
td: td
}
}
@ -1904,20 +1904,20 @@ pub fn mk_target_data(string_rep: &str) -> TargetData {
/* Memory-managed interface to pass managers. */
pub struct pass_manager_res {
PM: PassManagerRef,
pm: PassManagerRef,
}
impl Drop for pass_manager_res {
fn drop(&mut self) {
unsafe {
llvm::LLVMDisposePassManager(self.PM);
llvm::LLVMDisposePassManager(self.pm);
}
}
}
pub fn pass_manager_res(pm: PassManagerRef) -> pass_manager_res {
pass_manager_res {
PM: pm
pm: pm
}
}
@ -1971,20 +1971,20 @@ impl Drop for ObjectFile {
/* Memory-managed interface to section iterators. */
pub struct section_iter_res {
SI: SectionIteratorRef,
si: SectionIteratorRef,
}
impl Drop for section_iter_res {
fn drop(&mut self) {
unsafe {
llvm::LLVMDisposeSectionIterator(self.SI);
llvm::LLVMDisposeSectionIterator(self.si);
}
}
}
pub fn section_iter_res(si: SectionIteratorRef) -> section_iter_res {
section_iter_res {
SI: si
si: si
}
}

View file

@ -1853,7 +1853,7 @@ pub fn create_entry_wrapper(ccx: @CrateContext,
llvm::LLVMAppendBasicBlockInContext(ccx.llcx, llfn, buf)
}
});
let bld = ccx.builder.B;
let bld = ccx.builder.b;
unsafe {
llvm::LLVMPositionBuilderAtEnd(bld, llbb);

View file

@ -36,7 +36,7 @@ pub fn noname() -> *c_char {
impl<'a> Builder<'a> {
pub fn new(ccx: &'a CrateContext) -> Builder<'a> {
Builder {
llbuilder: ccx.builder.B,
llbuilder: ccx.builder.b,
ccx: ccx,
}
}

View file

@ -164,20 +164,20 @@ pub struct Stats {
}
pub struct BuilderRef_res {
B: BuilderRef,
b: BuilderRef,
}
impl Drop for BuilderRef_res {
fn drop(&mut self) {
unsafe {
llvm::LLVMDisposeBuilder(self.B);
llvm::LLVMDisposeBuilder(self.b);
}
}
}
pub fn BuilderRef_res(b: BuilderRef) -> BuilderRef_res {
BuilderRef_res {
B: b
b: b
}
}

View file

@ -2171,7 +2171,7 @@ fn set_debug_location(cx: &CrateContext, debug_location: DebugLocation) {
};
unsafe {
llvm::LLVMSetCurrentDebugLocation(cx.builder.B, metadata_node);
llvm::LLVMSetCurrentDebugLocation(cx.builder.b, metadata_node);
}
debug_context(cx).current_debug_location.set(debug_location);

View file

@ -499,7 +499,7 @@ pub fn trans_rust_fn_with_foreign_abi(ccx: @CrateContext,
"the block".with_c_str(
|s| llvm::LLVMAppendBasicBlockInContext(ccx.llcx, llwrapfn, s));
let builder = ccx.builder.B;
let builder = ccx.builder.b;
llvm::LLVMPositionBuilderAtEnd(builder, the_block);
// Array for the arguments we will pass to the rust function.

View file

@ -269,39 +269,39 @@ pub trait Digest {
// A structure that represents that state of a digest computation for the SHA-2 512 family of digest
// functions
struct Engine256State {
H0: u32,
H1: u32,
H2: u32,
H3: u32,
H4: u32,
H5: u32,
H6: u32,
H7: u32,
h0: u32,
h1: u32,
h2: u32,
h3: u32,
h4: u32,
h5: u32,
h6: u32,
h7: u32,
}
impl Engine256State {
fn new(h: &[u32, ..8]) -> Engine256State {
return Engine256State {
H0: h[0],
H1: h[1],
H2: h[2],
H3: h[3],
H4: h[4],
H5: h[5],
H6: h[6],
H7: h[7]
h0: h[0],
h1: h[1],
h2: h[2],
h3: h[3],
h4: h[4],
h5: h[5],
h6: h[6],
h7: h[7]
};
}
fn reset(&mut self, h: &[u32, ..8]) {
self.H0 = h[0];
self.H1 = h[1];
self.H2 = h[2];
self.H3 = h[3];
self.H4 = h[4];
self.H5 = h[5];
self.H6 = h[6];
self.H7 = h[7];
self.h0 = h[0];
self.h1 = h[1];
self.h2 = h[2];
self.h3 = h[3];
self.h4 = h[4];
self.h5 = h[5];
self.h6 = h[6];
self.h7 = h[7];
}
fn process_block(&mut self, data: &[u8]) {
@ -329,14 +329,14 @@ impl Engine256State {
((x >> 17) | (x << 15)) ^ ((x >> 19) | (x << 13)) ^ (x >> 10)
}
let mut a = self.H0;
let mut b = self.H1;
let mut c = self.H2;
let mut d = self.H3;
let mut e = self.H4;
let mut f = self.H5;
let mut g = self.H6;
let mut h = self.H7;
let mut a = self.h0;
let mut b = self.h1;
let mut c = self.h2;
let mut d = self.h3;
let mut e = self.h4;
let mut f = self.h5;
let mut g = self.h6;
let mut h = self.h7;
let mut w = [0u32, ..64];
@ -393,14 +393,14 @@ impl Engine256State {
sha2_round!(b, c, d, e, f, g, h, a, K32, t + 7);
}
self.H0 += a;
self.H1 += b;
self.H2 += c;
self.H3 += d;
self.H4 += e;
self.H5 += f;
self.H6 += g;
self.H7 += h;
self.h0 += a;
self.h1 += b;
self.h2 += c;
self.h3 += d;
self.h4 += e;
self.h5 += f;
self.h6 += g;
self.h7 += h;
}
}
@ -494,14 +494,14 @@ impl Digest for Sha256 {
fn result(&mut self, out: &mut [u8]) {
self.engine.finish();
write_u32_be(out.mut_slice(0, 4), self.engine.state.H0);
write_u32_be(out.mut_slice(4, 8), self.engine.state.H1);
write_u32_be(out.mut_slice(8, 12), self.engine.state.H2);
write_u32_be(out.mut_slice(12, 16), self.engine.state.H3);
write_u32_be(out.mut_slice(16, 20), self.engine.state.H4);
write_u32_be(out.mut_slice(20, 24), self.engine.state.H5);
write_u32_be(out.mut_slice(24, 28), self.engine.state.H6);
write_u32_be(out.mut_slice(28, 32), self.engine.state.H7);
write_u32_be(out.mut_slice(0, 4), self.engine.state.h0);
write_u32_be(out.mut_slice(4, 8), self.engine.state.h1);
write_u32_be(out.mut_slice(8, 12), self.engine.state.h2);
write_u32_be(out.mut_slice(12, 16), self.engine.state.h3);
write_u32_be(out.mut_slice(16, 20), self.engine.state.h4);
write_u32_be(out.mut_slice(20, 24), self.engine.state.h5);
write_u32_be(out.mut_slice(24, 28), self.engine.state.h6);
write_u32_be(out.mut_slice(28, 32), self.engine.state.h7);
}
fn reset(&mut self) {

View file

@ -36,7 +36,7 @@ impl UdpSocket {
}
pub fn connect(self, other: SocketAddr) -> UdpStream {
UdpStream { socket: self, connectedTo: other }
UdpStream { socket: self, connected_to: other }
}
pub fn socket_name(&mut self) -> IoResult<SocketAddr> {
@ -59,7 +59,7 @@ impl Clone for UdpSocket {
pub struct UdpStream {
priv socket: UdpSocket,
priv connectedTo: SocketAddr
priv connected_to: SocketAddr
}
impl UdpStream {
@ -72,7 +72,7 @@ impl UdpStream {
impl Reader for UdpStream {
fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> {
let peer = self.connectedTo;
let peer = self.connected_to;
self.as_socket(|sock| {
match sock.recvfrom(buf) {
Ok((_nread, src)) if src != peer => Ok(0),
@ -85,7 +85,7 @@ impl Reader for UdpStream {
impl Writer for UdpStream {
fn write(&mut self, buf: &[u8]) -> IoResult<()> {
let connected_to = self.connectedTo;
let connected_to = self.connected_to;
self.as_socket(|sock| sock.sendto(buf, connected_to))
}
}