code cleanup
authorCampbell Barton <ideasman42@gmail.com>
Sun, 23 Dec 2012 16:09:26 +0000 (16:09 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 23 Dec 2012 16:09:26 +0000 (16:09 +0000)
source/blender/blenkernel/intern/image.c
source/blender/blenlib/intern/BLI_kdopbvh.c
source/blender/blenlib/intern/math_vector_inline.c
source/blender/bmesh/tools/bmesh_bevel.c
source/blender/bmesh/tools/bmesh_decimate_unsubdivide.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/modifiers/intern/MOD_weightvgmix.c

index 0e83f0f..7782afa 100644 (file)
@@ -1168,6 +1168,7 @@ char BKE_imtype_from_arg(const char *imtype_arg)
 static int do_add_image_extension(char *string, const char imtype, const ImageFormatData *im_format)
 {
        const char *extension = NULL;
+       (void)im_format;  /* may be unused, depends on build options */
 
        if (imtype == R_IMF_IMTYPE_IRIS) {
                if (!BLI_testextensie(string, ".rgb"))
index 55f67ce..b2d07b9 100644 (file)
@@ -1554,7 +1554,7 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float co[3], const float dir[3], f
 float BLI_bvhtree_bb_raycast(const float bv[6], const float light_start[3], const float light_end[3], float pos[3])
 {
        BVHRayCastData data;
-       float dist = 0.0;
+       float dist;
 
        data.hit.dist = FLT_MAX;
        
index 04b9d57..8c62fdf 100644 (file)
@@ -461,7 +461,7 @@ MINLINE void mul_v3_v3v3(float r[3], const float v1[3], const float v2[3])
        r[2] = v1[2] * v2[2];
 }
 
-MINLINE void negate_v2(float r[3])
+MINLINE void negate_v2(float r[2])
 {
        r[0] = -r[0];
        r[1] = -r[1];
index fbac538..50e59ab 100644 (file)
@@ -1276,7 +1276,7 @@ static void bevel_build_trifan(BMesh *bm, BevVert *bv)
                                else { BLI_assert(0); }
                        }
                        else {
-                               if      (l_fan->v       == v_fan) { l_fan = l_fan; }
+                               if      (l_fan->v       == v_fan) { /* l_fan = l_fan; */ }
                                else if (l_fan->next->v == v_fan) { l_fan = l_fan->next; }
                                else if (l_fan->prev->v == v_fan) { l_fan = l_fan->prev; }
                                else { BLI_assert(0); }
index acdab25..71c1ced 100644 (file)
@@ -268,7 +268,7 @@ void BM_mesh_decimate_unsubdivide_ex(BMesh *bm, const int iterations, const int
                        BMW_end(&walker);
 #else
 
-                       BM_elem_index_set(v_first, (offset + depth) % nth ? VERT_INDEX_IGNORE : VERT_INDEX_DO_COLLAPSE);  /* set_dirty! */
+                       BM_elem_index_set(v_first, ((offset + depth) % nth) ? VERT_INDEX_IGNORE : VERT_INDEX_DO_COLLAPSE);  /* set_dirty! */
 
                        vert_seek_b_tot = 0;
                        vert_seek_b[vert_seek_b_tot++] = v_first;
index 78c3f4e..adaad25 100644 (file)
@@ -1261,8 +1261,9 @@ void VIEW3D_OT_ndof_pan(struct wmOperatorType *ot)
  */
 static int ndof_all_invoke(bContext *C, wmOperator *op, wmEvent *event)
 {
-       if (event->type != NDOF_MOTION)
+       if (event->type != NDOF_MOTION) {
                return OPERATOR_CANCELLED;
+       }
        else {
        
                ViewOpsData *vod;
@@ -1389,7 +1390,7 @@ static int ndof_all_invoke(bContext *C, wmOperator *op, wmEvent *event)
                        }
                        
                        /* rotate around custom center */
-                       if (vod && vod->use_dyn_ofs) {
+                       if (vod->use_dyn_ofs) {
                                float q1[4];
                                
                                /* compute the post multiplication quat, to rotate the offset correctly */
index 5883b17..f025352 100644 (file)
@@ -361,7 +361,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
 
        /* Mix weights. */
        for (i = 0; i < numIdx; i++) {
-               float weight2 = 0.0;
+               float weight2;
                org_w[i] = dw1[i] ? dw1[i]->weight : wmd->default_weight_a;
                weight2  = dw2[i] ? dw2[i]->weight : wmd->default_weight_b;