repo: Update the clang style from VVL
authorPetr Kraus <petr_kraus@email.cz>
Sat, 18 Apr 2020 21:04:34 +0000 (23:04 +0200)
committerjeremyk-lunarg <jeremyk@lunarg.com>
Mon, 20 Apr 2020 19:20:56 +0000 (13:20 -0600)
.clang-format
cube/object_type_string_helper.h
vulkaninfo/outputprinter.h
vulkaninfo/vulkaninfo.h

index 0af4d40..453527f 100644 (file)
@@ -2,6 +2,7 @@
 # Use defaults from the Google style with the following exceptions:
 BasedOnStyle: Google
 IndentWidth: 4
+AccessModifierOffset: -2
 ColumnLimit: 132
 SortIncludes: false
 ...
index 15be12d..692f7a8 100644 (file)
  *
  ****************************************************************************/
 
-
 #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:
index 6cce4e2..edcb8cb 100644 (file)
@@ -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
index c92f93b..63467d4 100644 (file)
@@ -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;