summaryrefslogtreecommitdiffstats
path: root/test/454-get-vreg/get_vreg_jni.cc
diff options
context:
space:
mode:
authorRoland Levillain <rpl@google.com>2015-03-24 14:36:11 +0000
committerRoland Levillain <rpl@google.com>2015-03-24 16:02:21 +0000
commitda4d79bc9a4aeb9da7c6259ce4c9c1c3bf545eb8 (patch)
tree151dd61c4b6a8fd512ea4c2c862af28b02f4ed9c /test/454-get-vreg/get_vreg_jni.cc
parentaf87659f462ac650009fce295097cae3dabce171 (diff)
downloadart-da4d79bc9a4aeb9da7c6259ce4c9c1c3bf545eb8.tar.gz
art-da4d79bc9a4aeb9da7c6259ce4c9c1c3bf545eb8.tar.bz2
art-da4d79bc9a4aeb9da7c6259ce4c9c1c3bf545eb8.zip
Unify ART's various implementations of bit_cast.
ART had several implementations of art::bit_cast: 1. one in runtime/base/casts.h, declared as: template <class Dest, class Source> inline Dest bit_cast(const Source& source); 2. another one in runtime/utils.h, declared as: template<typename U, typename V> static inline V bit_cast(U in); 3. and a third local version, in runtime/memory_region.h, similar to the previous one: template<typename Source, typename Destination> static Destination MemoryRegion::local_bit_cast(Source in); This CL removes versions 2. and 3. and changes their callers to use 1. instead. That version was chosen over the others as: - it was the oldest one in the code base; and - its syntax was closer to the standard C++ cast operators, as it supports the following use: bit_cast<Destination>(source) since `Source' can be deduced from `source'. Change-Id: I7334fd5d55bf0b8a0c52cb33cfbae6894ff83633
Diffstat (limited to 'test/454-get-vreg/get_vreg_jni.cc')
-rw-r--r--test/454-get-vreg/get_vreg_jni.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/454-get-vreg/get_vreg_jni.cc b/test/454-get-vreg/get_vreg_jni.cc
index 937d2fee76..6b4bc11086 100644
--- a/test/454-get-vreg/get_vreg_jni.cc
+++ b/test/454-get-vreg/get_vreg_jni.cc
@@ -55,7 +55,7 @@ class TestVisitor : public StackVisitor {
CHECK_EQ(value, 1u);
CHECK(GetVReg(m, 5, kFloatVReg, &value));
- uint32_t cast = bit_cast<float, uint32_t>(1.0f);
+ uint32_t cast = bit_cast<uint32_t, float>(1.0f);
CHECK_EQ(value, cast);
CHECK(GetVReg(m, 6, kIntVReg, &value));
@@ -95,7 +95,7 @@ class TestVisitor : public StackVisitor {
CHECK_EQ(value, 0u);
CHECK(GetVRegPair(m, 13, kDoubleLoVReg, kDoubleHiVReg, &value));
- uint64_t cast = bit_cast<double, uint64_t>(2.0);
+ uint64_t cast = bit_cast<uint64_t, double>(2.0);
CHECK_EQ(value, cast);
}