diff options
author | josh.macdonald <jmacd@users.noreply.github.com> | 2008-09-06 14:19:38 +0000 |
---|---|---|
committer | josh.macdonald <jmacd@users.noreply.github.com> | 2008-09-06 14:19:38 +0000 |
commit | 7c7c8a38a1810f5953e443c58e6a1609ee5c2912 (patch) | |
tree | f33035faa6bafea297b90377a830929f4b159ff1 | |
parent | 76218119a2c07f8f68b43037fabcd324616ed9ee (diff) |
Improve "printdelta" to indicate source vs. target copies, widen size fields
to 6 chars.
-rw-r--r-- | xdelta3/xdelta3-main.h | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/xdelta3/xdelta3-main.h b/xdelta3/xdelta3-main.h index a3f5238..ae6fc19 100644 --- a/xdelta3/xdelta3-main.h +++ b/xdelta3/xdelta3-main.h | |||
@@ -1233,7 +1233,7 @@ main_print_window (xd3_stream* stream, main_file *xfile) | |||
1233 | int ret; | 1233 | int ret; |
1234 | usize_t size = 0; | 1234 | usize_t size = 0; |
1235 | 1235 | ||
1236 | VC(UT " Offset Code Type1 Size1 @Addr1 + Type2 Size2 @Addr2\n")VE; | 1236 | VC(UT " Offset Code Type1 Size1 @Addr1 + Type2 Size2 @Addr2\n")VE; |
1237 | 1237 | ||
1238 | while (stream->inst_sect.buf < stream->inst_sect.buf_max) | 1238 | while (stream->inst_sect.buf < stream->inst_sect.buf_max) |
1239 | { | 1239 | { |
@@ -1254,7 +1254,7 @@ main_print_window (xd3_stream* stream, main_file *xfile) | |||
1254 | addr_bytes = stream->addr_sect.buf - addr_before; | 1254 | addr_bytes = stream->addr_sect.buf - addr_before; |
1255 | inst_bytes = stream->inst_sect.buf - inst_before; | 1255 | inst_bytes = stream->inst_sect.buf - inst_before; |
1256 | 1256 | ||
1257 | VC(UT " %06"Q"u %03u %s %3u", stream->dec_winstart + size, | 1257 | VC(UT " %06"Q"u %03u %s %6u", stream->dec_winstart + size, |
1258 | option_print_cpymode ? code : 0, | 1258 | option_print_cpymode ? code : 0, |
1259 | xd3_rtype_to_string ((xd3_rtype) stream->dec_current1.type, option_print_cpymode), | 1259 | xd3_rtype_to_string ((xd3_rtype) stream->dec_current1.type, option_print_cpymode), |
1260 | (usize_t) stream->dec_current1.size)VE; | 1260 | (usize_t) stream->dec_current1.size)VE; |
@@ -1263,8 +1263,16 @@ main_print_window (xd3_stream* stream, main_file *xfile) | |||
1263 | { | 1263 | { |
1264 | if (stream->dec_current1.type >= XD3_CPY) | 1264 | if (stream->dec_current1.type >= XD3_CPY) |
1265 | { | 1265 | { |
1266 | VC(UT " @%-6"Q"u", | 1266 | if (stream->dec_current1.addr >= stream->dec_cpylen) |
1267 | stream->dec_cpyoff + stream->dec_current1.addr)VE; | 1267 | { |
1268 | VC(UT " T@%-6"Q"u", | ||
1269 | stream->dec_current1.addr - stream->dec_cpylen)VE; | ||
1270 | } | ||
1271 | else | ||
1272 | { | ||
1273 | VC(UT " S@%-6"Q"u", | ||
1274 | stream->dec_cpyoff + stream->dec_current1.addr)VE; | ||
1275 | } | ||
1268 | } | 1276 | } |
1269 | else | 1277 | else |
1270 | { | 1278 | { |
@@ -1276,15 +1284,23 @@ main_print_window (xd3_stream* stream, main_file *xfile) | |||
1276 | 1284 | ||
1277 | if (stream->dec_current2.type != XD3_NOOP) | 1285 | if (stream->dec_current2.type != XD3_NOOP) |
1278 | { | 1286 | { |
1279 | VC(UT " %s %3u", | 1287 | VC(UT " %s %6u", |
1280 | xd3_rtype_to_string ((xd3_rtype) stream->dec_current2.type, | 1288 | xd3_rtype_to_string ((xd3_rtype) stream->dec_current2.type, |
1281 | option_print_cpymode), | 1289 | option_print_cpymode), |
1282 | (usize_t)stream->dec_current2.size)VE; | 1290 | (usize_t)stream->dec_current2.size)VE; |
1283 | 1291 | ||
1284 | if (stream->dec_current2.type >= XD3_CPY) | 1292 | if (stream->dec_current2.type >= XD3_CPY) |
1285 | { | 1293 | { |
1286 | VC(UT " @%-6"Q"u", | 1294 | if (stream->dec_current2.addr >= stream->dec_cpylen) |
1287 | stream->dec_cpyoff + stream->dec_current2.addr)VE; | 1295 | { |
1296 | VC(UT " T@%-6"Q"u", | ||
1297 | stream->dec_current2.addr - stream->dec_cpylen)VE; | ||
1298 | } | ||
1299 | else | ||
1300 | { | ||
1301 | VC(UT " S@%-6"Q"u", | ||
1302 | stream->dec_cpyoff + stream->dec_current2.addr)VE; | ||
1303 | } | ||
1288 | } | 1304 | } |
1289 | 1305 | ||
1290 | size += stream->dec_current2.size; | 1306 | size += stream->dec_current2.size; |