This also fixes one uninitialized flag.
using namespace Msp;
Compiler::Compiler(DataFile::Writer &w):
- writer(w),
- reset_src(false)
+ writer(w)
{
add("file", &Compiler::file);
add("for_each", &Compiler::for_each);
private:
Msp::DataFile::Writer &writer;
- bool reset_src;
+ bool reset_src = false;
public:
Compiler(Msp::DataFile::Writer &);
Packer::Packer(DataTool &t):
tool(t),
- tmp_file(tempfile()),
- dir_alloc(0)
+ tmp_file(tempfile())
{ }
IO::BufferedFile *Packer::tempfile()
typedef std::list<Object> ObjectList;
DataTool &tool;
- Msp::IO::BufferedFile *tmp_file;
+ Msp::IO::BufferedFile *tmp_file = nullptr;
std::list<Msp::DataFile::Statement> directory;
- unsigned dir_alloc;
+ unsigned dir_alloc = 0;
public:
Packer(DataTool &);
using namespace std;
using namespace Msp;
-DataTool::DataTool(int argc, char **argv):
- out_fn("-"),
- binary(false),
- compile(false),
- float_size(0),
- compress(false),
- pack(false),
- unpack(false),
- debug(false)
+DataTool::DataTool(int argc, char **argv)
{
GetOpt getopt;
getopt.add_option('b', "binary", binary, GetOpt::NO_ARG).set_help("Produce a binary datafile");
{
private:
std::list<std::string> in_fns;
- std::string out_fn;
- bool binary;
- bool compile;
- unsigned float_size;
- bool compress;
- bool pack;
- bool unpack;
- bool builtin;
+ std::string out_fn = "-";
+ bool binary = false;
+ bool compile = false;
+ unsigned float_size = 0;
+ bool compress = false;
+ bool pack = false;
+ bool unpack = false;
+ bool builtin = false;
std::string builtin_ns;
std::string builtin_module;
- bool debug;
+ bool debug = false;
public:
DataTool(int argc, char **argv);