aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2020-05-03 13:38:08 -0700
committeriximeow <me@iximeow.net>2020-05-03 13:38:08 -0700
commit79388a4ff09fe21d31fe41a68e59a92263c2eea5 (patch)
treee618817ad8ae68ddb34239140a3a85029b6d259c /src
parenta68d0b05cc05ec4a390fa25a6dd199d189cd1e38 (diff)
bump yaxpeax-arch to 0.0.4, use AddressDiff, fix warnings in ffi
Diffstat (limited to 'src')
-rw-r--r--src/long_mode/mod.rs12
-rw-r--r--src/protected_mode/mod.rs12
2 files changed, 12 insertions, 12 deletions
diff --git a/src/long_mode/mod.rs b/src/long_mode/mod.rs
index a18a62c..b5920c5 100644
--- a/src/long_mode/mod.rs
+++ b/src/long_mode/mod.rs
@@ -3,7 +3,7 @@ mod display;
use core::hint::unreachable_unchecked;
-use yaxpeax_arch::{Decoder, LengthedInstruction};
+use yaxpeax_arch::{AddressDiff, Decoder, LengthedInstruction};
#[cfg(feature="use-serde")]
#[derive(Copy, Clone, Debug, PartialOrd, Ord, Eq, PartialEq, Serialize, Deserialize)]
@@ -1325,12 +1325,12 @@ impl yaxpeax_arch::Arch for Arch {
}
impl LengthedInstruction for Instruction {
- type Unit = u64;
- fn len(&self) -> u64 {
- self.length.into()
+ type Unit = AddressDiff<u64>;
+ fn len(&self) -> Self::Unit {
+ AddressDiff::from_const(self.length.into())
}
- fn min_size() -> u64 {
- 1
+ fn min_size() -> Self::Unit {
+ AddressDiff::from_const(1)
}
}
diff --git a/src/protected_mode/mod.rs b/src/protected_mode/mod.rs
index 4405cc8..3370aaa 100644
--- a/src/protected_mode/mod.rs
+++ b/src/protected_mode/mod.rs
@@ -3,7 +3,7 @@ mod display;
use core::hint::unreachable_unchecked;
-use yaxpeax_arch::{Decoder, LengthedInstruction};
+use yaxpeax_arch::{AddressDiff, Decoder, LengthedInstruction};
#[cfg(feature="use-serde")]
#[derive(Copy, Clone, Debug, PartialOrd, Ord, Eq, PartialEq, Serialize, Deserialize)]
@@ -1311,12 +1311,12 @@ impl yaxpeax_arch::Arch for Arch {
}
impl LengthedInstruction for Instruction {
- type Unit = u32;
- fn len(&self) -> u32 {
- self.length.into()
+ type Unit = AddressDiff<u32>;
+ fn len(&self) -> Self::Unit {
+ AddressDiff::from_const(self.length.into())
}
- fn min_size() -> u32 {
- 1
+ fn min_size() -> Self::Unit {
+ AddressDiff::from_const(1)
}
}