[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41616] trunk/blender/source/blender: minor warning nicer api use

Campbell Barton ideasman42 at gmail.com
Mon Nov 7 16:19:26 CET 2011


Revision: 41616
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41616
Author:   campbellbarton
Date:     2011-11-07 15:19:26 +0000 (Mon, 07 Nov 2011)
Log Message:
-----------
minor warning nicer api use

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/movieclip.c
    trunk/blender/source/blender/editors/gpencil/gpencil_paint.c
    trunk/blender/source/blender/makesrna/intern/rna_scene.c
    trunk/blender/source/blender/makesrna/intern/rna_texture_api.c
    trunk/blender/source/blender/makesrna/intern/rna_ui_api.c

Modified: trunk/blender/source/blender/blenkernel/intern/movieclip.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/movieclip.c	2011-11-07 15:19:13 UTC (rev 41615)
+++ trunk/blender/source/blender/blenkernel/intern/movieclip.c	2011-11-07 15:19:26 UTC (rev 41616)
@@ -156,13 +156,10 @@
 	   autoguess offset for now. could be something smarter in the future */
 	offset= sequence_guess_offset(clip->name, strlen(head), numlen);
 
-	if(numlen) BLI_stringenc(name, head, tail, numlen, offset+framenr-1);
-	else strncpy(name, clip->name, sizeof(name));
+	if (numlen) BLI_stringenc(name, head, tail, numlen, offset+framenr-1);
+	else        BLI_strncpy(name, clip->name, sizeof(name));
 
-	if(clip->id.lib)
-		BLI_path_abs(name, clip->id.lib->filepath);
-	else
-		BLI_path_abs(name, G.main->name);
+	BLI_path_abs(name, ID_BLEND_PATH(G.main, &clip->id));
 }
 
 /* supposed to work with sequences only */
@@ -174,7 +171,7 @@
 	BLI_split_dirfile(clip->name, clipdir, clipfile, FILE_MAX, FILE_MAX);
 
 	if(clip->flag&MCLIP_USE_PROXY_CUSTOM_DIR) {
-		strcpy(dir, clip->proxy.dir);
+		BLI_strncpy(dir, clip->proxy.dir, sizeof(dir));
 	} else {
 		BLI_snprintf(dir, FILE_MAX, "%s/BL_proxy", clipdir);
 	}
@@ -194,9 +191,9 @@
 {
 	struct ImBuf *ibuf;
 	char name[FILE_MAX];
-	int loadflag, size, undistort;
+	int loadflag /*, size */ /* UNUSED */, undistort;
 
-	size= rendersize_to_number(user->render_size);
+	/* size= rendersize_to_number(user->render_size); */
 
 	undistort= user->render_flag&MCLIP_PROXY_RENDER_UNDISTORT;
 
@@ -222,19 +219,15 @@
 
 	if(!clip->anim) {
 		BLI_strncpy(str, clip->name, FILE_MAX);
+		BLI_path_abs(str, ID_BLEND_PATH(G.main, &clip->id));
 
-		if(clip->id.lib)
-			BLI_path_abs(str, clip->id.lib->filepath);
-		else
-			BLI_path_abs(str, G.main->name);
-
 		/* FIXME: make several stream accessible in image editor, too */
 		clip->anim= openanim(str, IB_rect, 0);
 
 		if(clip->anim) {
 			if(clip->flag&MCLIP_USE_PROXY_CUSTOM_DIR) {
 				char dir[FILE_MAX];
-				strcpy(dir, clip->proxy.dir);
+				BLI_strncpy(dir, clip->proxy.dir, sizeof(dir));
 				BLI_path_abs(dir, G.main->name);
 				IMB_anim_set_index_dir(clip->anim, dir);
 			}
@@ -243,7 +236,7 @@
 
 	if(clip->anim) {
 		int dur;
-		int fra= framenr-1;
+		int fra;
 
 		dur= IMB_anim_get_duration(clip->anim, tc);
 		fra= framenr-1;

Modified: trunk/blender/source/blender/editors/gpencil/gpencil_paint.c
===================================================================
--- trunk/blender/source/blender/editors/gpencil/gpencil_paint.c	2011-11-07 15:19:13 UTC (rev 41615)
+++ trunk/blender/source/blender/editors/gpencil/gpencil_paint.c	2011-11-07 15:19:26 UTC (rev 41616)
@@ -1772,8 +1772,6 @@
 	if (gp_session_initdata(C, p))
 		gp_paint_initstroke(p, p->paintmode);
 
-	p= op->customdata;
-
 	if(p->status != GP_STATUS_ERROR)
 		p->status= GP_STATUS_PAINTING;
 

Modified: trunk/blender/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_scene.c	2011-11-07 15:19:13 UTC (rev 41615)
+++ trunk/blender/source/blender/makesrna/intern/rna_scene.c	2011-11-07 15:19:26 UTC (rev 41616)
@@ -3761,7 +3761,7 @@
 	RNA_def_property_struct_type(prop, "TransformOrientation");
 	RNA_def_property_ui_text(prop, "Transform Orientations", "");
 
-	/* acctive MovieClip */
+	/* active MovieClip */
 	prop= RNA_def_property(srna, "active_clip", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "clip");
 	RNA_def_property_flag(prop, PROP_EDITABLE);

Modified: trunk/blender/source/blender/makesrna/intern/rna_texture_api.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_texture_api.c	2011-11-07 15:19:13 UTC (rev 41615)
+++ trunk/blender/source/blender/makesrna/intern/rna_texture_api.c	2011-11-07 15:19:26 UTC (rev 41616)
@@ -118,10 +118,10 @@
 
 	RNA_def_pointer(func, "scene", "Scene", "", "Overrides the scene from which image parameters are taken");
 
-	parm = RNA_def_float_array(func, "layout", 12, default_layout, 0.0f, 0.0f, "File layout",
-	                           "Flat array describing the X,Y position of each cube face in the "
-	                           "output image, where 1 is the size of a face - order is [+Z -Z +Y -X -Y +X] "
-	                           "(use -1 to skip a face)", 0.0f, 0.0f);
+	RNA_def_float_array(func, "layout", 12, default_layout, 0.0f, 0.0f, "File layout",
+	                    "Flat array describing the X,Y position of each cube face in the "
+	                    "output image, where 1 is the size of a face - order is [+Z -Z +Y -X -Y +X] "
+	                    "(use -1 to skip a face)", 0.0f, 0.0f);
 }
 
 #endif

Modified: trunk/blender/source/blender/makesrna/intern/rna_ui_api.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_ui_api.c	2011-11-07 15:19:13 UTC (rev 41615)
+++ trunk/blender/source/blender/makesrna/intern/rna_ui_api.c	2011-11-07 15:19:26 UTC (rev 41616)
@@ -427,9 +427,9 @@
 	RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
 	parm= RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, for the active element");
 	RNA_def_property_flag(parm, PROP_REQUIRED);
-	parm= RNA_def_string(func, "prop_list", "", 0, "",
-	                     "Identifier of a string property in each data member, specifying which "
-	                     "of its properties should have a widget displayed in its row");
+	RNA_def_string(func, "prop_list", "", 0, "",
+	               "Identifier of a string property in each data member, specifying which "
+	               "of its properties should have a widget displayed in its row");
 	RNA_def_int(func, "rows", 5, 0, INT_MAX, "", "Number of rows to display", 0, INT_MAX);
 	RNA_def_int(func, "maxrows", 5, 0, INT_MAX, "", "Maximum number of rows to display", 0, INT_MAX);
 	RNA_def_enum(func, "type", list_type_items, 0, "Type", "Type of list to use");




More information about the Bf-blender-cvs mailing list