[Bf-blender-cvs] [192940e8c2c] blender-v2.82-release: Cleanup: bad brace placement for manually formatted blocks

Campbell Barton noreply at git.blender.org
Fri Jan 17 08:12:55 CET 2020


Commit: 192940e8c2c86613e4cdca82ad772aa210fc96e0
Author: Campbell Barton
Date:   Fri Jan 17 18:11:50 2020 +1100
Branches: blender-v2.82-release
https://developer.blender.org/rB192940e8c2c86613e4cdca82ad772aa210fc96e0

Cleanup: bad brace placement for manually formatted blocks

===================================================================

M	source/blender/editors/space_text/text_format_lua.c
M	source/blender/editors/space_text/text_format_osl.c
M	source/blender/editors/space_text/text_format_pov.c
M	source/blender/editors/space_text/text_format_pov_ini.c
M	source/blender/editors/space_text/text_format_py.c

===================================================================

diff --git a/source/blender/editors/space_text/text_format_lua.c b/source/blender/editors/space_text/text_format_lua.c
index 935e288c7be..6bbb0d529ab 100644
--- a/source/blender/editors/space_text/text_format_lua.c
+++ b/source/blender/editors/space_text/text_format_lua.c
@@ -66,7 +66,8 @@ static int txtfmt_lua_find_keyword(const char *string)
   } else if (STR_LITERAL_STARTSWITH(string, "then",     len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "until",    len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "while",    len)) { i = len;
-  } else {                                                      i = 0; }
+  } else                                                      { i = 0;
+  }
 
   /* clang-format on */
 
@@ -123,7 +124,8 @@ static int txtfmt_lua_find_specialvar(const char *string)
   } else if (STR_LITERAL_STARTSWITH(string, "unpack",           len)) {   i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "_VERSION",         len)) {   i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "xpcall",           len)) {   i = len;
-  } else {                                                                i = 0; }
+  } else                                                              {   i = 0;
+  }
 
   /* clang-format on */
 
@@ -144,7 +146,8 @@ static int txtfmt_lua_find_bool(const char *string)
   if        (STR_LITERAL_STARTSWITH(string, "nil",    len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "true",   len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "false",  len)) { i = len;
-  } else {                                                    i = 0; }
+  } else                                                    { i = 0;
+  }
 
   /* clang-format on */
 
@@ -164,7 +167,8 @@ static char txtfmt_lua_format_identifier(const char *str)
 
   if        ((txtfmt_lua_find_specialvar(str))  != -1) { fmt = FMT_TYPE_SPECIAL;
   } else if ((txtfmt_lua_find_keyword(str))     != -1) { fmt = FMT_TYPE_KEYWORD;
-  } else {                                               fmt = FMT_TYPE_DEFAULT; }
+  } else                                               { fmt = FMT_TYPE_DEFAULT;
+  }
 
   /* clang-format on */
 
@@ -308,9 +312,9 @@ static void txtfmt_lua_format_line(SpaceText *st, TextLine *line, const bool do_
 
         /* Special vars(v) or built-in keywords(b) */
         /* keep in sync with 'txtfmt_osl_format_identifier()' */
-        if      ((i = txtfmt_lua_find_specialvar(str))   != -1) { prev = FMT_TYPE_SPECIAL;
+        if        ((i = txtfmt_lua_find_specialvar(str))   != -1) { prev = FMT_TYPE_SPECIAL;
         } else if ((i = txtfmt_lua_find_keyword(str))      != -1) { prev = FMT_TYPE_KEYWORD;
-}
+        }
 
         /* clang-format on */
 
diff --git a/source/blender/editors/space_text/text_format_osl.c b/source/blender/editors/space_text/text_format_osl.c
index 2da4488e901..0275a293e7a 100644
--- a/source/blender/editors/space_text/text_format_osl.c
+++ b/source/blender/editors/space_text/text_format_osl.c
@@ -64,8 +64,8 @@ static int txtfmt_osl_find_builtinfunc(const char *string)
   } else if (STR_LITERAL_STARTSWITH(string, "vector",       len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "void",         len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "while",        len)) { i = len;
-  } else {                                                          i = 0;
-}
+  } else                                                          { i = 0;
+  }
 
   /* clang-format on */
 
@@ -122,8 +122,8 @@ static int txtfmt_osl_find_reserved(const char *string)
   } else if (STR_LITERAL_STARTSWITH(string, "varying",      len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "virtual",      len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "volatile",     len)) { i = len;
-  } else {                                                          i = 0;
-}
+  } else                                                          { i = 0;
+  }
 
   /* clang-format on */
 
@@ -153,8 +153,8 @@ static int txtfmt_osl_find_specialvar(const char *string)
   } else if (STR_LITERAL_STARTSWITH(string, "surface",      len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "volume",       len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "displacement", len)) { i = len;
-  } else {                                                    i = 0;
-}
+  } else                                                          { i = 0;
+  }
 
   /* clang-format on */
 
@@ -193,8 +193,8 @@ static char txtfmt_osl_format_identifier(const char *str)
   } else if ((txtfmt_osl_find_builtinfunc(str))  != -1) { fmt = FMT_TYPE_KEYWORD;
   } else if ((txtfmt_osl_find_reserved(str))     != -1) { fmt = FMT_TYPE_RESERVED;
   } else if ((txtfmt_osl_find_preprocessor(str)) != -1) { fmt = FMT_TYPE_DIRECTIVE;
-  } else {                                                fmt = FMT_TYPE_DEFAULT;
-}
+  } else                                                { fmt = FMT_TYPE_DEFAULT;
+  }
 
   /* clang-format on */
 
@@ -327,7 +327,7 @@ static void txtfmt_osl_format_line(SpaceText *st, TextLine *line, const bool do_
         } else if ((i = txtfmt_osl_find_builtinfunc(str))  != -1) { prev = FMT_TYPE_KEYWORD;
         } else if ((i = txtfmt_osl_find_reserved(str))     != -1) { prev = FMT_TYPE_RESERVED;
         } else if ((i = txtfmt_osl_find_preprocessor(str)) != -1) { prev = FMT_TYPE_DIRECTIVE;
-}
+        }
 
         /* clang-format on */
 
diff --git a/source/blender/editors/space_text/text_format_pov.c b/source/blender/editors/space_text/text_format_pov.c
index 21df7b5b76a..13830aa7c4d 100644
--- a/source/blender/editors/space_text/text_format_pov.c
+++ b/source/blender/editors/space_text/text_format_pov.c
@@ -80,8 +80,8 @@ static int txtfmt_pov_find_keyword(const char *string)
   } else if (STR_LITERAL_STARTSWITH(string, "end",         len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "for",         len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "if",          len)) { i = len;
-  } else {                                                         i = 0;
-}
+  } else                                                         { i = 0;
+  }
 
   /* clang-format on */
 
@@ -239,8 +239,8 @@ static int txtfmt_pov_find_reserved_keywords(const char *string)
   } else if (STR_LITERAL_STARTSWITH(string, "vstr",               len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "chr",                len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "str",                len)) { i = len;
-  } else {                                                                i = 0;
-}
+  } else                                                                { i = 0;
+  }
 
   /* clang-format on */
 
@@ -475,8 +475,8 @@ static int txtfmt_pov_find_reserved_builtins(const char *string)
   } else if (STR_LITERAL_STARTSWITH(string, "x",                   len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "y",                   len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "z",                   len)) { i = len;
-  } else {                                                                 i = 0;
-}
+  } else                                                                 { i = 0;
+  }
 
   /* clang-format off */
 
@@ -695,8 +695,8 @@ static int txtfmt_pov_find_specialvar(const char *string)
   } else if (STR_LITERAL_STARTSWITH(string, "edwards",                  len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "peters",                   len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "gall",                     len)) { i = len;
-  } else {                                                                i = 0;
-}
+  } else                                                                      { i = 0;
+  }
 
   /* If next source char is an identifier (eg. 'i' in "definite") no match */
   return (i == 0 || text_check_identifier(string[i])) ? -1 : i;
@@ -746,8 +746,8 @@ static int txtfmt_pov_find_bool(const char *string)
   } else if (STR_LITERAL_STARTSWITH(string, "sys",                 len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "tga",                 len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "ttf",                 len)) { i = len;
-  } else {                                                                 i = 0;
-}
+  } else                                                                 { i = 0;
+  }
 
   /* clang-format on */
 
@@ -762,12 +762,12 @@ static char txtfmt_pov_format_identifier(const char *str)
   /* Keep aligned args for readability. */
   /* clang-format off */
 
-  if      ((txtfmt_pov_find_specialvar(str))        != -1) { fmt = FMT_TYPE_SPECIAL;
+  if        ((txtfmt_pov_find_specialvar(str))        != -1) { fmt = FMT_TYPE_SPECIAL;
   } else if ((txtfmt_pov_find_keyword(str))           != -1) { fmt = FMT_TYPE_KEYWORD;
   } else if ((txtfmt_pov_find_reserved_keywords(str)) != -1) { fmt = FMT_TYPE_RESERVED;
   } else if ((txtfmt_pov_find_reserved_builtins(str)) != -1) { fmt = FMT_TYPE_DIRECTIVE;
-  } else {                                                     fmt = FMT_TYPE_DEFAULT;
-}
+  } else                                                     { fmt = FMT_TYPE_DEFAULT;
+  }
 
   /* clang-format on */
 
@@ -905,11 +905,11 @@ static void txtfmt_pov_format_line(SpaceText *st, TextLine *line, const bool do_
 
         /* Special vars(v) or built-in keywords(b) */
         /* keep in sync with 'txtfmt_pov_format_identifier()' */
-        if      ((i = txtfmt_pov_find_specialvar(str))        != -1) { prev = FMT_TYPE_SPECIAL;
+        if        ((i = txtfmt_pov_find_specialvar(str))        != -1) { prev = FMT_TYPE_SPECIAL;
         } else if ((i = txtfmt_pov_find_keyword(str))           != -1) { prev = FMT_TYPE_KEYWORD;
         } else if ((i = txtfmt_pov_find_reserved_keywords(str)) != -1) { prev = FMT_TYPE_RESERVED;
         } else if ((i = txtfmt_pov_find_reserved_builtins(str)) != -1) { prev = FMT_TYPE_DIRECTIVE;
-}
+        }
 
         /* clang-format on */
 
diff --git a/source/blender/editors/space_text/text_format_pov_ini.c b/source/blender/editors/space_text/text_format_pov_ini.c
index b349b38e

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list