[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42196] trunk/blender/source/blender: quiet some warnings and logical errors.

Campbell Barton ideasman42 at gmail.com
Mon Nov 28 00:41:06 CET 2011


Revision: 42196
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42196
Author:   campbellbarton
Date:     2011-11-27 23:41:01 +0000 (Sun, 27 Nov 2011)
Log Message:
-----------
quiet some warnings and logical errors.
- curve map insert point had a nested loop which used the same value to index different arrays.
- dynamic paint used ternary operator where both outcomes were the same.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/dynamicpaint.c
    trunk/blender/source/blender/editors/interface/interface_handlers.c
    trunk/blender/source/blender/makesdna/intern/makesdna.c
    trunk/blender/source/blender/modifiers/intern/MOD_fluidsim_util.c

Modified: trunk/blender/source/blender/blenkernel/intern/dynamicpaint.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/dynamicpaint.c	2011-11-27 21:18:59 UTC (rev 42195)
+++ trunk/blender/source/blender/blenkernel/intern/dynamicpaint.c	2011-11-27 23:41:01 UTC (rev 42196)
@@ -1693,7 +1693,7 @@
 						}
 
 						/* apply weights into a vertex group, if doesnt exists add a new layer */
-						if (defgrp_index >= 0 && !dvert && strlen(surface->output_name)>0)
+						if (defgrp_index >= 0 && !dvert && (surface->output_name[0] != '\0'))
 							dvert = CustomData_add_layer_named(&result->vertData, CD_MDEFORMVERT, CD_CALLOC,
 																NULL, sData->total_points, surface->output_name);
 						if (defgrp_index >= 0 && dvert) {
@@ -2282,10 +2282,10 @@
 							tPoint->quad = (isInside == 2) ? 1 : 0;		/* quad or tri part*/
 
 							/* save vertex indexes	*/
-							tPoint->v1 = (isInside == 2) ? mface[i].v1 : mface[i].v1;
+							tPoint->v1 = mface[i].v1; /* (isInside == 2) ? mface[i].v1 : mface[i].v1; */ /* same! */
 							tPoint->v2 = (isInside == 2) ? mface[i].v3 : mface[i].v2;
 							tPoint->v3 = (isInside == 2) ? mface[i].v4 : mface[i].v3;
-							
+
 							sample = 5;	/* make sure we exit sample loop as well */
 							break;
 						}

Modified: trunk/blender/source/blender/editors/interface/interface_handlers.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_handlers.c	2011-11-27 21:18:59 UTC (rev 42195)
+++ trunk/blender/source/blender/editors/interface/interface_handlers.c	2011-11-27 23:41:01 UTC (rev 42196)
@@ -3795,6 +3795,8 @@
 			}
 
 			if (sel == -1) {
+				int i;
+
 				/* if the click didn't select anything, check if it's clicked on the 
 				 * curve itself, and if so, add a point */
 				fx= ((float)mx - but->x1)/zoomx + offsx;
@@ -3804,8 +3806,10 @@
 
 				/* loop through the curve segment table and find what's near the mouse.
 				 * 0.05 is kinda arbitrary, but seems to be what works nicely. */
-				for(a=0; a<=CM_TABLE; a++) {			
-					if ( ( fabs(fx - cmp[a].x) < (0.05) ) && ( fabs(fy - cmp[a].y) < (0.05) ) ) {
+				for(i=0; i<=CM_TABLE; i++) {
+					if ( (fabsf(fx - cmp[i].x) < 0.05f) &&
+					     (fabsf(fy - cmp[i].y) < 0.05f))
+					{
 					
 						curvemap_insert(cuma, fx, fy);
 						curvemapping_changed(cumap, 0);

Modified: trunk/blender/source/blender/makesdna/intern/makesdna.c
===================================================================
--- trunk/blender/source/blender/makesdna/intern/makesdna.c	2011-11-27 21:18:59 UTC (rev 42195)
+++ trunk/blender/source/blender/makesdna/intern/makesdna.c	2011-11-27 23:41:01 UTC (rev 42196)
@@ -309,8 +309,9 @@
 			if (debugSDNA > 3) printf("seen %c ( %d) \n", str[j], str[j]);
 			j++;
 		}
-		if (debugSDNA > 3) printf("seen %c ( %d) \n", str[j], str[j]); 
-		if (debugSDNA > 3) printf("special after offset %d\n", j); 
+		if (debugSDNA > 3) printf("seen %c ( %d) \n"
+		                          "special after offset%d\n",
+		                          str[j], str[j], j);
 				
 		if (!isfuncptr) {
 			/* multidimensional array pointer case */

Modified: trunk/blender/source/blender/modifiers/intern/MOD_fluidsim_util.c
===================================================================
--- trunk/blender/source/blender/modifiers/intern/MOD_fluidsim_util.c	2011-11-27 21:18:59 UTC (rev 42195)
+++ trunk/blender/source/blender/modifiers/intern/MOD_fluidsim_util.c	2011-11-27 23:41:01 UTC (rev 42196)
@@ -572,6 +572,7 @@
 	/* unused */
 	(void)fluidmd;
 	(void)scene;
+	(void)ob;
 	(void)dm;
 	(void)useRenderParams;
 	return NULL;




More information about the Bf-blender-cvs mailing list