diff options
author | Ben Smith <binjimin@gmail.com> | 2017-03-06 11:34:37 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-06 11:34:37 -0800 |
commit | e4dda12b17a5323a56b6782a6787f258ed2d8c81 (patch) | |
tree | c47e34928fc9b48f5b8dd1579e4c0213074b6494 /src/tools/wasmdump.cc | |
parent | b6e5735f3bfbb66d76142fc2f404da796289fc76 (diff) | |
download | wabt-e4dda12b17a5323a56b6782a6787f258ed2d8c81.tar.gz wabt-e4dda12b17a5323a56b6782a6787f258ed2d8c81.tar.bz2 wabt-e4dda12b17a5323a56b6782a6787f258ed2d8c81.zip |
Use new/delete instead of malloc/free (#332)
Also switch some void* -> char*, because it removes some unnecessary
casts. C++ does not like void*.
Diffstat (limited to 'src/tools/wasmdump.cc')
-rw-r--r-- | src/tools/wasmdump.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/wasmdump.cc b/src/tools/wasmdump.cc index 99539dc6..1293c5a7 100644 --- a/src/tools/wasmdump.cc +++ b/src/tools/wasmdump.cc @@ -145,13 +145,13 @@ int main(int argc, char** argv) { return 1; } - void* void_data; + char* char_data; size_t size; - Result result = read_file(s_objdump_options.infile, &void_data, &size); + Result result = read_file(s_objdump_options.infile, &char_data, &size); if (WABT_FAILED(result)) return result != Result::Ok; - uint8_t* data = static_cast<uint8_t*>(void_data); + uint8_t* data = reinterpret_cast<uint8_t*>(char_data); // Perform serveral passed over the binary in order to print out different // types of information. @@ -201,6 +201,6 @@ int main(int argc, char** argv) { } done: - wabt_free(data); + delete[] data; return result != Result::Ok; } |