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>2018-12-01 11:36:57 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-12-01 11:36:57 +0300
commit40f45a7eac620fd8b99b3f29f3d0cac3c855dc84 (patch)
treeb42ed461143b7347d86cefe40d051d0585f460e8 /source/blender/editors
parent0f5b53ba4dc03f89b43a633f73a59594e709ab11 (diff)
Cleanup: redundant NULL checks
Also use unsigned shifting for values not in int range.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/include/UI_interface.h2
-rw-r--r--source/blender/editors/screen/area.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_gizmo_ruler.c2
-rw-r--r--source/blender/editors/transform/transform_snap_object.c9
4 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index dac1ca95eff..776c9459acc 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -195,7 +195,7 @@ enum {
UI_BUT_TEXTEDIT_UPDATE = (1 << 29), /* when widget is in textedit mode, update value on each char stroke */
UI_BUT_VALUE_CLEAR = (1 << 30), /* show 'x' icon to clear/unlink value of text or search button */
- UI_BUT_OVERRIDEN = (1 << 31), /* RNA property of the button is overridden from linked reference data. */
+ UI_BUT_OVERRIDEN = (1u << 31u), /* RNA property of the button is overridden from linked reference data. */
};
#define UI_PANEL_WIDTH 340
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 94b30f8e3b0..9e73fea12ce 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1354,7 +1354,7 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, rct
if (ar->winy > 1) ar->sizey = (ar->winy + 0.5f) / UI_DPI_FAC;
/* exception for multiple overlapping regions on same spot */
- if (ar->overlap & (alignment != RGN_ALIGN_FLOAT)) {
+ if (ar->overlap && (alignment != RGN_ALIGN_FLOAT)) {
region_overlap_fix(sa, ar);
}
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
index 96fbe1d48a6..83db61f9e5a 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
@@ -306,13 +306,13 @@ static bool view3d_ruler_item_mousemove(
RulerInfo *ruler_info, RulerItem *ruler_item, const int mval[2],
const bool do_thickness, const bool do_snap)
{
- RulerInteraction *inter = ruler_item->gz.interaction_data;
const float eps_bias = 0.0002f;
float dist_px = MVAL_MAX_PX_DIST * U.pixelsize; /* snap dist */
ruler_info->snap_flag &= ~RULER_SNAP_OK;
if (ruler_item) {
+ RulerInteraction *inter = ruler_item->gz.interaction_data;
float *co = ruler_item->co[inter->co_index];
/* restore the initial depth */
copy_v3_v3(co, inter->drag_start_co);
diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c
index 176e1852b01..5a54e4153cb 100644
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@ -1253,10 +1253,7 @@ static short snap_mesh_polygon(
normalize_v3(r_no);
}
- if (r_index) {
- *r_index = nearest.index;
- }
-
+ *r_index = nearest.index;
return elem;
}
@@ -1355,9 +1352,7 @@ static short snap_mesh_edge_verts_mixed(
normalize_v3(r_no);
}
- if (r_index) {
- *r_index = nearest.index;
- }
+ *r_index = nearest.index;
}
return elem;