Skip to content

Commit

Permalink
Merge pull request #27 from eZioPan/hex-address
Browse files Browse the repository at this point in the history
output hex address
  • Loading branch information
Dirbaio authored Feb 25, 2024
2 parents 0c421dc + 915bd71 commit 1c198ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/generate/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn render(opts: &super::Options, ir: &IR, b: &Block, path: &str) -> Result<T

for i in sorted(&b.items, |i| (i.byte_offset, i.name.clone())) {
let name = Ident::new(&i.name, span);
let offset = i.byte_offset as usize;
let offset = util::hex_usize(i.byte_offset as u64);

let doc = util::doc(&i.description);

Expand Down
2 changes: 1 addition & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ pub fn hex_str(n: u64) -> String {
} else if h1 != 0 {
format!("0x{:02x}", h1 & 0xff)
} else {
"0".to_string()
"0x0".to_string()
}
}

Expand Down

0 comments on commit 1c198ae

Please sign in to comment.