[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32334] trunk/blender/source/blender: remove some unused code and reduced the scope if some vars ( no functional change).

Campbell Barton ideasman42 at gmail.com
Tue Oct 5 23:22:33 CEST 2010


Revision: 32334
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32334
Author:   campbellbarton
Date:     2010-10-05 23:22:33 +0200 (Tue, 05 Oct 2010)

Log Message:
-----------
remove some unused code and reduced the scope if some vars (no functional change).

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/font.c
    trunk/blender/source/blender/blenkernel/intern/idprop.c
    trunk/blender/source/blender/blenkernel/intern/image.c
    trunk/blender/source/blender/blenkernel/intern/unit.c
    trunk/blender/source/blender/python/intern/bpy_rna.c

Modified: trunk/blender/source/blender/blenkernel/intern/font.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/font.c	2010-10-05 19:14:41 UTC (rev 32333)
+++ trunk/blender/source/blender/blenkernel/intern/font.c	2010-10-05 21:22:33 UTC (rev 32334)
@@ -514,11 +514,12 @@
 	float *fp, fsize, shear, x, si, co;
 	VFontData *vfd = NULL;
 	VChar *che = NULL;
-	int i, sel=0;
+	int i;
 
 	vfd= vfont_get_data(which_vfont(cu, info));	
 	if (!vfd) return;
 
+	/*
 	if (cu->selend < cu->selstart) {
 		if ((charidx >= (cu->selend)) && (charidx <= (cu->selstart-2)))
 			sel= 1;
@@ -527,6 +528,7 @@
 		if ((charidx >= (cu->selstart-1)) && (charidx <= (cu->selend-1)))
 			sel= 1;
 	}
+	*/
 
 	/* make a copy at distance ofsx,ofsy with shear*/
 	fsize= cu->fsize;
@@ -1148,14 +1150,12 @@
 
 	if(mode == FO_EDIT) {
 		/* make nurbdata */
-		unsigned long cha;
-		
 		freeNurblist(&cu->nurb);
 		
 		ct= chartransdata;
 		if (cu->sepchar==0) {
 			for (i= 0; i<slen; i++) {
-				cha = (uintptr_t) mem[i];
+				unsigned long cha = (uintptr_t) mem[i];
 				info = &(custrinfo[i]);
 				if (info->mat_nr > (ob->totcol)) {
 					/* printf("Error: Illegal material index (%d) in text object, setting to 0\n", info->mat_nr); */

Modified: trunk/blender/source/blender/blenkernel/intern/idprop.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/idprop.c	2010-10-05 19:14:41 UTC (rev 32333)
+++ trunk/blender/source/blender/blenkernel/intern/idprop.c	2010-10-05 21:22:33 UTC (rev 32334)
@@ -421,9 +421,7 @@
 	IDProperty *loop, *prop;
 	for (prop=src->data.group.first; prop; prop=prop->next) {
 		for (loop=dest->data.group.first; loop; loop=loop->next) {
-			if (BSTR_EQ(loop->name, prop->name)) {
-				int copy_done= 0;
-
+			if (strcmp(loop->name, prop->name)==0) {
 				if(prop->type==loop->type) {
 
 					switch (prop->type) {
@@ -431,11 +429,9 @@
 						case IDP_FLOAT:
 						case IDP_DOUBLE:
 							loop->data= prop->data;
-							copy_done= 1;
 							break;
 						case IDP_GROUP:
 							IDP_SyncGroupValues(loop, prop);
-							copy_done= 1;
 							break;
 						default:
 						{
@@ -702,7 +698,6 @@
 		case IDP_STRING:
 		{
 			char *st = val.str;
-			int stlen;
 
 			prop = MEM_callocN(sizeof(IDProperty), "IDProperty string");
 			if (st == NULL) {
@@ -710,7 +705,7 @@
 				prop->totallen = DEFAULT_ALLOC_FOR_NULL_STRINGS;
 				prop->len = 1; /*NULL string, has len of 1 to account for null byte.*/
 			} else {
-				stlen = strlen(st) + 1;
+				int stlen = strlen(st) + 1;
 				prop->data.pointer = MEM_callocN(stlen, "id property string 2");
 				prop->len = prop->totallen = stlen;
 				strcpy(prop->data.pointer, st);

Modified: trunk/blender/source/blender/blenkernel/intern/image.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/image.c	2010-10-05 19:14:41 UTC (rev 32333)
+++ trunk/blender/source/blender/blenkernel/intern/image.c	2010-10-05 21:22:33 UTC (rev 32334)
@@ -596,7 +596,7 @@
 {
 	Tex *tex;
 	Image *ima;
-	unsigned int totsize= 0;
+	/* unsigned int totsize= 0; */
 	
 	for(ima= G.main->image.first; ima; ima= ima->id.next)
 		ima->id.flag &= ~LIB_DOIT;
@@ -607,13 +607,14 @@
 	
 	for(ima= G.main->image.first; ima; ima= ima->id.next) {
 		if(ima->ibufs.first && (ima->id.flag & LIB_DOIT)) {
+			/*
 			ImBuf *ibuf;
 			for(ibuf= ima->ibufs.first; ibuf; ibuf= ibuf->next) {
 				if(ibuf->mipmap[0]) 
 					totsize+= 1.33*ibuf->x*ibuf->y*4;
 				else
 					totsize+= ibuf->x*ibuf->y*4;
-			}
+			} */
 			image_free_buffers(ima);
 		}
 	}
@@ -2183,7 +2184,7 @@
 
 void BKE_image_user_calc_frame(ImageUser *iuser, int cfra, int fieldnr)
 {
-	int imanr, len;
+	int len;
 	
 	/* here (+fie_ima/2-1) makes sure that division happens correctly */
 	len= (iuser->fie_ima*iuser->frames)/2;
@@ -2192,8 +2193,9 @@
 		iuser->framenr= 0;
 	}
 	else {
+		int imanr;
 		cfra= cfra - iuser->sfra+1;
-		
+
 		/* cyclic */
 		if(iuser->cycl) {
 			cfra= ( (cfra) % len );

Modified: trunk/blender/source/blender/blenkernel/intern/unit.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/unit.c	2010-10-05 19:14:41 UTC (rev 32333)
+++ trunk/blender/source/blender/blenkernel/intern/unit.c	2010-10-05 21:22:33 UTC (rev 32334)
@@ -398,7 +398,6 @@
    
 	/* split output makes sense only for length, mass and time */
 	if(split && (type==B_UNIT_LENGTH || type==B_UNIT_MASS || type==B_UNIT_TIME)) {
-		int i;
 		bUnitDef *unit_a, *unit_b;
 		double value_a, value_b;
 
@@ -406,7 +405,7 @@
 
 		/* check the 2 is a smaller unit */
 		if(unit_b > unit_a) {
-			i= unit_as_string(str, len_max, value_a, prec, usys,  unit_a, '\0');
+			int i= unit_as_string(str, len_max, value_a, prec, usys,  unit_a, '\0');
 
 			/* is there enough space for at least 1 char of the next unit? */
 			if(i+2 < len_max) {

Modified: trunk/blender/source/blender/python/intern/bpy_rna.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_rna.c	2010-10-05 19:14:41 UTC (rev 32333)
+++ trunk/blender/source/blender/python/intern/bpy_rna.c	2010-10-05 21:22:33 UTC (rev 32334)
@@ -3459,10 +3459,9 @@
 	PyObject *ret;
 	int type = RNA_property_type(prop);
 	int flag = RNA_property_flag(prop);
-	int a;
 
 	if(RNA_property_array_check(ptr, prop)) {
-		int len;
+		int a, len;
 
 		if (flag & PROP_DYNAMIC) {
 			ParameterDynAlloc *data_alloc= data;





More information about the Bf-blender-cvs mailing list