libgui: Enable -Weverything and -Werror
Enables -Weverything and -Werror, with just a few exceptions for
warnings we can't (or shouldn't need to) work around.
Change-Id: I034abec27bf4020d84af60d7acc1939c59986dd6
diff --git a/libs/gui/Sensor.cpp b/libs/gui/Sensor.cpp
index b4291bb..8d38eef 100644
--- a/libs/gui/Sensor.cpp
+++ b/libs/gui/Sensor.cpp
@@ -72,7 +72,7 @@
static_cast<int64_t>(hwSensor->maxDelay));
mMaxDelay = INT_MAX;
} else {
- mMaxDelay = (int32_t) hwSensor->maxDelay;
+ mMaxDelay = static_cast<int32_t>(hwSensor->maxDelay);
}
} else {
// For older hals set maxDelay to 0.
@@ -214,7 +214,7 @@
}
if (halVersion >= SENSORS_DEVICE_API_VERSION_1_3) {
- mFlags = (int32_t) hwSensor->flags;
+ mFlags = static_cast<uint32_t>(hwSensor->flags);
} else {
// This is an OEM defined sensor on an older HAL. Use minDelay to determine the
// reporting mode of the sensor.
@@ -295,11 +295,11 @@
return mVersion;
}
-int32_t Sensor::getFifoReservedEventCount() const {
+uint32_t Sensor::getFifoReservedEventCount() const {
return mFifoReservedEventCount;
}
-int32_t Sensor::getFifoMaxEventCount() const {
+uint32_t Sensor::getFifoMaxEventCount() const {
return mFifoMaxEventCount;
}
@@ -315,7 +315,7 @@
return mMaxDelay;
}
-int32_t Sensor::getFlags() const {
+uint32_t Sensor::getFlags() const {
return mFlags;
}
@@ -407,7 +407,7 @@
void Sensor::flattenString8(void*& buffer, size_t& size,
const String8& string8) {
- uint32_t len = string8.length();
+ uint32_t len = static_cast<uint32_t>(string8.length());
FlattenableUtils::write(buffer, size, len);
memcpy(static_cast<char*>(buffer), string8.string(), len);
FlattenableUtils::advance(buffer, size, FlattenableUtils::align<4>(len));