Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-22 05:20:14 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-22 12:48:17 +0300
commit7d6a9b551759cf3f1cca0c6d8ecb1459d02dcc28 (patch)
tree38a07e8238a559d0e72f10b91ee149dc62a131b3 /source/blender/blentranslation
parentb102472551c351d8be8ebf96e3e44a5454f02d0a (diff)
Cleanup: style, use braces
Add braces for modules already using braces almost everywhere.
Diffstat (limited to 'source/blender/blentranslation')
-rw-r--r--source/blender/blentranslation/intern/blt_lang.c33
-rw-r--r--source/blender/blentranslation/msgfmt/msgfmt.c11
2 files changed, 29 insertions, 15 deletions
diff --git a/source/blender/blentranslation/intern/blt_lang.c b/source/blender/blentranslation/intern/blt_lang.c
index 52d15a29fc2..75a4681deb2 100644
--- a/source/blender/blentranslation/intern/blt_lang.c
+++ b/source/blender/blentranslation/intern/blt_lang.c
@@ -108,8 +108,9 @@ static void fill_locales(void)
continue; /* Comment or void... */
}
t = atoi(str);
- if (t >= num_locales)
+ if (t >= num_locales) {
num_locales = t + 1;
+ }
num_locales_menu++;
line = line->next;
}
@@ -261,8 +262,9 @@ void BLT_lang_set(const char *str)
const char *short_locale = str ? str : LOCALE(ulang);
const char *short_locale_utf8 = NULL;
- if ((U.transopts & USER_DOTRANSLATE) == 0)
+ if ((U.transopts & USER_DOTRANSLATE) == 0) {
return;
+ }
/* We want to avoid locales like '.UTF-8'! */
if (short_locale[0]) {
@@ -331,36 +333,45 @@ void BLT_lang_locale_explode(const char *locale,
if (language || language_variant) {
if (m1 || m2) {
_t = m1 ? BLI_strdupn(locale, m1 - locale) : BLI_strdupn(locale, m2 - locale);
- if (language)
+ if (language) {
*language = _t;
+ }
}
else if (language) {
*language = BLI_strdup(locale);
}
}
if (country) {
- if (m1)
+ if (m1) {
*country = m2 ? BLI_strdupn(m1 + 1, m2 - (m1 + 1)) : BLI_strdup(m1 + 1);
- else
+ }
+ else {
*country = NULL;
+ }
}
if (variant) {
- if (m2)
+ if (m2) {
*variant = BLI_strdup(m2 + 1);
- else
+ }
+ else {
*variant = NULL;
+ }
}
if (language_country) {
- if (m1)
+ if (m1) {
*language_country = m2 ? BLI_strdupn(locale, m2 - locale) : BLI_strdup(locale);
- else
+ }
+ else {
*language_country = NULL;
+ }
}
if (language_variant) {
- if (m2)
+ if (m2) {
*language_variant = m1 ? BLI_strdupcat(_t, m2) : BLI_strdup(locale);
- else
+ }
+ else {
*language_variant = NULL;
+ }
}
if (_t && !language) {
MEM_freeN(_t);
diff --git a/source/blender/blentranslation/msgfmt/msgfmt.c b/source/blender/blentranslation/msgfmt/msgfmt.c
index 4ab0bd29a5f..500ae2df4b5 100644
--- a/source/blender/blentranslation/msgfmt/msgfmt.c
+++ b/source/blender/blentranslation/msgfmt/msgfmt.c
@@ -82,12 +82,15 @@ static char *trim(char *str)
return str;
}
- for (i = 0; i < len && ELEM(str[0], ' ', '\t', '\n'); str++, i++)
- ;
+ for (i = 0; i < len && ELEM(str[0], ' ', '\t', '\n'); str++, i++) {
+ /* pass */
+ }
char *end = &str[len - 1 - i];
- for (i = len; i > 0 && ELEM(end[0], ' ', '\t', '\n'); end--, i--)
- ;
+ for (i = len; i > 0 && ELEM(end[0], ' ', '\t', '\n'); end--, i--) {
+ /* pass */
+ }
+
end[1] = '\0';
return str;