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/src/RenderSurface.cpp b/services/surfaceflinger/CompositionEngine/src/RenderSurface.cpp
index 10512eb..e981172 100644
--- a/services/surfaceflinger/CompositionEngine/src/RenderSurface.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/RenderSurface.cpp
@@ -91,7 +91,8 @@
}
void RenderSurface::setDisplaySize(const ui::Size& size) {
- mDisplaySurface->resizeBuffers(size.width, size.height);
+ mDisplaySurface->resizeBuffers(static_cast<uint32_t>(size.width),
+ static_cast<uint32_t>(size.height));
mSize = size;
}