diff options
author | Jesse Hall <jessehall@google.com> | 2016-03-26 14:30:55 -0700 |
---|---|---|
committer | Jesse Hall <jessehall@google.com> | 2016-03-31 17:28:46 -0700 |
commit | 70d71055d7cd6ca2ff6fd214cb5d340844878200 (patch) | |
tree | 376947f981f4383e57db9ce3aafac0a503e9a76f | |
parent | 592651e843f3dd24d8104329da98e3dcbd2752e6 (diff) | |
download | vulkan-validation-layers-70d71055d7cd6ca2ff6fd214cb5d340844878200.tar.gz |
vkjson: Fix include paths and clang errors
Fixes issues discovered when trying to build vkjson as part of the
Android platform build system and a Clang 3.8-based compiler.
(a) Vulkan includes should be "<vulkan/...>".
(b) Clang issues a "missing field initializer" warning for "= {0}"
in C++. This is arguably incorrect, but "= {}" is defined to
recursively zero-initialize primitive types, so just use that.
(c) Clang correctly issues an error when a template parameter default
value is redefined.
(cherry picked from commit 66e6a3f23e9332bfae6219e97cb5616208d7f30c)
-rw-r--r-- | libs/vkjson/vkjson.cc | 8 | ||||
-rw-r--r-- | libs/vkjson/vkjson_device.cc | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/libs/vkjson/vkjson.cc b/libs/vkjson/vkjson.cc index 2910d421a..6e83ad891 100644 --- a/libs/vkjson/vkjson.cc +++ b/libs/vkjson/vkjson.cc @@ -39,8 +39,8 @@ #include <type_traits> #include <utility> -#include "cJSON.h" -#include "vk_sdk_platform.h" +#include <cJSON.h> +#include <vulkan/vk_sdk_platform.h> namespace { @@ -456,7 +456,7 @@ inline void VisitForWrite(Visitor* visitor, const T& t) { Iterate(visitor, const_cast<T*>(&t)); } -template <typename T, typename = EnableForStruct<T>, typename = void> +template <typename T, typename /*= EnableForStruct<T>*/, typename /*= void*/> cJSON* ToJsonValue(const T& value) { JsonWriterVisitor visitor; VisitForWrite(&visitor, value); @@ -634,7 +634,7 @@ class JsonReaderVisitor { std::string* errors_; }; -template <typename T, typename = EnableForStruct<T>> +template <typename T, typename /*= EnableForStruct<T>*/> bool AsValue(cJSON* json_value, T* t) { if (json_value->type != cJSON_Object) return false; diff --git a/libs/vkjson/vkjson_device.cc b/libs/vkjson/vkjson_device.cc index 9e96c7220..fc9540efe 100644 --- a/libs/vkjson/vkjson_device.cc +++ b/libs/vkjson/vkjson_device.cc @@ -65,7 +65,7 @@ VkJsonAllProperties VkJsonGetAllProperties(VkPhysicalDevice physical_device) { properties.layers.data()); } - VkFormatProperties format_properties = {0}; + VkFormatProperties format_properties = {}; for (VkFormat format = VK_FORMAT_R4G4_UNORM_PACK8; format <= VK_FORMAT_END_RANGE; format = static_cast<VkFormat>(format + 1)) { |