summaryrefslogtreecommitdiff
path: root/src/tools/wasmopcodecnt.cc
diff options
context:
space:
mode:
authorBen Smith <binjimin@gmail.com>2017-04-16 16:07:03 -0700
committerGitHub <noreply@github.com>2017-04-16 16:07:03 -0700
commita4751fe78f119305fa8927f1bba10aefecc14f3f (patch)
treee339741de3c5b1ce7382601952d0f80a685cd701 /src/tools/wasmopcodecnt.cc
parent15c898a5bd3e257e72e4f5b4fdc831c82bf20e83 (diff)
downloadwabt-a4751fe78f119305fa8927f1bba10aefecc14f3f.tar.gz
wabt-a4751fe78f119305fa8927f1bba10aefecc14f3f.tar.bz2
wabt-a4751fe78f119305fa8927f1bba10aefecc14f3f.zip
Refactor Stream/Writer; write as C++ (#399)
Diffstat (limited to 'src/tools/wasmopcodecnt.cc')
-rw-r--r--src/tools/wasmopcodecnt.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/tools/wasmopcodecnt.cc b/src/tools/wasmopcodecnt.cc
index 89009aca..332bb442 100644
--- a/src/tools/wasmopcodecnt.cc
+++ b/src/tools/wasmopcodecnt.cc
@@ -43,8 +43,7 @@ static const char* s_separator = ": ";
static ReadBinaryOptions s_read_binary_options =
WABT_READ_BINARY_OPTIONS_DEFAULT;
-static FileWriter s_log_stream_writer;
-static Stream s_log_stream;
+static std::unique_ptr<FileStream> s_log_stream;
#define NOPE HasArgument::No
#define YEP HasArgument::Yes
@@ -85,9 +84,8 @@ static void on_option(struct OptionParser* parser,
switch (option->id) {
case FLAG_VERBOSE:
s_verbose++;
- init_file_writer_existing(&s_log_stream_writer, stdout);
- init_stream(&s_log_stream, &s_log_stream_writer.base, nullptr);
- s_read_binary_options.log_stream = &s_log_stream;
+ s_log_stream = FileStream::CreateStdout();
+ s_read_binary_options.log_stream = s_log_stream.get();
break;
case FLAG_HELP: