summaryrefslogtreecommitdiff
path: root/rust/src
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2022-01-18 09:16:25 -0500
committerPeter LaFosse <peter@vector35.com>2022-01-19 10:52:42 -0500
commit5d66fab3c2b36a14f9efd119a818c48c0950394a (patch)
tree739d0b5cd2ad0f5e5c9bab02d543b48b969127c6 /rust/src
parent1e1e2c9da6d6d39c2dc41c2aa24ee35de4cd27ac (diff)
Make enumeration's signed property BoolWithConfidence
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/types.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/rust/src/types.rs b/rust/src/types.rs
index ec36e5d9..17721361 100644
--- a/rust/src/types.rs
+++ b/rust/src/types.rs
@@ -376,7 +376,7 @@ impl TypeBuilder {
unsafe { Self::from_raw(BNCreateArrayTypeBuilder(&t.into().into(), count)) }
}
- pub fn enumeration(enumeration: &Enumeration, width: usize, is_signed: bool) -> Self {
+ pub fn enumeration(enumeration: &Enumeration, width: usize, is_signed: Conf<bool>) -> Self {
//! The C/C++ APIs require an associated architecture, but in the core we only query the default_int_size if the given width is 0
//! For simplicity's sake, that convention isn't followed and you can query the default_int_size from an arch, if you have it, if you need to
@@ -387,7 +387,7 @@ impl TypeBuilder {
&mut fake_arch,
enumeration.handle,
width,
- is_signed,
+ &mut is_signed.into(),
))
}
}
@@ -727,10 +727,9 @@ impl Type {
unsafe { Self::ref_from_raw(BNCreateArrayType(&t.into().into(), count)) }
}
- pub fn enumeration(enumeration: &Enumeration, width: usize, is_signed: bool) -> Ref<Self> {
+ pub fn enumeration(enumeration: &Enumeration, width: usize, is_signed: Conf<bool>) -> Ref<Self> {
//! The C/C++ APIs require an associated architecture, but in the core we only query the default_int_size if the given width is 0
//! For simplicity's sake, that convention isn't followed and you can query the default_int_size from an arch, if you have it, if you need to
-
unsafe {
// TODO : This is _extremely fragile_, we should change the internals of BNCreateEnumerationType instead of doing this
let mut fake_arch: BNArchitecture = mem::zeroed();
@@ -738,7 +737,7 @@ impl Type {
&mut fake_arch,
enumeration.handle,
width,
- is_signed,
+ &mut is_signed.into(),
))
}
}