@@ -21,12 +21,12 @@ EitherType::~EitherType() {
2121}
2222
2323EitherType::operator bool () const { return value_->boolValue (); }
24- EitherType::operator unsigned () const { return value_->unsignedValue (); }
25- EitherType::operator unsigned long int () const {
24+ EitherType::operator uint32_t () const { return value_->unsignedValue (); }
25+ EitherType::operator uint64_t () const {
2626 return value_->unsignedlongintValue ();
2727}
28- EitherType::operator int () const { return value_->intValue (); }
29- EitherType::operator long int () const { return value_->longintValue (); }
28+ EitherType::operator int32_t () const { return value_->intValue (); }
29+ EitherType::operator int64_t () const { return value_->longintValue (); }
3030EitherType::operator float () const { return value_->floatValue (); }
3131EitherType::operator double () const { return value_->doubleValue (); }
3232EitherType::operator std::string () const { return value_->stringValue (); }
@@ -42,16 +42,16 @@ void Value::deleteValue() {
4242 delete (const bool *)value_;
4343 break ;
4444 case UNSIGNED:
45- delete (const unsigned *)value_;
45+ delete (const uint32_t *)value_;
4646 break ;
4747 case UNSIGNEDLONGINT:
48- delete (const unsigned long int *)value_;
48+ delete (const uint64_t *)value_;
4949 break ;
5050 case INT:
51- delete (const int *)value_;
51+ delete (const int32_t *)value_;
5252 break ;
5353 case LONGINT:
54- delete (const long int *)value_;
54+ delete (const int64_t *)value_;
5555 break ;
5656 case FLOAT:
5757 delete (const float *)value_;
@@ -85,11 +85,13 @@ void Value::deleteValue() {
8585Value::~Value () { deleteValue (); }
8686
8787Value::Value (const bool &value) : type_(BOOL), value_(new bool (value)) {}
88- Value::Value (const unsigned &value)
89- : type_(UNSIGNED), value_(new unsigned (value)) {}
90- Value::Value (const unsigned long int &value)
91- : type_(UNSIGNEDLONGINT), value_(new unsigned long int (value)) {}
92- Value::Value (const int &value) : type_(INT), value_(new int (value)) {}
88+ Value::Value (const uint32_t &value)
89+ : type_(UNSIGNED), value_(new uint32_t (value)) {}
90+ Value::Value (const uint64_t &value)
91+ : type_(UNSIGNEDLONGINT), value_(new uint64_t (value)) {}
92+ Value::Value (const int32_t &value) : type_(INT), value_(new int32_t (value)) {}
93+ Value::Value (const int64_t &value) : type_(LONGINT), value_(new int64_t (value))
94+ {}
9395Value::Value (const float &value) : type_(FLOAT), value_(new float (value)) {}
9496Value::Value (const double &value) : type_(DOUBLE), value_(new double (value)) {}
9597Value::Value (const std::string &value)
@@ -206,25 +208,25 @@ bool Value::boolValue() const {
206208 throw ExceptionAbstract (ExceptionAbstract::TOOLS, " value is not an bool" );
207209}
208210
209- unsigned Value::unsignedValue () const {
210- if (type_ == UNSIGNED) return *((const unsigned *)value_);
211+ uint32_t Value::unsignedValue () const {
212+ if (type_ == UNSIGNED) return *((const uint32_t *)value_);
211213 throw ExceptionAbstract (ExceptionAbstract::TOOLS,
212214 " value is not an unsigned int" );
213215}
214216
215- unsigned long int Value::unsignedlongintValue () const {
216- if (type_ == UNSIGNEDLONGINT) return *((const unsigned long int *)value_);
217+ uint64_t Value::unsignedlongintValue () const {
218+ if (type_ == UNSIGNEDLONGINT) return *((const uint64_t *)value_);
217219 throw ExceptionAbstract (ExceptionAbstract::TOOLS,
218220 " value is not an unsigned long int" );
219221}
220222
221- long int Value::longintValue () const {
222- if (type_ == LONGINT) return *((const long int *)value_);
223+ int64_t Value::longintValue () const {
224+ if (type_ == LONGINT) return *((const int64_t *)value_);
223225 throw ExceptionAbstract (ExceptionAbstract::TOOLS, " value is not an long int" );
224226}
225227
226- int Value::intValue () const {
227- if (type_ == INT) return *((const int *)value_);
228+ int32_t Value::intValue () const {
229+ if (type_ == INT) return *((const int32_t *)value_);
228230 throw ExceptionAbstract (ExceptionAbstract::TOOLS, " value is not an int" );
229231}
230232
@@ -356,12 +358,14 @@ std::ostream &operator<<(std::ostream &os, const Value &value) {
356358template <>
357359const Value::Type ValueHelper<bool >::TypeID = Value::BOOL;
358360template <>
359- const Value::Type ValueHelper<unsigned >::TypeID = Value::UNSIGNED;
361+ const Value::Type ValueHelper<uint32_t >::TypeID = Value::UNSIGNED;
360362template <>
361- const Value::Type ValueHelper<unsigned long int >::TypeID =
363+ const Value::Type ValueHelper<uint64_t >::TypeID =
362364 Value::UNSIGNEDLONGINT;
363365template <>
364- const Value::Type ValueHelper<int >::TypeID = Value::INT;
366+ const Value::Type ValueHelper<int32_t >::TypeID = Value::INT;
367+ template <>
368+ const Value::Type ValueHelper<int64_t >::TypeID = Value::LONGINT;
365369template <>
366370const Value::Type ValueHelper<float >::TypeID = Value::FLOAT;
367371template <>
0 commit comments