diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-07-20 19:07:57 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-07-20 19:07:57 +0400 |
commit | 49c61e169bb4114b63d99d842c27d533b8733f82 (patch) | |
tree | 2e57f7c064f31e5222ae1dbb8a6e2b1579bd7270 /source/blender | |
parent | 8ff67f12c79819cc06bb803ef79e7c97f73f2ef1 (diff) |
misc edits
- fix for missing None check with recent 'Hidden Wire' draw option.
- avoid int overflow with mesh selection.
- remove ';' outside of functions.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenlib/intern/BLI_kdopbvh.c | 3 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_select.c | 4 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_select.c | 6 | ||||
-rw-r--r-- | source/blender/editors/mesh/meshtools.c | 4 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_utils.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/jpeg.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_mesh.c | 2 |
7 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index cd5c961d982..a4c72aa26b0 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -72,7 +72,7 @@ struct BVHTree { /* optimization, ensure we stay small */ BLI_STATIC_ASSERT((sizeof(void *) == 8 && sizeof(BVHTree) <= 48) || (sizeof(void *) == 4 && sizeof(BVHTree) <= 32), - "over sized"); + "over sized") typedef struct BVHOverlapData { BVHTree *tree1, *tree2; @@ -603,6 +603,7 @@ static void build_implicit_tree_helper(BVHTree *tree, BVHBuildHelper *data) data->branches_on_level[0] = 1; /* We could stop the loop first (but I am lazy to find out when) */ + /* note: this often causes integer overflow, may be worth avoiding? - campbell */ for (depth = 1; depth < 32; depth++) { data->branches_on_level[depth] = data->branches_on_level[depth - 1] * data->tree_type; data->leafs_per_child[depth] = data->leafs_per_child[depth - 1] / data->tree_type; diff --git a/source/blender/editors/mask/mask_select.c b/source/blender/editors/mask/mask_select.c index 74d4f31754a..c524aeb06ee 100644 --- a/source/blender/editors/mask/mask_select.c +++ b/source/blender/editors/mask/mask_select.c @@ -812,12 +812,12 @@ static int mask_select_more_less(bContext *C, bool more) int i; bool start_sel, end_sel, prev_sel, cur_sel, cyclic = spline->flag & MASK_SPLINE_CYCLIC; - // reselect point if any handle is selected to make the result more predictable + /* reselect point if any handle is selected to make the result more predictable */ for (i = 0; i < spline->tot_point; i++) { BKE_mask_point_select_set(spline->points + i, MASKPOINT_ISSEL_ANY(spline->points + i)); } - // select more/less does not affect empty/single point splines + /* select more/less does not affect empty/single point splines */ if (spline->tot_point < 2) { continue; } diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index 7ec1113a75f..313974d1b9d 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -460,7 +460,7 @@ BMVert *EDBM_vert_find_nearest(ViewContext *vc, float *r_dist, const bool sel, c 0, NULL, NULL); } - eve = BM_vert_at_index(vc->em->bm, index - 1); + eve = index ? BM_vert_at_index(vc->em->bm, index - 1) : NULL; if (eve && distance < *r_dist) { *r_dist = distance; @@ -552,7 +552,7 @@ BMEdge *EDBM_edge_find_nearest(ViewContext *vc, float *r_dist) view3d_validate_backbuf(vc); index = view3d_sample_backbuf_rect(vc, vc->mval, 50, bm_solidoffs, bm_wireoffs, &distance, 0, NULL, NULL); - eed = BM_edge_at_index(vc->em->bm, index - 1); + eed = index ? BM_edge_at_index(vc->em->bm, index - 1) : NULL; if (eed && distance < *r_dist) { *r_dist = distance; @@ -625,7 +625,7 @@ BMFace *EDBM_face_find_nearest(ViewContext *vc, float *r_dist) view3d_validate_backbuf(vc); index = view3d_sample_backbuf(vc, vc->mval[0], vc->mval[1]); - efa = BM_face_at_index(vc->em->bm, index - 1); + efa = index ? BM_face_at_index(vc->em->bm, index - 1) : NULL; if (efa) { struct { float mval_fl[2]; float dist; BMFace *toFace; } data; diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 950482df555..d0adfc20f79 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -1200,7 +1200,7 @@ bool ED_mesh_pick_face(bContext *C, Object *ob, const int mval[2], unsigned int *index = view3d_sample_backbuf(&vc, mval[0], mval[1]); } - if ((*index) <= 0 || (*index) > (unsigned int)me->totpoly) + if ((*index) == 0 || (*index) > (unsigned int)me->totpoly) return false; (*index)--; @@ -1321,7 +1321,7 @@ bool ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int *index = view3d_sample_backbuf(&vc, mval[0], mval[1]); } - if ((*index) <= 0 || (*index) > (unsigned int)me->totvert) + if ((*index) == 0 || (*index) > (unsigned int)me->totvert) return false; (*index)--; diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index 8db9215a376..3ecde56b5d0 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -333,7 +333,7 @@ int imapaint_pick_face(ViewContext *vc, const int mval[2], unsigned int *index, /* sample only on the exact position */ *index = view3d_sample_backbuf(vc, mval[0], mval[1]); - if ((*index) <= 0 || (*index) > (unsigned int)totface) { + if ((*index) == 0 || (*index) > (unsigned int)totface) { return 0; } diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c index 9bb625a64b0..ed4f6d40cee 100644 --- a/source/blender/imbuf/intern/jpeg.c +++ b/source/blender/imbuf/intern/jpeg.c @@ -61,7 +61,7 @@ /* the types are from the jpeg lib */ static void jpeg_error(j_common_ptr cinfo) #ifdef __GNUC__ -__attribute__((noreturn)); +__attribute__((noreturn)) #endif ; static void init_source(j_decompress_ptr cinfo); diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 15a3861b778..51aad755e77 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -972,7 +972,7 @@ static int rna_Mesh_polygon_string_layers_length(PointerRNA *ptr) } /* Skin vertices */ -DEFINE_CUSTOMDATA_LAYER_COLLECTION(skin_vertice, vdata, CD_MVERT_SKIN); +DEFINE_CUSTOMDATA_LAYER_COLLECTION(skin_vertice, vdata, CD_MVERT_SKIN) static char *rna_MeshSkinVertexLayer_path(PointerRNA *ptr) { |