diff options
author | 2018-11-01 13:57:11 -0700 | |
---|---|---|
committer | 2018-11-01 15:25:23 -0700 | |
commit | 67004bc46d3b19c1fc4b27dbc6d0024b1c97e344 (patch) | |
tree | eed7157b38487bc0a3049c92c3cc119c11540668 | |
parent | 936b54b261d51e2edafdfe76b7ac908de37674bb (diff) |
annotate intentional fallthroughs in switch()
also disable the temporary 'suppress the warning' flags
Bug: 118756460
Test: compilation
Change-Id: Iefeb66be13099021940ec8bce2515c62052b9304
-rw-r--r-- | media/jni/Android.bp | 3 | ||||
-rw-r--r-- | media/jni/android_media_MediaScanner.cpp | 2 | ||||
-rw-r--r-- | media/jni/android_mtp_MtpDatabase.cpp | 1 |
3 files changed, 3 insertions, 3 deletions
diff --git a/media/jni/Android.bp b/media/jni/Android.bp index e84156716424..fa9ab1f72688 100644 --- a/media/jni/Android.bp +++ b/media/jni/Android.bp @@ -81,9 +81,6 @@ cc_library_shared { "-Wno-error=deprecated-declarations", "-Wunused", "-Wunreachable-code", - // Allow implicit fallthroughs in android_media_MediaScanner.cpp and - // android_mtp_MtpDatabase.cpp until they are fixed. - "-Wno-error=implicit-fallthrough", ], } diff --git a/media/jni/android_media_MediaScanner.cpp b/media/jni/android_media_MediaScanner.cpp index c0ceb0152271..58044c0307eb 100644 --- a/media/jni/android_media_MediaScanner.cpp +++ b/media/jni/android_media_MediaScanner.cpp @@ -27,6 +27,7 @@ #include <nativehelper/JNIHelp.h> #include "android_runtime/AndroidRuntime.h" #include "android_runtime/Log.h" +#include <android-base/macros.h> // for FALLTHROUGH_INTENDED using namespace android; @@ -92,6 +93,7 @@ static bool isValidUtf8(const char* bytes) { return false; } // Fall through to take care of the final byte. + FALLTHROUGH_INTENDED; case 0x0c: case 0x0d: // Bit pattern 110x, so there is one additional byte. diff --git a/media/jni/android_mtp_MtpDatabase.cpp b/media/jni/android_mtp_MtpDatabase.cpp index 4d8c96fadaa9..56b85b5167f5 100644 --- a/media/jni/android_mtp_MtpDatabase.cpp +++ b/media/jni/android_mtp_MtpDatabase.cpp @@ -1272,6 +1272,7 @@ MtpProperty* MtpDatabase::getDevicePropertyDesc(MtpDeviceProperty property) { case MTP_DEVICE_PROPERTY_DEVICE_FRIENDLY_NAME: writable = true; // fall through + FALLTHROUGH_INTENDED; case MTP_DEVICE_PROPERTY_IMAGE_SIZE: { result = new MtpProperty(property, MTP_TYPE_STR, writable); |