This commit is contained in:
Numbers
2024-05-16 00:09:45 -04:00
parent a1379c2696
commit 973c4311bb
3 changed files with 8 additions and 1 deletions

View File

@@ -84,3 +84,7 @@ mod pointer_iterator {
pub fn iterate<T: pointer_iterator::Pointer>(pointer: T) -> T::IterType {
pointer.into_iter()
}
pub fn fill_with<T, F: FnMut(usize) -> T>(slice: &mut [T], mut func: F) {
slice.iter_mut().enumerate().for_each(|(i,v)|*v = func(i))
}

View File

@@ -32,7 +32,6 @@ pub mod win32;
#[cfg(feature = "win32")]
pub use win32::{ image_base, image_header, find_kernel32, process_executable };
/// re-export the signature macro
pub use xgen::signature;

View File

@@ -50,9 +50,13 @@ gen_upcast!(i16 => isize);
#[cfg(any(target_pointer_width = "64", target_pointer_width = "32"))]
gen_upcast!(u32 => usize);
#[cfg(any(target_pointer_width = "64"))]
gen_upcast!(u64 => usize);
#[cfg(any(target_pointer_width = "64", target_pointer_width = "32"))]
gen_upcast!(i32 => isize);
#[cfg(any(target_pointer_width = "64"))]
gen_upcast!(i64 => isize);
gen_upcast!(isize => isize);
gen_upcast!(usize => usize);