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:
authorSybren A. Stüvel <sybren@blender.org>2020-07-03 18:30:31 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-07-03 18:42:46 +0300
commit33a74941c5fd4efb6eefcaace3315d3e2b65681f (patch)
tree2d3da68b73e4419750c7f767bbb78bf1a303ad18 /source/blender/editors/util/numinput.c
parent367034f210137754ab4f07a0e7793066d2b69e59 (diff)
Cleanup: Editors, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/editors` module. No functional changes.
Diffstat (limited to 'source/blender/editors/util/numinput.c')
-rw-r--r--source/blender/editors/util/numinput.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c
index be1319c37dd..3c747a29361 100644
--- a/source/blender/editors/util/numinput.c
+++ b/source/blender/editors/util/numinput.c
@@ -239,13 +239,12 @@ bool applyNumInput(NumInput *n, float *vec)
#endif
return true;
}
- else {
- /* Else, we set the 'org' values for numinput! */
- for (j = 0; j <= n->idx_max; j++) {
- n->val[j] = n->val_org[j] = vec[j];
- }
- return false;
+
+ /* Else, we set the 'org' values for numinput! */
+ for (j = 0; j <= n->idx_max; j++) {
+ n->val[j] = n->val_org[j] = vec[j];
}
+ return false;
}
static void value_to_editstr(NumInput *n, int idx)
@@ -291,12 +290,12 @@ bool user_string_to_number(
return BPY_execute_string_as_number(C, NULL, str_unit_convert, true, r_value);
}
- else {
- int success = BPY_execute_string_as_number(C, NULL, str, true, r_value);
- *r_value *= bUnit_PreferredInputUnitScalar(unit, type);
- *r_value /= unit_scale;
- return success;
- }
+
+ int success = BPY_execute_string_as_number(C, NULL, str, true, r_value);
+ *r_value *= bUnit_PreferredInputUnitScalar(unit, type);
+ *r_value /= unit_scale;
+ return success;
+
#else
UNUSED_VARS(C, unit, type);
*r_value = atof(str);
@@ -309,12 +308,10 @@ static bool editstr_is_simple_numinput(const char ascii)
if (ascii >= '0' && ascii <= '9') {
return true;
}
- else if (ascii == '.') {
+ if (ascii == '.') {
return true;
}
- else {
- return false;
- }
+ return false;
}
bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
@@ -348,7 +345,7 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
n->val_flag[idx] |= NUM_EDITED;
return true;
}
- else if (event->ctrl) {
+ if (event->ctrl) {
n->flag &= ~NUM_EDIT_FULL;
return true;
}