summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2013-04-09 19:14:11 +0000
committerrandomdan <randomdan@localhost>2013-04-09 19:14:11 +0000
commit654ea1ec2aa4279cfaee913079fe1215a175eead (patch)
treec963eb27ae9d111854fb07a18659996a3877418e
parentGCC 4.6 workaround for vector of objects with consts (diff)
downloadproject2-654ea1ec2aa4279cfaee913079fe1215a175eead.tar.bz2
project2-654ea1ec2aa4279cfaee913079fe1215a175eead.tar.xz
project2-654ea1ec2aa4279cfaee913079fe1215a175eead.zip
Address ambiguity converting to long int on 32bit
-rw-r--r--project2/common/variableConvert.cpp12
-rw-r--r--project2/common/variableType.h5
2 files changed, 11 insertions, 6 deletions
diff --git a/project2/common/variableConvert.cpp b/project2/common/variableConvert.cpp
index 8fd906f..69082de 100644
--- a/project2/common/variableConvert.cpp
+++ b/project2/common/variableConvert.cpp
@@ -173,13 +173,17 @@ VariableType::operator const unsigned char *() const
{
return reinterpret_cast<const unsigned char *>(boost::apply_visitor(ConvertVisitorCharStar(this), *this));
}
-VariableType::operator int32_t() const
+VariableType::operator int() const
{
- return boost::apply_visitor(ConvertVisitor<int32_t>(this), *this);
+ return boost::apply_visitor(ConvertVisitor<int>(this), *this);
}
-VariableType::operator int64_t() const
+VariableType::operator long int() const
{
- return boost::apply_visitor(ConvertVisitor<int64_t>(this), *this);
+ return boost::apply_visitor(ConvertVisitor<long int>(this), *this);
+}
+VariableType::operator long long int() const
+{
+ return boost::apply_visitor(ConvertVisitor<long long int>(this), *this);
}
VariableType::operator double() const
{
diff --git a/project2/common/variableType.h b/project2/common/variableType.h
index 21c2c39..d3ac5a0 100644
--- a/project2/common/variableType.h
+++ b/project2/common/variableType.h
@@ -87,8 +87,9 @@ class VariableType : public _VT {
operator const std::string &() const;
operator const char *() const;
operator const unsigned char *() const;
- operator int64_t() const;
- operator int32_t() const;
+ operator long long int() const;
+ operator long int() const;
+ operator int() const;
operator double() const;
operator const boost::posix_time::ptime &() const;
template <typename T> operator boost::optional<T>() const { return isNull() ? boost::optional<T>() : as<T>(); }