Skip to content
This repository has been archived by the owner on Dec 14, 2024. It is now read-only.

Commit

Permalink
简化一点代码
Browse files Browse the repository at this point in the history
  • Loading branch information
kekeimiku committed Jun 5, 2024
1 parent ee09d02 commit f5d43e4
Show file tree
Hide file tree
Showing 3 changed files with 242 additions and 227 deletions.
2 changes: 1 addition & 1 deletion libptrscan/src/ffi/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub unsafe extern "C" fn get_last_error(code: c_int) -> *const c_char {
} else if code == CALL_ERROR {
// cbindgen 还没支持 c"message" 一类的c字符串...
const {
let bytes = concat!("call error", "\0").as_bytes();
let bytes = concat!("function call error", "\0").as_bytes();
CStr::from_bytes_with_nul_unchecked(bytes).as_ptr()
}
} else if code == NO_NULL {
Expand Down
4 changes: 2 additions & 2 deletions libptrscan/src/ffi/ptrscan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ pub unsafe extern "C" fn ptrscan_scan_pointer_chain(
param: FFIParam,
pathname: *const c_char,
) -> c_int {
let FFIParam { addr, depth, srange, lrange, node, last, max, .. } = param;
let FFIParam { addr, depth, srange, lrange, node, last, max, cycle, .. } = param;

let range = (srange.left, srange.right);
let lrange = lrange.as_ref().copied().map(|r| (r.left, r.right));
Expand All @@ -215,7 +215,7 @@ pub unsafe extern "C" fn ptrscan_scan_pointer_chain(
#[rustfmt::skip]
let param = UserParam {
param: Param { depth, addr, srange: range, lrange },
node, last, max,
node, last, max, cycle
};

try_result!(pointer_chain_scan(pointer_map, pathname, param));
Expand Down
Loading

0 comments on commit f5d43e4

Please sign in to comment.