[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58684] trunk/blender/source/blender: remove unneeded NULL checks, add one for give_matarar() return value.

Campbell Barton ideasman42 at gmail.com
Sun Jul 28 08:37:58 CEST 2013


Revision: 58684
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58684
Author:   campbellbarton
Date:     2013-07-28 06:37:58 +0000 (Sun, 28 Jul 2013)
Log Message:
-----------
remove unneeded NULL checks, add one for give_matarar() return value.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/material.c
    trunk/blender/source/blender/blenlib/intern/string.c
    trunk/blender/source/blender/editors/armature/pose_utils.c
    trunk/blender/source/blender/editors/object/object_relations.c
    trunk/blender/source/blender/editors/space_graph/graph_buttons.c

Modified: trunk/blender/source/blender/blenkernel/intern/material.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/material.c	2013-07-28 06:22:07 UTC (rev 58683)
+++ trunk/blender/source/blender/blenkernel/intern/material.c	2013-07-28 06:37:58 UTC (rev 58684)
@@ -1176,7 +1176,9 @@
 	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) {

Modified: trunk/blender/source/blender/blenlib/intern/string.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/string.c	2013-07-28 06:22:07 UTC (rev 58683)
+++ trunk/blender/source/blender/blenlib/intern/string.c	2013-07-28 06:37:58 UTC (rev 58684)
@@ -357,10 +357,9 @@
 		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);

Modified: trunk/blender/source/blender/editors/armature/pose_utils.c
===================================================================
--- trunk/blender/source/blender/editors/armature/pose_utils.c	2013-07-28 06:22:07 UTC (rev 58683)
+++ trunk/blender/source/blender/editors/armature/pose_utils.c	2013-07-28 06:37:58 UTC (rev 58684)
@@ -239,7 +239,7 @@
 		 *	- 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);
 		}

Modified: trunk/blender/source/blender/editors/object/object_relations.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_relations.c	2013-07-28 06:22:07 UTC (rev 58683)
+++ trunk/blender/source/blender/editors/object/object_relations.c	2013-07-28 06:37:58 UTC (rev 58684)
@@ -2049,7 +2049,7 @@
 			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];

Modified: trunk/blender/source/blender/editors/space_graph/graph_buttons.c
===================================================================
--- trunk/blender/source/blender/editors/space_graph/graph_buttons.c	2013-07-28 06:22:07 UTC (rev 58683)
+++ trunk/blender/source/blender/editors/space_graph/graph_buttons.c	2013-07-28 06:37:58 UTC (rev 58684)
@@ -148,15 +148,16 @@
 	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);




More information about the Bf-blender-cvs mailing list