diff options
Diffstat (limited to 'passes/cmds/write_file.cc')
-rw-r--r-- | passes/cmds/write_file.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/passes/cmds/write_file.cc b/passes/cmds/write_file.cc index 813e215ba..25ec4acc2 100644 --- a/passes/cmds/write_file.cc +++ b/passes/cmds/write_file.cc @@ -20,6 +20,9 @@ #include "kernel/yosys.h" +USING_YOSYS_NAMESPACE +PRIVATE_NAMESPACE_BEGIN + struct WriteFileFrontend : public Frontend { WriteFileFrontend() : Frontend("=write_file", "write a text to a file") { } virtual void help() @@ -65,12 +68,13 @@ struct WriteFileFrontend : public Frontend { FILE *of = fopen(output_filename.c_str(), append_mode ? "a" : "w"); char buffer[64 * 1024]; - size_t bytes; + int bytes; - while (0 < (bytes = f->readsome(buffer, sizeof(buffer)))) + while (0 < (bytes = readsome(*f, buffer, sizeof(buffer)))) fwrite(buffer, bytes, 1, of); fclose(of); } } WriteFileFrontend; +PRIVATE_NAMESPACE_END |