aboutsummaryrefslogtreecommitdiff
path: root/src/display.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2019-05-29 00:07:31 -0700
committeriximeow <me@iximeow.net>2020-01-12 16:10:13 -0800
commitaa79e826869a7fed8df6b4f7e7a7503565659f89 (patch)
tree8af668e7706ac22477cf7df67ba5cb47eaf607b3 /src/display.rs
parent09df8f120f23d733df2171b4b3e2380b6889cf3c (diff)
fix some warnings and rdtsc/swapgs decode errors
Diffstat (limited to 'src/display.rs')
-rw-r--r--src/display.rs20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/display.rs b/src/display.rs
index 76db507..dfddeca 100644
--- a/src/display.rs
+++ b/src/display.rs
@@ -1,13 +1,9 @@
extern crate yaxpeax_arch;
extern crate termion;
-use termion::color;
-
use std::fmt;
-use std::hint::unreachable_unchecked;
-
-use yaxpeax_arch::{Arch, Colorize, ColorSettings, Decodable, LengthedInstruction, ShowContextual, YaxColors};
+use yaxpeax_arch::{Colorize, ColorSettings, ShowContextual, YaxColors};
use yaxpeax_arch::display::*;
use ::{RegSpec, RegisterBank, Opcode, Operand, Instruction, Segment};
@@ -545,7 +541,7 @@ impl <T: std::fmt::Write> Colorize<T> for Instruction {
}
impl <T: std::fmt::Write> ShowContextual<u64, [Option<String>], T> for Instruction {
- fn contextualize(&self, colors: Option<&ColorSettings>, address: u64, context: Option<&[Option<String>]>, out: &mut T) -> std::fmt::Result {
+ fn contextualize(&self, colors: Option<&ColorSettings>, _address: u64, context: Option<&[Option<String>]>, out: &mut T) -> std::fmt::Result {
if self.prefixes.lock {
write!(out, "lock ")?;
}
@@ -561,7 +557,7 @@ impl <T: std::fmt::Write> ShowContextual<u64, [Option<String>], T> for Instructi
ref x @ _ => {
write!(out, " ")?;
if let Some(prefix) = self.segment_override_for_op(0) {
- write!(out, "{}:", prefix);
+ write!(out, "{}:", prefix)?;
}
x.colorize(colors, out)?;
}
@@ -580,14 +576,14 @@ impl <T: std::fmt::Write> ShowContextual<u64, [Option<String>], T> for Instructi
x @ &Operand::Register(_) => {
write!(out, ", ")?;
if let Some(prefix) = self.segment_override_for_op(1) {
- write!(out, "{}:", prefix);
+ write!(out, "{}:", prefix)?;
}
x.colorize(colors, out)
}
x @ _ => {
write!(out, ", byte ")?;
if let Some(prefix) = self.segment_override_for_op(1) {
- write!(out, "{}:", prefix);
+ write!(out, "{}:", prefix)?;
}
x.colorize(colors, out)
}
@@ -606,14 +602,14 @@ impl <T: std::fmt::Write> ShowContextual<u64, [Option<String>], T> for Instructi
x @ &Operand::Register(_) => {
write!(out, ", ")?;
if let Some(prefix) = self.segment_override_for_op(1) {
- write!(out, "{}:", prefix);
+ write!(out, "{}:", prefix)?;
}
x.colorize(colors, out)
}
x @ _ => {
write!(out, ", word ")?;
if let Some(prefix) = self.segment_override_for_op(1) {
- write!(out, "{}:", prefix);
+ write!(out, "{}:", prefix)?;
}
x.colorize(colors, out)
}
@@ -632,7 +628,7 @@ impl <T: std::fmt::Write> ShowContextual<u64, [Option<String>], T> for Instructi
x @ _ => {
write!(out, ", ")?;
if let Some(prefix) = self.segment_override_for_op(1) {
- write!(out, "{}:", prefix);
+ write!(out, "{}:", prefix)?;
}
x.colorize(colors, out)
}