////////////////////////////////////////////////////////////////////////
-static const char *
+static char *
copy_string (const char * s)
{
// FIXME: potential buffer overflow.
if (_tied) {
return _value.string_val->setValue(val);
} else {
- delete [] (char *)_local_val.string_val;
+ delete [] _local_val.string_val;
_local_val.string_val = copy_string(val);
return true;
}
delete _value.string_val;
_value.string_val = 0;
} else {
- delete [] (char *)_local_val.string_val;
+ delete [] _local_val.string_val;
}
_local_val.string_val = 0;
break;
*/
SGPropertyNode::~SGPropertyNode ()
{
- delete [] (char *)_name;
+ delete [] _name;
for (int i = 0; i < (int)_children.size(); i++) {
delete _children[i];
}
class hash_table;
- const char * _name;
+ char * _name;
int _index;
SGPropertyNode * _parent;
vector<SGPropertyNode *> _children;
long long_val;
float float_val;
double double_val;
- const char * string_val;
+ char * string_val;
} _local_val;
virtual SGPropertyNode * get_value () { return _value; }
virtual void set_value (SGPropertyNode * value);
private:
- const char * _key;
+ char * _key;
SGPropertyNode * _value;
};
entry ** _entries;
};
+ friend class bucket;
+
hash_table ();
virtual ~hash_table ();
virtual SGPropertyNode * get (const char * key);