From: Lionel Landwerlin Date: Fri, 15 Sep 2017 14:10:54 +0000 (+0100) Subject: vulkan: enum generator: align function declarations/prototypes X-Git-Tag: upstream/18.1.0~5826 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ac7b84672e094cb11922b6bd62b7e5e8ced52a8;p=platform%2Fupstream%2Fmesa.git vulkan: enum generator: align function declarations/prototypes Signed-off-by: Lionel Landwerlin Acked-by: Jason Ekstrand Reviewed-by: Chad Versace Reviewed-by: Dylan Baker --- diff --git a/src/vulkan/util/gen_enum_to_str.py b/src/vulkan/util/gen_enum_to_str.py index df326d0..aa7001e 100644 --- a/src/vulkan/util/gen_enum_to_str.py +++ b/src/vulkan/util/gen_enum_to_str.py @@ -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 % 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"""),