diff options
author | Ben Smith <binjimin@gmail.com> | 2017-03-09 19:34:58 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-09 19:34:58 -0800 |
commit | dece22f5b8ab409150a5b9df4fb03a5033ec5c19 (patch) | |
tree | 6d63dc8df09a5bcf799c2957548e0a76a312103e /src/binary-reader-objdump.cc | |
parent | 826b336ea6c050f4b4971eb8014b2c2584fdad10 (diff) | |
download | wabt-dece22f5b8ab409150a5b9df4fb03a5033ec5c19.tar.gz wabt-dece22f5b8ab409150a5b9df4fb03a5033ec5c19.tar.bz2 wabt-dece22f5b8ab409150a5b9df4fb03a5033ec5c19.zip |
Move loop variable into for loop header (#347)
Diffstat (limited to 'src/binary-reader-objdump.cc')
-rw-r--r-- | src/binary-reader-objdump.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/binary-reader-objdump.cc b/src/binary-reader-objdump.cc index a34965f2..f8706635 100644 --- a/src/binary-reader-objdump.cc +++ b/src/binary-reader-objdump.cc @@ -214,21 +214,20 @@ static void log_opcode(Context* ctx, // Print binary data printf(" %06" PRIzx ": %02x", offset - 1, static_cast<unsigned>(ctx->current_opcode)); - size_t i; - for (i = 0; i < data_size && i < IMMEDIATE_OCTET_COUNT; i++, offset++) { + for (size_t i = 0; i < data_size && i < IMMEDIATE_OCTET_COUNT; + i++, offset++) { printf(" %02x", data[offset]); } - for (i = data_size + 1; i < IMMEDIATE_OCTET_COUNT; i++) { + for (size_t i = data_size + 1; i < IMMEDIATE_OCTET_COUNT; i++) { printf(" "); } printf(" | "); // Print disassemble - int j; int indent_level = ctx->indent_level; if (ctx->current_opcode == Opcode::Else) indent_level--; - for (j = 0; j < indent_level; j++) { + for (int j = 0; j < indent_level; j++) { printf(" "); } @@ -370,8 +369,7 @@ static Result on_signature(uint32_t index, if (!should_print_details(ctx)) return Result::Ok; printf(" - [%d] (", index); - uint32_t i; - for (i = 0; i < param_count; i++) { + for (uint32_t i = 0; i < param_count; i++) { if (i != 0) { printf(", "); } |