You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by ha...@apache.org on 2016/06/20 21:52:49 UTC

incubator-quickstep git commit: Operators are updated.

Repository: incubator-quickstep
Updated Branches:
  refs/heads/decimal-type 0acaf423a -> aebb4a3bd


Operators are updated.


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/aebb4a3b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/aebb4a3b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/aebb4a3b

Branch: refs/heads/decimal-type
Commit: aebb4a3bd2d1bd98c77e7a3db03888db0d931ffb
Parents: 0acaf42
Author: Hakan Memisoglu <ha...@apache.org>
Authored: Mon Jun 20 16:52:27 2016 -0500
Committer: Hakan Memisoglu <ha...@apache.org>
Committed: Mon Jun 20 16:52:27 2016 -0500

----------------------------------------------------------------------
 types/DecimalLit.hpp | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/aebb4a3b/types/DecimalLit.hpp
----------------------------------------------------------------------
diff --git a/types/DecimalLit.hpp b/types/DecimalLit.hpp
index 5d7b4a5..2b1ae8a 100644
--- a/types/DecimalLit.hpp
+++ b/types/DecimalLit.hpp
@@ -195,7 +195,9 @@ struct DecimalLit {
    * @return Negative of this.
    **/
   inline DecimalLit operator-() const {
-    return DecimalLit{-data_};
+    DecimalLit result;
+    result.data_ = -result.data_;
+    return result;
   }
 
   /**
@@ -205,7 +207,9 @@ struct DecimalLit {
    * @return Sum of this and other.
    **/
   inline DecimalLit operator+(const DecimalLit& other) const {
-    return DecimalLit{data_ + other.data_};
+    DecimalLit result;
+    result.data_ = data_ + other.data_;
+    return result;
   }
 
   /**
@@ -215,7 +219,9 @@ struct DecimalLit {
    * @return Subtraction of other from this.
    **/
   inline DecimalLit operator-(const DecimalLit& other) const {
-    return DecimalLit{data_ - other.data_};
+    DecimalLit result;
+    result.data_ = data_ - other.data_;
+    return result;
   }
 
   /**
@@ -225,7 +231,9 @@ struct DecimalLit {
    * @return Multiplication of this and other.
    **/
   inline DecimalLit operator*(const DecimalLit& other) const {
-    return DecimalLit{(data_ * other.data_) / kMaxFractionInt};
+    DecimalLit result;
+    result.data_ = (data_ * other.data_) / kMaxFractionInt;
+    return result;
   }
 
   /**
@@ -235,7 +243,9 @@ struct DecimalLit {
    * @return Division of this with other.
    **/
   inline DecimalLit operator/(const DecimalLit& other) const {
-    return DecimalLit{(data_ * kMaxFractionInt) / other.data_};
+    DecimalLit result;
+    result.data_ = (data_ * kMaxFractionInt) / other.data_;
+    return result;
   }
 
   /**
@@ -245,7 +255,9 @@ struct DecimalLit {
    * @return This modulo other.
    **/
   inline DecimalLit operator%(const DecimalLit& other) const {
-    return DecimalLit{data_ % other.data_};
+    DecimalLit result;
+    result.data_ = data_ % other.data_;
+    return result;
   }
 
   /**