remove unneeded NULL checks, add one for give_matarar() return value.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 28 Jul 2013 06:37:58 +0000 (06:37 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 28 Jul 2013 06:37:58 +0000 (06:37 +0000)
source/blender/blenkernel/intern/material.c
source/blender/blenlib/intern/string.c
source/blender/editors/armature/pose_utils.c
source/blender/editors/object/object_relations.c
source/blender/editors/space_graph/graph_buttons.c

index 300beae1078ea0462b95c565bcd23635206946e8..6dc3c6d7bc63c83930c2d7a2bce5611a9654f0e9 100644 (file)
@@ -1176,7 +1176,9 @@ int object_remove_material_slot(Object *ob)
        totcolp = give_totcolp(ob);
        matarar = give_matarar(ob);
 
-       if (*matarar == NULL) return FALSE;
+       if (ELEM(NULL, matarar, *matarar)) {
+               return false;
+       }
 
        /* can happen on face selection in editmode */
        if (ob->actcol > ob->totcol) {
index 5bd07ac877895caf2c1e0ad4cc77d43165b22686..572b142d04468570ce500c344ce0ec71ca767ffe 100644 (file)
@@ -357,10 +357,9 @@ char *BLI_replacestrN(const char *__restrict str, const char *__restrict substr_
                char *str_new;
                
                /* add what's left of the string to the assembly buffer 
-                *      - we've been adjusting str to point at the end of the replaced segments
+                * - we've been adjusting str to point at the end of the replaced segments
                 */
-               if (str != NULL)
-                       BLI_dynstr_append(ds, str);
+               BLI_dynstr_append(ds, str);
                
                /* convert to new c-string (MEM_malloc'd), and free the buffer */
                str_new = BLI_dynstr_get_cstring(ds);
index a5e51ccf32ae5359f65e8a9e17407019e13d8355..014a64170db1dba46dd1ce3dcf12360b0335e359 100644 (file)
@@ -239,7 +239,7 @@ void poseAnim_mapping_autoKeyframe(bContext *C, Scene *scene, Object *ob, ListBa
                 *      - only do this if keyframes should have been added
                 *      - do not calculate unless there are paths already to update...
                 */
-               if (C && (ob->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS)) {
+               if (ob->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS) {
                        //ED_pose_clear_paths(C, ob); // XXX for now, don't need to clear
                        ED_pose_recalculate_paths(scene, ob);
                }
index 13fb46e35de9dcb7f46378fada4792d1d8b3c37b..52f51cfcf486cfa4e594280f43593cb30fef9bbd 100644 (file)
@@ -2049,7 +2049,7 @@ static int make_local_exec(bContext *C, wmOperator *op)
                        if (adt) BKE_animdata_make_local(adt);
                        
                        /* tag indirect data direct */
-                       matarar = (Material ***)give_matarar(ob);
+                       matarar = give_matarar(ob);
                        if (matarar) {
                                for (a = 0; a < ob->totcol; a++) {
                                        ma = (*matarar)[a];
index c4315c56376eed5ebb48682c79a7623f90cdc6e7..59e3180172d77f6ae0328cc4c07b4c66bb7006cc 100644 (file)
@@ -148,15 +148,16 @@ static void graph_panel_properties(const bContext *C, Panel *pa)
        PointerRNA fcu_ptr;
        uiLayout *layout = pa->layout;
        uiLayout *col, *row, *sub;
-       uiBlock *block;
+       // uiBlock *block;  // UNUSED
        char name[256];
        int icon = 0;
 
        if (!graph_panel_context(C, &ale, &fcu))
                return;
        
-       block = uiLayoutGetBlock(layout);
-       /* uiBlockSetHandleFunc(block, do_graph_region_buttons, NULL); */
+       // UNUSED
+       // block = uiLayoutGetBlock(layout);
+       // uiBlockSetHandleFunc(block, do_graph_region_buttons, NULL);
        
        /* F-Curve pointer */
        RNA_pointer_create(ale->id, &RNA_FCurve, fcu, &fcu_ptr);