[Bf-blender-cvs] [1bde690e91a] master: Cleanup: style, use braces for editor/interface
Campbell Barton
noreply at git.blender.org
Tue Mar 26 11:17:53 CET 2019
Commit: 1bde690e91ab0b27e0da816c7ebcf98ad6459bb6
Author: Campbell Barton
Date: Tue Mar 26 21:16:13 2019 +1100
Branches: master
https://developer.blender.org/rB1bde690e91ab0b27e0da816c7ebcf98ad6459bb6
Cleanup: style, use braces for editor/interface
===================================================================
M source/blender/editors/interface/interface_handlers.c
M source/blender/editors/interface/interface_layout.c
M source/blender/editors/interface/interface_ops.c
===================================================================
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 968d41d9795..404de2cd085 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -2555,8 +2555,9 @@ static int ui_text_position_from_hidden(uiBut *but, int pos)
butstr = (but->editstr) ? but->editstr : but->drawstr;
- for (i = 0, strpos = butstr; i < pos; i++)
+ for (i = 0, strpos = butstr; i < pos; i++) {
strpos = BLI_str_find_next_char_utf8(strpos, NULL);
+ }
return (strpos - butstr);
}
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 1bb32cdeeee..e2933f75440 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -3279,8 +3279,9 @@ static void ui_litem_estimate_column_flow(uiLayout *litem)
flow->totcol = max_ii(litem->root->emw / maxw, 1);
flow->totcol = min_ii(flow->totcol, totitem);
}
- else
+ else {
flow->totcol = flow->number;
+ }
/* compute sizes */
x = 0;
@@ -3614,7 +3615,10 @@ static void ui_litem_estimate_grid_flow(uiLayout *litem)
for (gflow->tot_rows = (int)ceilf((float)gflow->tot_items / gflow->tot_columns);
(gflow->tot_columns - step) > 0 &&
(int)ceilf((float)gflow->tot_items / (gflow->tot_columns - step)) <= gflow->tot_rows;
- gflow->tot_columns -= step);
+ gflow->tot_columns -= step)
+ {
+ /* pass */
+ }
}
else {
/* Adjust number of rows to be multiple of given modulo. */
@@ -3625,7 +3629,10 @@ static void ui_litem_estimate_grid_flow(uiLayout *litem)
for (gflow->tot_columns = (int)ceilf((float)gflow->tot_items / gflow->tot_rows);
(gflow->tot_rows - step) > 0 &&
(int)ceilf((float)gflow->tot_items / (gflow->tot_rows - step)) <= gflow->tot_columns;
- gflow->tot_rows -= step);
+ gflow->tot_rows -= step)
+ {
+ /* pass */
+ }
}
}
@@ -4417,8 +4424,9 @@ static void ui_item_flag(uiLayout *litem, int flag)
bitem = (uiButtonItem *)item;
bitem->but->flag |= flag;
}
- else
+ else {
ui_item_flag((uiLayout *)item, flag);
+ }
}
}
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index 97dd79864e1..e00ea2d16bd 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -1313,8 +1313,9 @@ static void edittranslation_find_po_file(const char *root, const char *uilng, ch
tc = strchr(uilng, '_');
if (tc) {
szt = tc - uilng;
- if (szt < sizeof(tstr)) /* Paranoid, should always be true! */
+ if (szt < sizeof(tstr)) { /* Paranoid, should always be true! */
BLI_strncpy(tstr, uilng, szt + 1); /* +1 for '\0' char! */
+ }
}
if (tstr[0]) {
/* Because of some codes like sr_SR at latin... */
More information about the Bf-blender-cvs
mailing list