Skip to content

Commit

Permalink
Avoid nameing conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
wenxuanjun committed Nov 3, 2024
1 parent d869320 commit 7a13d58
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ unsafe fn panic(_info: &PanicInfo) -> ! {
}

#[repr(C)]
pub struct Segment {
pub struct ElfSegment {
address: usize,
size: usize,
data: *const u8,
Expand All @@ -33,7 +33,7 @@ pub enum ElfParseResult {
pub unsafe extern "C" fn parse_elf(
elf_data: *const u8,
elf_size: usize,
mapping_callback: extern "C" fn(segment: Segment),
mapping_callback: extern "C" fn(segment: ElfSegment),
) -> ElfParseResult {
let buffer = from_raw_parts(elf_data, elf_size);

Expand All @@ -54,7 +54,7 @@ pub unsafe extern "C" fn parse_elf(
Err(_) => return ElfParseResult::FailedToGetSegmentData,
};

let segment = Segment {
let segment = ElfSegment {
address: header.p_vaddr as usize,
size: header.p_memsz as usize,
data: data.as_ptr(),
Expand Down

0 comments on commit 7a13d58

Please sign in to comment.