Suppress some warnings on linux.
R=reed@google.com
Review URL: https://codereview.appspot.com/6572046
git-svn-id: http://skia.googlecode.com/svn/trunk@5687 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp
index 086b737..c0babee 100644
--- a/tests/MathTest.cpp
+++ b/tests/MathTest.cpp
@@ -184,14 +184,14 @@
*/
static bool equal_float_native_skia(float x, uint32_t ni, uint32_t si) {
if (!(x == x)) { // NAN
- return si == SK_MaxS32 || si == SK_MinS32;
+ return ((int32_t)si) == SK_MaxS32 || ((int32_t)si) == SK_MinS32;
}
// for out of range, C is undefined, but skia always should return NaN32
if (x > SK_MaxS32) {
- return si == SK_MaxS32;
+ return ((int32_t)si) == SK_MaxS32;
}
if (x < -SK_MaxS32) {
- return si == SK_MinS32;
+ return ((int32_t)si) == SK_MinS32;
}
return si == ni;
}
diff --git a/tests/MatrixTest.cpp b/tests/MatrixTest.cpp
index 30542dc..744f765 100644
--- a/tests/MatrixTest.cpp
+++ b/tests/MatrixTest.cpp
@@ -44,8 +44,8 @@
for (int i = 0; i < 9; ++i) {
float aVal = a.get(i);
float bVal = b.get(i);
- int aValI = *reinterpret_cast<int*>(&aVal);
- int bValI = *reinterpret_cast<int*>(&bVal);
+ int aValI = *SkTCast<int*>(&aVal);
+ int bValI = *SkTCast<int*>(&bVal);
if (0 == aVal && 0 == bVal && aValI != bValI) {
foundZeroSignDiff = true;
} else {
@@ -58,8 +58,8 @@
for (int i = 0; i < 9; ++i) {
float aVal = a.get(i);
float bVal = b.get(i);
- int aValI = *reinterpret_cast<int*>(&aVal);
- int bValI = *reinterpret_cast<int*>(&bVal);
+ int aValI = *SkTCast<int*>(&aVal);
+ int bValI = *SkTCast<int*>(&bVal);
if (sk_float_isnan(aVal) && aValI == bValI) {
foundNaN = true;
} else {
diff --git a/tests/RTreeTest.cpp b/tests/RTreeTest.cpp
index 0e06337..6962c89 100644
--- a/tests/RTreeTest.cpp
+++ b/tests/RTreeTest.cpp
@@ -14,7 +14,7 @@
static const size_t MIN_CHILDREN = 6;
static const size_t MAX_CHILDREN = 11;
-static const size_t NUM_RECTS = 200;
+static const int NUM_RECTS = 200;
static const size_t NUM_ITERATIONS = 100;
static const size_t NUM_QUERIES = 50;
@@ -46,7 +46,7 @@
SkTDArray<void*>& found) {
SkTDArray<void*> expected;
// manually intersect with every rectangle
- for (size_t i = 0; i < NUM_RECTS; ++i) {
+ for (int i = 0; i < NUM_RECTS; ++i) {
if (SkIRect::IntersectsNoEmptyCheck(query, rects[i].rect)) {
expected.push(rects[i].data);
}
@@ -106,7 +106,7 @@
random_data_rects(rand, rects, NUM_RECTS);
// First try bulk-loaded inserts
- for (size_t i = 0; i < NUM_RECTS; ++i) {
+ for (int i = 0; i < NUM_RECTS; ++i) {
rtree->insert(rects[i].data, rects[i].rect, true);
}
rtree->flushDeferredInserts();
@@ -118,7 +118,7 @@
REPORTER_ASSERT(reporter, 0 == rtree->getCount());
// Then try immediate inserts
- for (size_t i = 0; i < NUM_RECTS; ++i) {
+ for (int i = 0; i < NUM_RECTS; ++i) {
rtree->insert(rects[i].data, rects[i].rect);
}
runQueries(reporter, rand, rects, *rtree);