vulkan: enum generator: align function declarations/prototypes
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Fri, 15 Sep 2017 14:10:54 +0000 (15:10 +0100)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 22 Sep 2017 14:47:34 +0000 (07:47 -0700)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
src/vulkan/util/gen_enum_to_str.py

index df326d0a998a2a8649d6a53512b18336616545f9..aa7001ef13fc86843dd53ef5befff2dc1eae1c3c 100644 (file)
@@ -64,27 +64,27 @@ C_TEMPLATE = Template(textwrap.dedent(u"""\
 
     % for enum in enums:
 
-        const char *
-        vk_${enum.name[2:]}_to_str(${enum.name} input)
-        {
-            switch(input) {
-            % for v in enum.values:
-                % if v in FOREIGN_ENUM_VALUES:
-
-                #pragma GCC diagnostic push
-                #pragma GCC diagnostic ignored "-Wswitch"
-                % endif
-                case ${v}:
-                    return "${v}";
-                % if v in FOREIGN_ENUM_VALUES:
-                #pragma GCC diagnostic pop
-
-                % endif
-            % endfor
-            default:
-                unreachable("Undefined enum value.");
-            }
+    const char *
+    vk_${enum.name[2:]}_to_str(${enum.name} input)
+    {
+        switch(input) {
+        % for v in enum.values:
+            % if v in FOREIGN_ENUM_VALUES:
+
+            #pragma GCC diagnostic push
+            #pragma GCC diagnostic ignored "-Wswitch"
+            % endif
+            case ${v}:
+                return "${v}";
+            % if v in FOREIGN_ENUM_VALUES:
+            #pragma GCC diagnostic pop
+
+            % endif
+        % endfor
+        default:
+            unreachable("Undefined enum value.");
         }
+    }
     %endfor"""),
     output_encoding='utf-8')
 
@@ -102,7 +102,7 @@ H_TEMPLATE = Template(textwrap.dedent(u"""\
     #include <vulkan/vk_android_native_buffer.h>
 
     % for enum in enums:
-        const char * vk_${enum.name[2:]}_to_str(${enum.name} input);
+    const char * vk_${enum.name[2:]}_to_str(${enum.name} input);
     % endfor
 
     #endif"""),