Init some more fields in the constructors, else uninited stuff gets copied in copy constructors.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4289
This commit is contained in:
parent
96bdc056ee
commit
a533565297
2 changed files with 8 additions and 8 deletions
|
@ -62,7 +62,7 @@ class DOS_DTA;
|
|||
|
||||
class DOS_File {
|
||||
public:
|
||||
DOS_File():flags(0) { name=0; refCtr = 0; hdrive=0xff; };
|
||||
DOS_File():flags(0),time(0),date(0),attr(0),refCtr(0),open(false),name(0),hdrive(0xff) { };
|
||||
DOS_File(const DOS_File& orig);
|
||||
DOS_File & operator= (const DOS_File & orig);
|
||||
virtual ~DOS_File(){if(name) delete [] name;};
|
||||
|
|
|
@ -76,13 +76,13 @@ public:
|
|||
enum Etype { V_NONE, V_HEX, V_BOOL, V_INT, V_STRING, V_DOUBLE,V_CURRENT} type;
|
||||
|
||||
/* Constructors */
|
||||
Value() :_string(0), type(V_NONE) { };
|
||||
Value(Hex in) :_hex(in), type(V_HEX) { };
|
||||
Value(int in) :_int(in), type(V_INT) { };
|
||||
Value(bool in) :_bool(in), type(V_BOOL) { };
|
||||
Value(double in) :_double(in), type(V_DOUBLE) { };
|
||||
Value(std::string const& in) :_string(new std::string(in)),type(V_STRING) { };
|
||||
Value(char const * const in) :_string(new std::string(in)),type(V_STRING) { };
|
||||
Value() :_hex(0), _bool(false),_int(0), _string(0), _double(0), type(V_NONE) { };
|
||||
Value(Hex in) :_hex(in),_bool(false),_int(0), _string(0), _double(0), type(V_HEX) { };
|
||||
Value(int in) :_hex(0), _bool(false),_int(in),_string(0), _double(0), type(V_INT) { };
|
||||
Value(bool in) :_hex(0), _bool(in) ,_int(0), _string(0), _double(0), type(V_BOOL) { };
|
||||
Value(double in) :_hex(0), _bool(false),_int(0), _string(0), _double(in),type(V_DOUBLE) { };
|
||||
Value(std::string const& in) :_hex(0), _bool(false),_int(0), _string(new std::string(in)),_double(0), type(V_STRING) { };
|
||||
Value(char const * const in) :_hex(0), _bool(false),_int(0), _string(new std::string(in)),_double(0), type(V_STRING) { };
|
||||
Value(Value const& in):_string(0) {plaincopy(in);}
|
||||
~Value() { destroy();};
|
||||
Value(std::string const& in,Etype _t) :_hex(0),_bool(false),_int(0),_string(0),_double(0),type(V_NONE) {SetValue(in,_t);}
|
||||
|
|
Loading…
Add table
Reference in a new issue