aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4math_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-25 12:24:36 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-28 13:33:24 +0200
commitcf2a253f2f60c9f0c61682527d80143e72b355d4 (patch)
treed60e8be50437e6f15513e25155817b902a2062c7 /src/qml/jsruntime/qv4math_p.h
parent7872b380063d0497ba62fecfdc92148f1ea947af (diff)
Move Value::fromBool, ... to a new Primitive class
This will simplify finding the remaining direct usages of QV4::Value that need fixing. Change-Id: I223099727436d5748027c84c53d9dfc4028e38ed Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4math_p.h')
-rw-r--r--src/qml/jsruntime/qv4math_p.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/qml/jsruntime/qv4math_p.h b/src/qml/jsruntime/qv4math_p.h
index a3a3715545..9ddb57eaaf 100644
--- a/src/qml/jsruntime/qv4math_p.h
+++ b/src/qml/jsruntime/qv4math_p.h
@@ -72,8 +72,8 @@ static inline QMLJS_READONLY Value add_int32(int a, int b)
: "cc"
);
if (!overflow)
- return Value::fromInt32(aa);
- return Value::fromDouble((double)a + (double)b);
+ return Primitive::fromInt32(aa);
+ return Primitive::fromDouble((double)a + (double)b);
}
static inline QMLJS_READONLY Value sub_int32(int a, int b)
@@ -88,8 +88,8 @@ static inline QMLJS_READONLY Value sub_int32(int a, int b)
: "cc"
);
if (!overflow)
- return Value::fromInt32(aa);
- return Value::fromDouble((double)a - (double)b);
+ return Primitive::fromInt32(aa);
+ return Primitive::fromDouble((double)a - (double)b);
}
static inline QMLJS_READONLY Value mul_int32(int a, int b)
@@ -104,8 +104,8 @@ static inline QMLJS_READONLY Value mul_int32(int a, int b)
: "cc"
);
if (!overflow)
- return Value::fromInt32(aa);
- return Value::fromDouble((double)a * (double)b);
+ return Primitive::fromInt32(aa);
+ return Primitive::fromDouble((double)a * (double)b);
}
#else
@@ -114,24 +114,24 @@ static inline QMLJS_READONLY Value add_int32(int a, int b)
{
qint64 result = a + b;
if (result > INT_MAX || result < INT_MIN)
- return Value::fromDouble(result);
- return Value::fromInt32(static_cast<int>(result));
+ return Primitive::fromDouble(result);
+ return Primitive::fromInt32(static_cast<int>(result));
}
static inline QMLJS_READONLY Value sub_int32(int a, int b)
{
qint64 result = a - b;
if (result > INT_MAX || result < INT_MIN)
- return Value::fromDouble(result);
- return Value::fromInt32(static_cast<int>(result));
+ return Primitive::fromDouble(result);
+ return Primitive::fromInt32(static_cast<int>(result));
}
static inline QMLJS_READONLY Value mul_int32(int a, int b)
{
qint64 result = a * b;
if (result > INT_MAX || result < INT_MIN)
- return Value::fromDouble(result);
- return Value::fromInt32(static_cast<int>(result));
+ return Primitive::fromDouble(result);
+ return Primitive::fromInt32(static_cast<int>(result));
}
#endif // defined(QMLJS_INLINE_MATH)