From 40a6f250cc1a879840099f38d6d5f27e658a7344 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 9 Jun 2019 17:08:57 -0700 Subject: silence armv7 warnings --- src/armv7.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/armv7.rs b/src/armv7.rs index ab12797..e609086 100644 --- a/src/armv7.rs +++ b/src/armv7.rs @@ -13,6 +13,7 @@ impl Display for ConditionedOpcode { } } +#[allow(non_snake_case)] impl ShowContextual], T> for Instruction { fn contextualize(&self, colors: Option<&ColorSettings>, address: u32, context: Option<&[Option]>, out: &mut T) -> std::fmt::Result { match self.opcode { @@ -428,6 +429,7 @@ pub struct Instruction { pub s: bool } +#[allow(non_snake_case)] impl Instruction { pub fn blank() -> Instruction { Instruction { @@ -444,7 +446,7 @@ impl Instruction { } fn format_reg_list(f: &mut T, mut list: u16, colors: Option<&ColorSettings>) -> Result<(), std::fmt::Error> { - write!(f, "{{"); + write!(f, "{{")?; let mut i = 0; let mut tail = false; while i < 16 { @@ -455,7 +457,7 @@ fn format_reg_list(f: &mut T, mut list: u16, colors: Option< } else { tail = true; } - write!(f, "{}", reg_name_colorize(i, colors)); + write!(f, "{}", reg_name_colorize(i, colors))?; } i += 1; list >>= 1; @@ -463,6 +465,7 @@ fn format_reg_list(f: &mut T, mut list: u16, colors: Option< write!(f, "}}") } +#[allow(non_snake_case)] fn format_shift(f: &mut T, Rm: u8, shift: ShiftSpec, colors: Option<&ColorSettings>) -> Result<(), std::fmt::Error> { fn shift_tpe_to_str(tpe: u8) -> &'static str { match tpe { @@ -490,6 +493,7 @@ fn format_shift(f: &mut T, Rm: u8, shift: ShiftSpec, colors: } } +#[allow(non_snake_case)] fn format_reg_shift_mem(f: &mut T, Rd: u8, Rm: u8, shift: ShiftSpec, add: bool, pre: bool, wback: bool, colors: Option<&ColorSettings>) -> Result<(), std::fmt::Error> { let op = if add { "" } else { "-" }; @@ -514,6 +518,7 @@ fn format_reg_shift_mem(f: &mut T, Rd: u8, Rm: u8, shift: Sh } } +#[allow(non_snake_case)] fn format_reg_imm_mem(f: &mut T, Rn: u8, imm: u32, add: bool, pre: bool, wback: bool, colors: Option<&ColorSettings>) -> Result<(), std::fmt::Error> { if imm != 0 { let op = if add { "" } else { "-" }; @@ -655,6 +660,7 @@ impl ConditionCode { } } +#[allow(non_snake_case)] impl Decodable for Instruction { fn decode>(bytes: T) -> Option { let mut blank = Instruction::blank(); @@ -875,13 +881,13 @@ impl Decodable for Instruction { 0b00110 => { // self.opcode = Opcode::STRHT_sub; self.opcode = Opcode::Incomplete(word); - let imm = ((HiOffset << 4) as u16 | LoOffset as u16); + let imm = (HiOffset << 4) as u16 | LoOffset as u16; self.operands = Operands::ThreeOperandImm(Rn, Rd, imm); } 0b01110 => { // self.opcode = Opcode::STRHT_add; self.opcode = Opcode::Incomplete(word); - let imm = ((HiOffset << 4) as u16 | LoOffset as u16); + let imm = (HiOffset << 4) as u16 | LoOffset as u16; self.operands = Operands::ThreeOperandImm(Rn, Rd, imm); } _ => { -- cgit v1.1