[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34290] trunk/blender/source/blender: remove/comment unused vars

Campbell Barton ideasman42 at gmail.com
Thu Jan 13 05:54:00 CET 2011


Revision: 34290
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=34290
Author:   campbellbarton
Date:     2011-01-13 04:53:55 +0000 (Thu, 13 Jan 2011)
Log Message:
-----------
remove/comment unused vars
also removed unnecessary NULL checks (where the pointer was used later without checking).

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/anim.c
    trunk/blender/source/blender/blenkernel/intern/collision.c
    trunk/blender/source/blender/blenkernel/intern/customdata.c
    trunk/blender/source/blender/blenkernel/intern/multires.c
    trunk/blender/source/blender/editors/armature/editarmature.c
    trunk/blender/source/blender/editors/armature/editarmature_retarget.c
    trunk/blender/source/blender/editors/armature/poseobject.c
    trunk/blender/source/blender/editors/armature/reeb.c
    trunk/blender/source/blender/editors/interface/interface.c
    trunk/blender/source/blender/editors/interface/interface_templates.c
    trunk/blender/source/blender/editors/mesh/editmesh_mods.c
    trunk/blender/source/blender/editors/mesh/editmesh_tools.c
    trunk/blender/source/blender/editors/mesh/mesh_ops.c
    trunk/blender/source/blender/editors/mesh/meshtools.c
    trunk/blender/source/blender/editors/object/object_add.c
    trunk/blender/source/blender/editors/physics/particle_edit.c
    trunk/blender/source/blender/editors/render/render_opengl.c
    trunk/blender/source/blender/editors/render/render_shading.c
    trunk/blender/source/blender/editors/space_file/filesel.c
    trunk/blender/source/blender/editors/space_graph/graph_ops.c
    trunk/blender/source/blender/editors/space_image/image_ops.c
    trunk/blender/source/blender/editors/space_logic/logic_window.c
    trunk/blender/source/blender/editors/space_nla/nla_channels.c
    trunk/blender/source/blender/editors/space_view3d/drawarmature.c
    trunk/blender/source/blender/editors/transform/transform_ops.c
    trunk/blender/source/blender/editors/transform/transform_snap.c
    trunk/blender/source/blender/editors/uvedit/uvedit_ops.c
    trunk/blender/source/blender/gpu/intern/gpu_draw.c
    trunk/blender/source/blender/imbuf/intern/tiff.c
    trunk/blender/source/blender/makesrna/intern/rna_animation.c
    trunk/blender/source/blender/makesrna/intern/rna_curve.c
    trunk/blender/source/blender/makesrna/intern/rna_fcurve.c
    trunk/blender/source/blender/makesrna/intern/rna_mesh.c
    trunk/blender/source/blender/makesrna/intern/rna_meta.c
    trunk/blender/source/blender/makesrna/intern/rna_nodetree.c
    trunk/blender/source/blender/makesrna/intern/rna_object.c
    trunk/blender/source/blender/makesrna/intern/rna_screen.c
    trunk/blender/source/blender/makesrna/intern/rna_ui_api.c
    trunk/blender/source/blender/python/intern/bpy_rna_array.c
    trunk/blender/source/blender/windowmanager/intern/wm_event_system.c

Modified: trunk/blender/source/blender/blenkernel/intern/anim.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/anim.c	2011-01-13 01:02:55 UTC (rev 34289)
+++ trunk/blender/source/blender/blenkernel/intern/anim.c	2011-01-13 04:53:55 UTC (rev 34290)
@@ -1172,7 +1172,6 @@
 	float (*obmat)[4], (*oldobmat)[4];
 	int a, b, counter, hair = 0;
 	int totpart, totchild, totgroup=0, pa_num;
-	unsigned int lay;
 
 	if(psys==0) return;
 	
@@ -1193,8 +1192,7 @@
 	totchild = psys->totchild;
 
 	BLI_srandom(31415926 + psys->seed);
-	
-	lay= scene->lay;
+
 	if((psys->renderdata || part->draw_as==PART_DRAW_REND) && ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) {
 		ParticleSimulationData sim= {0};
 		sim.scene= scene;

Modified: trunk/blender/source/blender/blenkernel/intern/collision.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/collision.c	2011-01-13 01:02:55 UTC (rev 34289)
+++ trunk/blender/source/blender/blenkernel/intern/collision.c	2011-01-13 04:53:55 UTC (rev 34290)
@@ -1457,13 +1457,13 @@
 static int cloth_bvh_objcollisions_resolve ( ClothModifierData * clmd, CollisionModifierData *collmd, CollPair *collisions, CollPair *collisions_index)
 {
 	Cloth *cloth = clmd->clothObject;
-	int i=0, j = 0, numfaces = 0, numverts = 0;
+	int i=0, j = 0, /*numfaces = 0,*/ numverts = 0;
 	ClothVertex *verts = NULL;
 	int ret = 0;
 	int result = 0;
 	float tnull[3] = {0,0,0};
 	
-	numfaces = clmd->clothObject->numfaces;
+	/*numfaces = clmd->clothObject->numfaces;*/ /*UNUSED*/
 	numverts = clmd->clothObject->numverts;
  
 	verts = cloth->verts;

Modified: trunk/blender/source/blender/blenkernel/intern/customdata.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/customdata.c	2011-01-13 01:02:55 UTC (rev 34289)
+++ trunk/blender/source/blender/blenkernel/intern/customdata.c	2011-01-13 04:53:55 UTC (rev 34290)
@@ -893,13 +893,13 @@
 void CustomData_merge(const struct CustomData *source, struct CustomData *dest,
 					  CustomDataMask mask, int alloctype, int totelem)
 {
-	const LayerTypeInfo *typeInfo;
+	/*const LayerTypeInfo *typeInfo;*/
 	CustomDataLayer *layer, *newlayer;
 	int i, type, number = 0, lasttype = -1, lastactive = 0, lastrender = 0, lastclone = 0, lastmask = 0, lastflag = 0;
 
 	for(i = 0; i < source->totlayer; ++i) {
 		layer = &source->layers[i];
-		typeInfo = layerType_getInfo(layer->type);
+		/*typeInfo = layerType_getInfo(layer->type);*/ /*UNUSED*/
 
 		type = layer->type;
 

Modified: trunk/blender/source/blender/blenkernel/intern/multires.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/multires.c	2011-01-13 01:02:55 UTC (rev 34289)
+++ trunk/blender/source/blender/blenkernel/intern/multires.c	2011-01-13 04:53:55 UTC (rev 34290)
@@ -707,7 +707,7 @@
 	MFace *mface = me->mface;
 	MDisps *mdisps = CustomData_get_layer(&me->fdata, CD_MDISPS);
 	int *gridOffset;
-	int i, numGrids, gridSize, dGridSize, dSkip;
+	int i, /*numGrids,*/ gridSize, dGridSize, dSkip;
 
 	if(!mdisps) {
 		if(invert)
@@ -716,7 +716,7 @@
 			return;
 	}
 
-	numGrids = dm->getNumGrids(dm);
+	/*numGrids = dm->getNumGrids(dm);*/ /*UNUSED*/
 	gridSize = dm->getGridSize(dm);
 	gridData = dm->getGridData(dm);
 	gridOffset = dm->getGridOffset(dm);

Modified: trunk/blender/source/blender/editors/armature/editarmature.c
===================================================================
--- trunk/blender/source/blender/editors/armature/editarmature.c	2011-01-13 01:02:55 UTC (rev 34289)
+++ trunk/blender/source/blender/editors/armature/editarmature.c	2011-01-13 04:53:55 UTC (rev 34290)
@@ -1209,12 +1209,10 @@
 	Object *obedit= CTX_data_edit_object(C);
 	Object *oldob, *newob;
 	Base *oldbase, *newbase;
-	bArmature *arm;
 	
 	/* sanity checks */
 	if (obedit == NULL)
 		return OPERATOR_CANCELLED;
-	arm= obedit->data;
 	
 	/* set wait cursor in case this takes a while */
 	WM_cursor_wait(1);

Modified: trunk/blender/source/blender/editors/armature/editarmature_retarget.c
===================================================================
--- trunk/blender/source/blender/editors/armature/editarmature_retarget.c	2011-01-13 01:02:55 UTC (rev 34289)
+++ trunk/blender/source/blender/editors/armature/editarmature_retarget.c	2011-01-13 04:53:55 UTC (rev 34290)
@@ -2730,8 +2730,6 @@
 	BIF_flagMultiArcs(reebg, ARC_FREE);
 	
 	/* return to first level */
-	reebg = rigg->link_mesh;
-	
 	inode = rigg->head;
 	
 	matchMultiResolutionStartingNode(rigg, reebg, inode);
@@ -2887,7 +2885,6 @@
 	Object *ob;
 	RigGraph *rigg;
 	RigArc *iarc;
-	bArmature *arm;
 	char *side_string = scene->toolsettings->skgen_side_string;
 	char *num_string = scene->toolsettings->skgen_num_string;
 	int free_template = 0;
@@ -2895,14 +2892,12 @@
 	if (template_rigg)
 	{
 		ob = template_rigg->ob; 	
-		arm = ob->data;
 	}
 	else
 	{
 		free_template = 1;
-		ob = obedit; 	
-		arm = ob->data;
-		template_rigg = armatureSelectedToGraph(C, ob, arm);
+		ob = obedit;
+		template_rigg = armatureSelectedToGraph(C, ob, ob->data);
 	}
 	
 	if (template_rigg->arcs.first == NULL)

Modified: trunk/blender/source/blender/editors/armature/poseobject.c
===================================================================
--- trunk/blender/source/blender/editors/armature/poseobject.c	2011-01-13 01:02:55 UTC (rev 34289)
+++ trunk/blender/source/blender/editors/armature/poseobject.c	2011-01-13 04:53:55 UTC (rev 34290)
@@ -667,7 +667,7 @@
 {
 	Object *obedit= scene->obedit; // XXX context
 	Object *ob= OBACT;
-	bArmature *arm= ob->data;
+	bArmature *arm;
 	bPoseChannel *pchan, *pchanact;
 	short nr=0;
 	int i=0;
@@ -680,7 +680,8 @@
 	
 	if (pchan==NULL) return;
 	pchanact= pchan;
-	
+	arm= ob->data;
+
 	/* if proxy-protected bones selected, some things (such as locks + displays) shouldn't be changable, 
 	 * but for constraints (just add local constraints)
 	 */
@@ -1241,7 +1242,6 @@
 {
 	ScrArea *sa= CTX_wm_area(C);
 	Object *ob;
-	bArmature *arm;
 	bPose *pose;
 	short done= 0;
 	
@@ -1254,7 +1254,7 @@
 	/* only continue if there's an object, and a pose there too */
 	if (ELEM(NULL, ob, ob->pose))
 		return OPERATOR_CANCELLED;
-	arm= ob->data;
+
 	pose= ob->pose;
 	
 	/* set the active group number to the one from operator props 
@@ -1306,8 +1306,6 @@
 {
 	ScrArea *sa= CTX_wm_area(C);
 	Object *ob;
-	bArmature *arm;
-	bPose *pose;
 	short done= 0;
 	
 	/* since this call may also be used from the buttons window, we need to check for where to get the object */
@@ -1319,8 +1317,6 @@
 	/* only continue if there's an object, and a pose there too */
 	if (ELEM(NULL, ob, ob->pose))
 		return OPERATOR_CANCELLED;
-	pose= ob->pose;
-	arm= ob->data;
 	
 	/* find selected bones to remove from all bone groups */
 	CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones)
@@ -1561,16 +1557,17 @@
 void pose_activate_flipped_bone(Scene *scene)
 {
 	Object *ob= OBACT;
-	bArmature *arm= ob->data;
-	
+
 	if(ob==NULL) return;
 
 	if(ob->mode & OB_MODE_WEIGHT_PAINT) {
 		ob= modifiers_isDeformedByArmature(ob);
 	}
+
 	if(ob && (ob->mode & OB_MODE_POSE)) {
 		bPoseChannel *pchanf;
-		
+		bArmature *arm= ob->data;
+
 		if(arm->act_bone) {
 			char name[32];
 			flip_side_name(name, arm->act_bone->name, TRUE);

Modified: trunk/blender/source/blender/editors/armature/reeb.c
===================================================================
--- trunk/blender/source/blender/editors/armature/reeb.c	2011-01-13 01:02:55 UTC (rev 34289)
+++ trunk/blender/source/blender/editors/armature/reeb.c	2011-01-13 04:53:55 UTC (rev 34290)
@@ -2558,10 +2558,10 @@
 	EditVert *eve;
 	EditFace *efa;
 	int index;
-	int totvert;
-	int totfaces;
+	/*int totvert;*/
 	
 #ifdef DEBUG_REEB
+	int totfaces;
 	int countfaces = 0;
 #endif
  	
@@ -2569,8 +2569,10 @@
 	
 	rg->resolution = subdivisions;
 	
-	totvert = BLI_countlist(&em->verts);
+	/*totvert = BLI_countlist(&em->verts);*/ /*UNUSED*/
+#ifdef DEBUG_REEB
 	totfaces = BLI_countlist(&em->faces);
+#endif
 	
 	renormalizeWeight(em, 1.0f);
 	
@@ -2641,7 +2643,7 @@
 	eve = em->verts.first;
 	minimum = weightData(eve);
 	maximum = minimum;
-	for(eve = em->verts.first; eve; eve = eve->next)
+	for(; eve; eve = eve->next)
 	{
 		maximum = MAX2(maximum, weightData(eve));
 		minimum = MIN2(minimum, weightData(eve));

Modified: trunk/blender/source/blender/editors/interface/interface.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface.c	2011-01-13 01:02:55 UTC (rev 34289)
+++ trunk/blender/source/blender/editors/interface/interface.c	2011-01-13 04:53:55 UTC (rev 34290)
@@ -1801,7 +1801,7 @@
 void ui_set_but_soft_range(uiBut *but, double value)
 {
 	PropertyType type;
-	double softmin, softmax, step, precision;
+	double softmin, softmax /*, step, precision*/;
 	
 	if(but->rnaprop) {
 		type= RNA_property_type(but->rnaprop);
@@ -1814,8 +1814,8 @@
 			RNA_property_int_ui_range(&but->rnapoin, but->rnaprop, &imin, &imax, &istep);
 			softmin= (imin == INT_MIN)? -1e4: imin;
 			softmax= (imin == INT_MAX)? 1e4: imax;
-			step= istep;
-			precision= 1;
+			/*step= istep;*/ /*UNUSED*/
+			/*precision= 1;*/ /*UNUSED*/
 		}
 		else if(type == PROP_FLOAT) {
 			float fmin, fmax, fstep, fprecision;
@@ -1823,8 +1823,8 @@
 			RNA_property_float_ui_range(&but->rnapoin, but->rnaprop, &fmin, &fmax, &fstep, &fprecision);
 			softmin= (fmin == -FLT_MAX)? -1e4: fmin;
 			softmax= (fmax == FLT_MAX)? 1e4: fmax;
-			step= fstep;
-			precision= fprecision;
+			/*step= fstep;*/ /*UNUSED*/
+			/*precision= fprecision;*/ /*UNUSED*/
 		}
 		else
 			return;

Modified: trunk/blender/source/blender/editors/interface/interface_templates.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_templates.c	2011-01-13 01:02:55 UTC (rev 34289)
+++ trunk/blender/source/blender/editors/interface/interface_templates.c	2011-01-13 04:53:55 UTC (rev 34290)
@@ -1893,15 +1893,12 @@
 	int groups, cols, layers;
 	int group, col, layer, row;
 	int cols_per_group = 5;
-	const char *desc;
-	
+
 	prop= RNA_struct_find_property(ptr, propname);
 	if (!prop) {
 		printf("uiTemplateLayer: layers property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
 		return;
 	}
-
-	desc= RNA_property_description(prop);
 	
 	/* the number of layers determines the way we group them 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list