summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYiwei Zhang <zzyiwei@google.com>2018-10-16 10:05:23 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-10-16 10:05:23 -0700
commitd896cab7d08fdead09224084eaec3222b680db7a (patch)
tree77a94d3d3867b73cc9f1be4b31b41999329a8f4d
parentf7044acb2d92aff702b6f156ad3dd62e18910cca (diff)
parentc7e86caf44cf8eab04c891346b5c4ff194fe230d (diff)
downloadnative-d896cab7d08fdead09224084eaec3222b680db7a.tar.gz
Merge "Suppress implicit-fallthrough warnings."
am: c7e86caf44 Change-Id: I7a5f572c406d1caa0c263472d55837dcd0b6d109
-rw-r--r--vulkan/vkjson/Android.bp2
-rw-r--r--vulkan/vkjson/vkjson.cc2
-rw-r--r--vulkan/vkjson/vkjson.h6
3 files changed, 10 insertions, 0 deletions
diff --git a/vulkan/vkjson/Android.bp b/vulkan/vkjson/Android.bp
index e387165442..93620f4157 100644
--- a/vulkan/vkjson/Android.bp
+++ b/vulkan/vkjson/Android.bp
@@ -7,6 +7,7 @@ cc_library_static {
cflags: [
"-Wall",
"-Werror",
+ "-Wimplicit-fallthrough",
],
cppflags: [
"-std=c++11",
@@ -33,6 +34,7 @@ cc_library_static {
cflags: [
"-Wall",
"-Werror",
+ "-Wimplicit-fallthrough",
],
cppflags: [
"-std=c++11",
diff --git a/vulkan/vkjson/vkjson.cc b/vulkan/vkjson/vkjson.cc
index 62003839b7..efe622d782 100644
--- a/vulkan/vkjson/vkjson.cc
+++ b/vulkan/vkjson/vkjson.cc
@@ -766,6 +766,7 @@ inline bool Iterate(Visitor* visitor, VkJsonDevice* device) {
&device->external_fence_properties) &&
visitor->Visit("externalSemaphoreProperties",
&device->external_semaphore_properties);
+ FALLTHROUGH_INTENDED;
case VK_API_VERSION_1_0:
ret &= visitor->Visit("properties", &device->properties) &&
visitor->Visit("features", &device->features) &&
@@ -786,6 +787,7 @@ inline bool Iterate(Visitor* visitor, VkJsonInstance* instance) {
switch (instance->api_version ^ VK_VERSION_PATCH(instance->api_version)) {
case VK_API_VERSION_1_1:
ret &= visitor->Visit("deviceGroups", &instance->device_groups);
+ FALLTHROUGH_INTENDED;
case VK_API_VERSION_1_0:
ret &= visitor->Visit("layers", &instance->layers) &&
visitor->Visit("extensions", &instance->extensions) &&
diff --git a/vulkan/vkjson/vkjson.h b/vulkan/vkjson/vkjson.h
index 5e8428ab17..4f97c3ec88 100644
--- a/vulkan/vkjson/vkjson.h
+++ b/vulkan/vkjson/vkjson.h
@@ -41,6 +41,12 @@
#define VK_API_VERSION_1_1 VK_MAKE_VERSION(1, 1, 0)
#endif
+/*
+ * Annotation to tell clang that we intend to fall through from one case to
+ * another in a switch. Sourced from android-base/macros.h.
+ */
+#define FALLTHROUGH_INTENDED [[clang::fallthrough]]
+
struct VkJsonLayer {
VkLayerProperties properties;
std::vector<VkExtensionProperties> extensions;