CE: Cleanups for conversion warnings
1) If converting from float to int, adds an explicit cast as well as
considers rounding.
2) Adjust some arguments from int32_t to uint32_t where that makes
sense.
3) Adds explicit casts from int32_t to uint32_t where a cast is
necessary.
4) Converts constants used in the tests to the right type (float instead
of double, unsigned instead of signed).
Test: Builds with "-Wconversion" enabled locally
Bug: 129481165
Change-Id: I405af72c22f37865537bdefa3f589b4b2930f56c
diff --git a/services/surfaceflinger/CompositionEngine/tests/CompositionEngineTest.cpp b/services/surfaceflinger/CompositionEngine/tests/CompositionEngineTest.cpp
index ebcd0a0..bcaa529 100644
--- a/services/surfaceflinger/CompositionEngine/tests/CompositionEngineTest.cpp
+++ b/services/surfaceflinger/CompositionEngine/tests/CompositionEngineTest.cpp
@@ -139,14 +139,14 @@
struct CompositionEngineUpdateCursorAsyncTest : public CompositionEngineTest {
public:
CompositionEngineUpdateCursorAsyncTest() {
- EXPECT_CALL(*mOutput1, getOutputLayerCount()).WillRepeatedly(Return(0));
+ EXPECT_CALL(*mOutput1, getOutputLayerCount()).WillRepeatedly(Return(0u));
EXPECT_CALL(*mOutput1, getOutputLayerOrderedByZByIndex(_)).Times(0);
- EXPECT_CALL(*mOutput2, getOutputLayerCount()).WillRepeatedly(Return(1));
+ EXPECT_CALL(*mOutput2, getOutputLayerCount()).WillRepeatedly(Return(1u));
EXPECT_CALL(*mOutput2, getOutputLayerOrderedByZByIndex(0))
.WillRepeatedly(Return(&mOutput2OutputLayer1));
- EXPECT_CALL(*mOutput3, getOutputLayerCount()).WillRepeatedly(Return(2));
+ EXPECT_CALL(*mOutput3, getOutputLayerCount()).WillRepeatedly(Return(2u));
EXPECT_CALL(*mOutput3, getOutputLayerOrderedByZByIndex(0))
.WillRepeatedly(Return(&mOutput3OutputLayer1));
EXPECT_CALL(*mOutput3, getOutputLayerOrderedByZByIndex(1))