diff options
| author | Petr Kraus <petr_kraus@email.cz> | 2020-04-18 23:04:34 +0200 |
|---|---|---|
| committer | jeremyk-lunarg <jeremyk@lunarg.com> | 2020-04-20 13:20:56 -0600 |
| commit | 84463fe2902f4b50b54abe053684e6fcb7a60c4f (patch) | |
| tree | 031ca4f4b241f263cc2b7cf252af4760dde0ae67 | |
| parent | 8824107d57d32b613e1365bdb1fdd79e02be022b (diff) | |
| download | usermoji-84463fe2902f4b50b54abe053684e6fcb7a60c4f.tar.xz | |
repo: Update the clang style from VVL
| -rw-r--r-- | .clang-format | 1 | ||||
| -rw-r--r-- | cube/object_type_string_helper.h | 9 | ||||
| -rw-r--r-- | vulkaninfo/outputprinter.h | 16 | ||||
| -rw-r--r-- | vulkaninfo/vulkaninfo.h | 10 |
4 files changed, 17 insertions, 19 deletions
diff --git a/.clang-format b/.clang-format index 0af4d400..453527f9 100644 --- a/.clang-format +++ b/.clang-format @@ -2,6 +2,7 @@ # Use defaults from the Google style with the following exceptions: BasedOnStyle: Google IndentWidth: 4 +AccessModifierOffset: -2 ColumnLimit: 132 SortIncludes: false ... diff --git a/cube/object_type_string_helper.h b/cube/object_type_string_helper.h index 15be12d9..692f7a83 100644 --- a/cube/object_type_string_helper.h +++ b/cube/object_type_string_helper.h @@ -20,18 +20,15 @@ * ****************************************************************************/ - #pragma once #ifdef _WIN32 -#pragma warning( disable : 4065 ) +#pragma warning(disable : 4065) #endif #include <vulkan/vulkan.h> -static inline const char* string_VkObjectType(VkObjectType input_value) -{ - switch ((VkObjectType)input_value) - { +static inline const char* string_VkObjectType(VkObjectType input_value) { + switch ((VkObjectType)input_value) { case VK_OBJECT_TYPE_QUERY_POOL: return "VK_OBJECT_TYPE_QUERY_POOL"; case VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION: diff --git a/vulkaninfo/outputprinter.h b/vulkaninfo/outputprinter.h index 6cce4e2c..edcb8cba 100644 --- a/vulkaninfo/outputprinter.h +++ b/vulkaninfo/outputprinter.h @@ -66,7 +66,7 @@ std::string VkVersionString(VulkanVersion v) { enum class OutputType { text, html, json, vkconfig_output }; class Printer { - public: + public: Printer(OutputType output_type, std::ostream &out, const uint32_t selected_gpu, const VulkanVersion vulkan_version) : output_type(output_type), out(out) { switch (output_type) { @@ -654,7 +654,7 @@ class Printer { return input; } - protected: + protected: OutputType output_type; std::ostream &out; int indents = 0; @@ -696,7 +696,7 @@ class Printer { // always desired, requiring a manual decrease of indention. This wrapper facilitates that while also // automatically re-indenting the output to the previous indent level on scope exit. class IndentWrapper { - public: + public: IndentWrapper(Printer &p) : p(p) { if (p.Type() == OutputType::text) p.IndentDecrease(); } @@ -704,29 +704,29 @@ class IndentWrapper { if (p.Type() == OutputType::text) p.IndentIncrease(); } - private: + private: Printer &p; }; class ObjectWrapper { - public: + public: ObjectWrapper(Printer &p, std::string object_name) : p(p) { p.ObjectStart(object_name); } ObjectWrapper(Printer &p, std::string object_name, size_t count_subobjects) : p(p) { p.ObjectStart(object_name, static_cast<int32_t>(count_subobjects)); } ~ObjectWrapper() { p.ObjectEnd(); } - private: + private: Printer &p; }; class ArrayWrapper { - public: + public: ArrayWrapper(Printer &p, std::string array_name, size_t element_count = 0) : p(p) { p.ArrayStart(array_name, static_cast<int32_t>(element_count)); } ~ArrayWrapper() { p.ArrayEnd(); } - private: + private: Printer &p; };
\ No newline at end of file diff --git a/vulkaninfo/vulkaninfo.h b/vulkaninfo/vulkaninfo.h index c92f93ba..63467d45 100644 --- a/vulkaninfo/vulkaninfo.h +++ b/vulkaninfo/vulkaninfo.h @@ -84,7 +84,7 @@ struct FileLineException : std::runtime_error { ~FileLineException() throw() {} const char *what() const throw() { return msg.c_str(); } - private: + private: std::string msg; }; #define THROW_ERR(arg) throw FileLineException(arg, __FILE__, __LINE__); @@ -97,7 +97,7 @@ struct VulkanException : std::runtime_error { ~VulkanException() throw() {} const char *what() const throw() { return msg.c_str(); } - private: + private: std::string msg; }; #define THROW_VK_ERR(func_name, err) throw VulkanException(func_name, __FILE__, __LINE__, err); @@ -424,7 +424,7 @@ struct VkDll { #endif // VK_USE_PLATFORM_METAL_EXT } - private: + private: template <typename T> void Load(T &func_dest, const char *func_name) { #if defined(__linux__) @@ -478,7 +478,7 @@ struct ExtensionFunctions { Load(vkGetPhysicalDeviceToolPropertiesEXT, "vkGetPhysicalDeviceToolPropertiesEXT"); } - private: + private: PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr; VkInstance instance; template <typename T> @@ -1108,7 +1108,7 @@ void SetupWindowExtensions(AppInstance &inst) { // ---------- Surfaces -------------- // class AppSurface { - public: + public: AppInstance &inst; VkPhysicalDevice phys_device; SurfaceExtension surface_extension; |
