summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/value.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/value.cpp')
-rw-r--r--src/mongo/db/pipeline/value.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/db/pipeline/value.cpp b/src/mongo/db/pipeline/value.cpp
index 6c2dc767256..5d5b04ae137 100644
--- a/src/mongo/db/pipeline/value.cpp
+++ b/src/mongo/db/pipeline/value.cpp
@@ -253,9 +253,9 @@ Value Value::createIntOrLong(long long longValue) {
Decimal128 Value::getDecimal() const {
BSONType type = getType();
if (type == NumberInt)
- return Decimal128(_storage.intValue);
+ return Decimal128(static_cast<int32_t>(_storage.intValue));
if (type == NumberLong)
- return Decimal128(_storage.longValue);
+ return Decimal128(static_cast<int64_t>(_storage.longValue));
if (type == NumberDouble)
return Decimal128(_storage.doubleValue);
invariant(type == NumberDecimal);
@@ -479,10 +479,10 @@ Decimal128 Value::coerceToDecimal() const {
return _storage.getDecimal();
case NumberInt:
- return Decimal128(_storage.intValue);
+ return Decimal128(static_cast<int32_t>(_storage.intValue));
case NumberLong:
- return Decimal128(_storage.longValue);
+ return Decimal128(static_cast<int64_t>(_storage.longValue));
case NumberDouble:
return Decimal128(_storage.doubleValue);