Skip to content

Commit 1c198ae

Browse files
authored
Merge pull request #27 from eZioPan/hex-address
output hex address
2 parents 0c421dc + 915bd71 commit 1c198ae

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/generate/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub fn render(opts: &super::Options, ir: &IR, b: &Block, path: &str) -> Result<T
1616

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

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

src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ pub fn hex_str(n: u64) -> String {
185185
} else if h1 != 0 {
186186
format!("0x{:02x}", h1 & 0xff)
187187
} else {
188-
"0".to_string()
188+
"0x0".to_string()
189189
}
190190
}
191191

0 commit comments

Comments
 (0)