[Bf-blender-cvs] [182179a] master: Cleanup: redundant NULL checks

Campbell Barton noreply at git.blender.org
Tue May 6 22:21:07 CEST 2014


Commit: 182179a44b09564603f424b8be75043578fd0c61
Author: Campbell Barton
Date:   Wed May 7 04:35:55 2014 +1000
https://developer.blender.org/rB182179a44b09564603f424b8be75043578fd0c61

Cleanup: redundant NULL checks

===================================================================

M	source/blender/blenkernel/intern/anim_sys.c
M	source/blender/editors/interface/interface_templates.c
M	source/blender/editors/space_time/space_time.c

===================================================================

diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 00faa1c..7e6af94 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -1401,7 +1401,7 @@ static bool animsys_write_rna_setting(PointerRNA *ptr, char *path, int array_ind
 		 * where some channels will not exist, but shouldn't lock up Action */
 		if (G.debug & G_DEBUG) {
 			printf("Animato: Invalid path. ID = '%s',  '%s[%d]'\n",
-			       (ptr && ptr->id.data) ? (((ID *)ptr->id.data)->name + 2) : "<No ID>",
+			       (ptr->id.data) ? (((ID *)ptr->id.data)->name + 2) : "<No ID>",
 			       path, array_index);
 		}
 		return 0;
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 72669d6..961c2d0 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -447,7 +447,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
 	/* text button with name */
 	if (id) {
 		char name[UI_MAX_NAME_STR];
-		const short user_alert = (id->us <= 0);
+		const bool user_alert = (id->us <= 0);
 
 		//text_idbutton(id, name);
 		name[0] = '\0';
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index a363fae..2fd4b0b 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -346,7 +346,7 @@ static void time_draw_keyframes(const bContext *C, ARegion *ar)
 	 *	- don't try to do this when only drawing active/selected data keyframes,
 	 *	  since this can become quite slow
 	 */
-	if (scene && onlysel == 0) {
+	if (onlysel == 0) {
 		/* set draw color */
 		glColor3ub(0xDD, 0xA7, 0x00);
 		time_draw_idblock_keyframes(v2d, (ID *)scene, onlysel);




More information about the Bf-blender-cvs mailing list