Silenced some compilation warnings

This commit is contained in:
Benoit Steiner 2015-02-28 02:37:41 -08:00
parent bb483313f6
commit 56ea45ff0f
2 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ static void test_fixed_size()
VERIFY_IS_EQUAL((int)Eigen::internal::array_get<0>(dimensions), 2);
VERIFY_IS_EQUAL((int)Eigen::internal::array_get<1>(dimensions), 3);
VERIFY_IS_EQUAL((int)Eigen::internal::array_get<2>(dimensions), 7);
VERIFY_IS_EQUAL(dimensions.TotalSize(), 2*3*7);
VERIFY_IS_EQUAL(dimensions.TotalSize(), 2ul*3*7);
}

View File

@ -44,7 +44,7 @@ struct MyGenerator {
// location of the entry to set in the tensor, it can typically
// be ignored.
int operator()(Eigen::DenseIndex element_location, Eigen::DenseIndex /*unused*/ = 0) const {
return 3 * element_location;
return static_cast<int>(3 * element_location);
}
// Same as above but generates several numbers at a time.
@ -53,7 +53,7 @@ struct MyGenerator {
const int packetSize = internal::packet_traits<int>::size;
EIGEN_ALIGN_DEFAULT int values[packetSize];
for (int i = 0; i < packetSize; ++i) {
values[i] = 3 * (packet_location + i);
values[i] = static_cast<int>(3 * (packet_location + i));
}
return internal::pload<typename internal::packet_traits<int>::type>(values);
}