diff options
| author | 2017-10-05 13:51:32 -0700 | |
|---|---|---|
| committer | 2017-10-13 16:12:08 -0700 | |
| commit | d66be0ae6929fee064a229d6c6bac3a871aba137 (patch) | |
| tree | edf6df30381838963d504cc4e0e68a7ec8f515b9 | |
| parent | afee092bee459332c8d577163794581c3128df4f (diff) | |
Use -Werror in frameworks/native/libs/gui and ui
* Remove unused variable and function.
* Suppress warning of unused return results.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: If6f445be1e7677a37bf780844a79b84d6d7e1c1e
| -rw-r--r-- | include/private/ui/RegionHelper.h | 1 | ||||
| -rw-r--r-- | libs/gui/Android.bp | 5 | ||||
| -rw-r--r-- | libs/gui/Surface.cpp | 5 | ||||
| -rw-r--r-- | libs/gui/tests/Android.bp | 4 | ||||
| -rw-r--r-- | libs/gui/tests/CpuConsumer_test.cpp | 6 | ||||
| -rw-r--r-- | libs/gui/tests/SurfaceTextureGL_test.cpp | 1 | ||||
| -rw-r--r-- | libs/gui/tests/Surface_test.cpp | 4 | ||||
| -rw-r--r-- | libs/ui/Android.bp | 5 | ||||
| -rw-r--r-- | libs/ui/GraphicBufferMapper.cpp | 23 | ||||
| -rw-r--r-- | libs/ui/tests/Android.bp | 2 |
10 files changed, 18 insertions, 38 deletions
diff --git a/include/private/ui/RegionHelper.h b/include/private/ui/RegionHelper.h index 380e7454ad..0ec3e9474e 100644 --- a/include/private/ui/RegionHelper.h +++ b/include/private/ui/RegionHelper.h @@ -81,7 +81,6 @@ public: int inside = spanner.next(current.top, current.bottom); spannerInner.prepare(inside); do { - TYPE left, right; int inner_inside = spannerInner.next(current.left, current.right); if ((op_mask >> inner_inside) & 1) { if (current.left < current.right && diff --git a/libs/gui/Android.bp b/libs/gui/Android.bp index 50bb7b27d2..37fae64158 100644 --- a/libs/gui/Android.bp +++ b/libs/gui/Android.bp @@ -25,9 +25,12 @@ cc_library_shared { }, clang: true, + cflags: [ + "-Wall", + "-Werror", + ], cppflags: [ "-Weverything", - "-Werror", // The static constructors and destructors in this library have not been noted to // introduce significant overheads diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index 7b2b5c37f1..5bee7a41f6 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -153,7 +153,10 @@ status_t Surface::getDisplayRefreshCycleDuration(nsecs_t* outRefreshDuration) { ATRACE_CALL(); DisplayStatInfo stats; - status_t err = composerService()->getDisplayStats(NULL, &stats); + status_t result = composerService()->getDisplayStats(NULL, &stats); + if (result != NO_ERROR) { + return result; + } *outRefreshDuration = stats.vsyncPeriod; diff --git a/libs/gui/tests/Android.bp b/libs/gui/tests/Android.bp index fa87f29aa1..908959ce1a 100644 --- a/libs/gui/tests/Android.bp +++ b/libs/gui/tests/Android.bp @@ -7,6 +7,10 @@ cc_test { test_suites: ["device-tests"], clang: true, + cflags: [ + "-Wall", + "-Werror", + ], srcs: [ "BufferItemConsumer_test.cpp", diff --git a/libs/gui/tests/CpuConsumer_test.cpp b/libs/gui/tests/CpuConsumer_test.cpp index 0982d7e9f4..588e54142f 100644 --- a/libs/gui/tests/CpuConsumer_test.cpp +++ b/libs/gui/tests/CpuConsumer_test.cpp @@ -310,8 +310,6 @@ void checkGreyscaleBuffer(const CpuConsumer::LockedBuffer &buf) { uint32_t h = buf.height; const int blockWidth = w > 16 ? w / 16 : 1; const int blockHeight = h > 16 ? h / 16 : 1; - const int blockRows = h / blockHeight; - const int blockCols = w / blockWidth; // Top-left square is bright checkPixel(buf, 0, 0, 191); @@ -349,8 +347,6 @@ void checkRgba8888Buffer(const CpuConsumer::LockedBuffer &buf) { uint32_t h = buf.height; const int blockWidth = w > 16 ? w / 16 : 1; const int blockHeight = h > 16 ? h / 16 : 1; - const int blockRows = h / blockHeight; - const int blockCols = w / blockWidth; // Top-left square is bright red checkPixel(buf, 0, 0, 191, 63, 63); @@ -392,8 +388,6 @@ void checkBayerRawBuffer(const CpuConsumer::LockedBuffer &buf) { uint32_t h = buf.height; const int blockWidth = (w > 16 ? w / 8 : 2) & ~0x1; const int blockHeight = (h > 16 ? h / 8 : 2) & ~0x1; - const int blockRows = h / blockHeight; - const int blockCols = w / blockWidth; // Top-left square is red checkPixel(buf, 0, 0, 1000, 200, 200); diff --git a/libs/gui/tests/SurfaceTextureGL_test.cpp b/libs/gui/tests/SurfaceTextureGL_test.cpp index c6745d034d..56392867ea 100644 --- a/libs/gui/tests/SurfaceTextureGL_test.cpp +++ b/libs/gui/tests/SurfaceTextureGL_test.cpp @@ -323,7 +323,6 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BuffersRepeatedly) { for (int j = 0; j < numTestPixels; j++) { int x = testPixels[j].x; int y = testPixels[j].y; - uint8_t value = 0; if (j == (i % numTestPixels)) { // We must y-invert the texture coords EXPECT_TRUE(checkPixel(x, texHeight-y-1, 255, 255, 255, 255)); diff --git a/libs/gui/tests/Surface_test.cpp b/libs/gui/tests/Surface_test.cpp index e18af17bde..e572e51b2c 100644 --- a/libs/gui/tests/Surface_test.cpp +++ b/libs/gui/tests/Surface_test.cpp @@ -1075,7 +1075,6 @@ TEST_F(GetFrameTimestampsTest, CompositorTimingUpdatesBasic) { EXPECT_EQ(initialCompositorTiming.presentLatency, compositeToPresentLatency); - const uint64_t fId1 = getNextFrameId(); dequeueAndQueue(0); addFrameEvents(true, NO_FRAME_INDEX, 0); @@ -1089,7 +1088,6 @@ TEST_F(GetFrameTimestampsTest, CompositorTimingUpdatesBasic) { EXPECT_EQ(initialCompositorTiming.presentLatency, compositeToPresentLatency); - const uint64_t fId2 = getNextFrameId(); dequeueAndQueue(1); addFrameEvents(true, 0, 1); @@ -1162,7 +1160,6 @@ TEST_F(GetFrameTimestampsTest, CompositorTimingDeadlineSnaps) { nsecs_t expectedDeadline = initialCompositorTiming.deadline; EXPECT_EQ(expectedDeadline, compositeDeadline); - const uint64_t fId1 = getNextFrameId(); dequeueAndQueue(0); addFrameEvents(true, NO_FRAME_INDEX, 0); @@ -1175,7 +1172,6 @@ TEST_F(GetFrameTimestampsTest, CompositorTimingDeadlineSnaps) { initialCompositorTiming.deadline +initialCompositorTiming.interval; EXPECT_EQ(expectedDeadline, compositeDeadline); - const uint64_t fId2 = getNextFrameId(); dequeueAndQueue(1); addFrameEvents(true, 0, 1); diff --git a/libs/ui/Android.bp b/libs/ui/Android.bp index 28b8ab3fa5..14c0d5cc29 100644 --- a/libs/ui/Android.bp +++ b/libs/ui/Android.bp @@ -20,9 +20,12 @@ cc_library_shared { }, clang: true, + cflags: [ + "-Wall", + "-Werror", + ], cppflags: [ "-Weverything", - "-Werror", // The static constructors and destructors in this library have not been noted to // introduce significant overheads diff --git a/libs/ui/GraphicBufferMapper.cpp b/libs/ui/GraphicBufferMapper.cpp index 5b0e7f6020..d5a30d7023 100644 --- a/libs/ui/GraphicBufferMapper.cpp +++ b/libs/ui/GraphicBufferMapper.cpp @@ -125,29 +125,6 @@ status_t GraphicBufferMapper::lockAsync(buffer_handle_t handle, return static_cast<status_t>(error); } -static inline bool isValidYCbCrPlane(const android_flex_plane_t& plane) { - if (plane.bits_per_component != 8) { - ALOGV("Invalid number of bits per component: %d", - plane.bits_per_component); - return false; - } - if (plane.bits_used != 8) { - ALOGV("Invalid number of bits used: %d", plane.bits_used); - return false; - } - - bool hasValidIncrement = plane.h_increment == 1 || - (plane.component != FLEX_COMPONENT_Y && plane.h_increment == 2); - hasValidIncrement = hasValidIncrement && plane.v_increment > 0; - if (!hasValidIncrement) { - ALOGV("Invalid increment: h %d v %d", plane.h_increment, - plane.v_increment); - return false; - } - - return true; -} - status_t GraphicBufferMapper::lockAsyncYCbCr(buffer_handle_t handle, uint32_t usage, const Rect& bounds, android_ycbcr *ycbcr, int fenceFd) { diff --git a/libs/ui/tests/Android.bp b/libs/ui/tests/Android.bp index 6733505090..08067fcf5d 100644 --- a/libs/ui/tests/Android.bp +++ b/libs/ui/tests/Android.bp @@ -18,10 +18,12 @@ cc_test { name: "Region_test", shared_libs: ["libui"], srcs: ["Region_test.cpp"], + cflags: ["-Wall", "-Werror"], } cc_test { name: "colorspace_test", shared_libs: ["libui"], srcs: ["colorspace_test.cpp"], + cflags: ["-Wall", "-Werror"], } |