Suppress implicit-fallthrough warnings.
Add FALLTHROUGH_INTENDED for clang compiler.
Bug: 112564944
Test: build with global -Wimplicit-fallthrough.
Change-Id: I40f8bbf94e207c9dd90921e9b762ba51abab5777
diff --git a/libpixelflinger/buffer.cpp b/libpixelflinger/buffer.cpp
index dcb95c5..ea9514c 100644
--- a/libpixelflinger/buffer.cpp
+++ b/libpixelflinger/buffer.cpp
@@ -18,6 +18,8 @@
#include <assert.h>
+#include <android-base/macros.h>
+
#include "buffer.h"
namespace android {
@@ -266,8 +268,11 @@
p = downshift_component(p, b, hbits, lbits, f->bh, f->bl, 0, 1, -1);
p = downshift_component(p, a, hbits, lbits, f->ah, f->al, 0, 1, -1);
switch (f->size) {
- case 1: p |= p << 8; // fallthrough
- case 2: p |= p << 16;
+ case 1:
+ p |= p << 8;
+ FALLTHROUGH_INTENDED;
+ case 2:
+ p |= p << 16;
}
return p;
}