code cleanup: removed unneeded null check in object drawing, some warnings, style.
authorCampbell Barton <ideasman42@gmail.com>
Thu, 18 Apr 2013 15:09:30 +0000 (15:09 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 18 Apr 2013 15:09:30 +0000 (15:09 +0000)
source/blender/blenkernel/intern/editmesh_bvh.c
source/blender/editors/mesh/editmesh_knife.c
source/blender/editors/space_node/node_templates.c
source/blender/editors/space_view3d/drawobject.c

index 14e6eedec7c0eb58ce4f5375a23c3fa6d21130d3..979a38f0346c29dc85f70b5316a5d3fca6e89140 100644 (file)
@@ -138,7 +138,7 @@ void BKE_bmbvh_free(BMBVHTree *bmtree)
        BLI_bvhtree_free(bmtree->tree);
        
        if (bmtree->cos_cage && bmtree->cos_cage_free) {
-               MEM_freeN(bmtree->cos_cage);
+               MEM_freeN((void *)bmtree->cos_cage);
        }
        
        MEM_freeN(bmtree);
index 3811e8b7d8c388ced952b23ce2823740fed0761b..e0ca7841b5a6f1ae1b18b57216dcd826c8232c25 100644 (file)
@@ -2939,7 +2939,7 @@ static void knifetool_exit_ex(bContext *C, KnifeTool_OpData *kcd)
        ED_region_tag_redraw(kcd->ar);
 
        if (kcd->cagecos)
-               MEM_freeN(kcd->cagecos);
+               MEM_freeN((void *)kcd->cagecos);
 
        if (kcd->linehits)
                MEM_freeN(kcd->linehits);
index 2b7101c8c4e6cafa4b05dc149fea834db5775fbf..5be47e5ef6edc71f239d4de577966d2c6d2554bf 100644 (file)
@@ -209,8 +209,7 @@ static void node_socket_add_replace(const bContext *C, bNodeTree *ntree, bNode *
                if (!(node_from->inputs.first == NULL && !(node_from->typeinfo->flag & NODE_OPTIONS)))
                        node_from = NULL;
 
-       if (node_prev && node_prev->type == type && node_link_item_compare(node_prev, item))
-       {
+       if (node_prev && node_prev->type == type && node_link_item_compare(node_prev, item)) {
                /* keep the previous node if it's the same type */
                node_from = node_prev;
        }
@@ -303,7 +302,7 @@ static void ui_node_link_items(NodeLinkArg *arg, int in_out, NodeLinkItem **r_it
                int i;
                
                for (ngroup = arg->bmain->nodetree.first; ngroup; ngroup = ngroup->id.next) {
-                       ListBase *lb = (in_out==SOCK_IN ? &ngroup->inputs : &ngroup->outputs);
+                       ListBase *lb = ((in_out == SOCK_IN) ? &ngroup->inputs : &ngroup->outputs);
                        totitems += BLI_countlist(lb);
                }
                
index 703e375281a986448a1cbcba4f30f28f93b33a81..56a4e55b92abde4a6db74a08107ee9ce83729461 100644 (file)
@@ -7058,11 +7058,12 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
        /* not for sets, duplicators or picking */
        if (dflag == 0 && (v3d->flag & V3D_HIDE_HELPLINES) == 0 && (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
                ListBase *list;
-               RigidBodyCon *rbc = ob ? ob->rigidbody_constraint : NULL;
+               RigidBodyCon *rbc = ob->rigidbody_constraint;
                
                /* draw hook center and offset line */
-               if (ob != scene->obedit) draw_hooks(ob);
-               
+               if (ob != scene->obedit)
+                       draw_hooks(ob);
+
                /* help lines and so */
                if (ob != scene->obedit && ob->parent && (ob->parent->lay & v3d->lay)) {
                        setlinestyle(3);