[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17126] trunk/blender/source/blender: Reduced number of MSVC compiler warnings (mostly just casting issues).

Joshua Leung aligorith at gmail.com
Mon Oct 20 08:39:08 CEST 2008


Revision: 17126
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17126
Author:   aligorith
Date:     2008-10-20 08:39:08 +0200 (Mon, 20 Oct 2008)

Log Message:
-----------
Reduced number of MSVC compiler warnings (mostly just casting issues).

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/constraint.c
    trunk/blender/source/blender/blenkernel/intern/ipo.c
    trunk/blender/source/blender/src/drawaction.c
    trunk/blender/source/blender/src/drawgpencil.c
    trunk/blender/source/blender/src/editaction.c
    trunk/blender/source/blender/src/editaction_gpencil.c
    trunk/blender/source/blender/src/editipo.c
    trunk/blender/source/blender/src/editnla.c
    trunk/blender/source/blender/src/gpencil.c
    trunk/blender/source/blender/src/header_time.c
    trunk/blender/source/blender/src/keyframing.c
    trunk/blender/source/blender/src/outliner.c
    trunk/blender/source/blender/src/poselib.c
    trunk/blender/source/blender/src/space.c
    trunk/blender/source/blender/src/transform_conversions.c
    trunk/blender/source/blender/src/view.c

Modified: trunk/blender/source/blender/blenkernel/intern/constraint.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/constraint.c	2008-10-20 04:53:49 UTC (rev 17125)
+++ trunk/blender/source/blender/blenkernel/intern/constraint.c	2008-10-20 06:39:08 UTC (rev 17126)
@@ -842,7 +842,7 @@
 			if (nocopy == 0) { \
 				datatar= ct->tar; \
 				strcpy(datasubtarget, ct->subtarget); \
-				con->tarspace= ct->space; \
+				con->tarspace= (char)ct->space; \
 			} \
 			 \
 			BLI_freelinkN(list, ct); \
@@ -862,7 +862,7 @@
 			bConstraintTarget *ctn = ct->next; \
 			if (nocopy == 0) { \
 				datatar= ct->tar; \
-				con->tarspace= ct->space; \
+				con->tarspace= (char)ct->space; \
 			} \
 			 \
 			BLI_freelinkN(list, ct); \
@@ -1434,9 +1434,9 @@
 	Mat4ToEul(cob->matrix, eul);
 	
 	/* eulers: radians to degrees! */
-	eul[0] = (eul[0] / M_PI * 180);
-	eul[1] = (eul[1] / M_PI * 180);
-	eul[2] = (eul[2] / M_PI * 180);
+	eul[0] = (float)(eul[0] / M_PI * 180);
+	eul[1] = (float)(eul[1] / M_PI * 180);
+	eul[2] = (float)(eul[2] / M_PI * 180);
 	
 	/* limiting of euler values... */
 	if (data->flag & LIMIT_XROT) {
@@ -1462,9 +1462,9 @@
 	}
 		
 	/* eulers: degrees to radians ! */
-	eul[0] = (eul[0] / 180 * M_PI); 
-	eul[1] = (eul[1] / 180 * M_PI);
-	eul[2] = (eul[2] / 180 * M_PI);
+	eul[0] = (float)(eul[0] / 180 * M_PI); 
+	eul[1] = (float)(eul[1] / 180 * M_PI);
+	eul[2] = (float)(eul[2] / 180 * M_PI);
 	
 	LocEulSizeToMat4(cob->matrix, loc, eul, size);
 }
@@ -2508,7 +2508,7 @@
 			else if (data->flag & LIMITDIST_USESOFT) {
 				// FIXME: there's a problem with "jumping" when this kicks in
 				if (dist >= (data->dist - data->soft)) {
-					sfac = data->soft*(1.0 - exp(-(dist - data->dist)/data->soft)) + data->dist;
+					sfac = (float)( data->soft*(1.0 - exp(-(dist - data->dist)/data->soft)) + data->dist );
 					sfac /= dist;
 					
 					clamp_surf= 1;
@@ -3139,7 +3139,7 @@
 			case 1: /* rotation (convert to degrees first) */
 				Mat4ToEul(ct->matrix, dvec);
 				for (i=0; i<3; i++)
-					dvec[i] = dvec[i] / M_PI * 180;
+					dvec[i] = (float)(dvec[i] / M_PI * 180);
 				break;
 			default: /* location */
 				VecCopyf(dvec, ct->matrix[3]);
@@ -3189,7 +3189,7 @@
 					eul[i]= tmin + (sval[data->map[i]] * (tmax - tmin)); 
 					
 					/* now convert final value back to radians */
-					eul[i] = eul[i] / 180 * M_PI;
+					eul[i] = (float)(eul[i] / 180 * M_PI);
 				}
 				break;
 			default: /* location */

Modified: trunk/blender/source/blender/blenkernel/intern/ipo.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/ipo.c	2008-10-20 04:53:49 UTC (rev 17125)
+++ trunk/blender/source/blender/blenkernel/intern/ipo.c	2008-10-20 06:39:08 UTC (rev 17126)
@@ -234,46 +234,46 @@
 {
 	switch (blocktype) {
 	case ID_CA:
-		cur->xmin= G.scene->r.sfra;
-		cur->xmax= G.scene->r.efra;
-		cur->ymin= 0.0;
-		cur->ymax= 100.0;
+		cur->xmin= (float)G.scene->r.sfra;
+		cur->xmax= (float)G.scene->r.efra;
+		cur->ymin= 0.0f;
+		cur->ymax= 100.0f;
 		break;
 		
 	case ID_MA: case ID_WO: case ID_LA: 
 	case ID_CU: case ID_CO:
-		cur->xmin= (float)G.scene->r.sfra-0.1;
-		cur->xmax= G.scene->r.efra;
-		cur->ymin= (float)-0.1;
-		cur->ymax= (float)+1.1;
+		cur->xmin= (float)(G.scene->r.sfra - 0.1f);
+		cur->xmax= (float)G.scene->r.efra;
+		cur->ymin= (float)-0.1f;
+		cur->ymax= (float)+1.1f;
 		break;
 		
 	case ID_TE:
-		cur->xmin= (float)G.scene->r.sfra-0.1;
-		cur->xmax= G.scene->r.efra;
-		cur->ymin= (float)-0.1;
-		cur->ymax= (float)+1.1;
+		cur->xmin= (float)(G.scene->r.sfra - 0.1f);
+		cur->xmax= (float)G.scene->r.efra;
+		cur->ymin= (float)-0.1f;
+		cur->ymax= (float)+1.1f;
 		break;
 		
 	case ID_SEQ:
-		cur->xmin= -5.0;
-		cur->xmax= 105.0;
-		cur->ymin= (float)-0.1;
-		cur->ymax= (float)+1.1;
+		cur->xmin= -5.0f;
+		cur->xmax= 105.0f;
+		cur->ymin= (float)-0.1f;
+		cur->ymax= (float)+1.1f;
 		break;
 		
 	case ID_KE:
-		cur->xmin= (float)G.scene->r.sfra-0.1;
-		cur->xmax= G.scene->r.efra;
-		cur->ymin= (float)-0.1;
-		cur->ymax= (float)+2.1;
+		cur->xmin= (float)(G.scene->r.sfra - 0.1f);
+		cur->xmax= (float)G.scene->r.efra;
+		cur->ymin= (float)-0.1f;
+		cur->ymax= (float)+2.1f;
 		break;
 		
 	default:	/* ID_OB and everything else */
-		cur->xmin= G.scene->r.sfra;
-		cur->xmax= G.scene->r.efra;
-		cur->ymin= -5.0;
-		cur->ymax= +5.0;
+		cur->xmin= (float)G.scene->r.sfra;
+		cur->xmax= (float)G.scene->r.efra;
+		cur->ymin= -5.0f;
+		cur->ymax= +5.0f;
 		break;
 	}
 }
@@ -1053,11 +1053,11 @@
 			case OB_LOC_Z:
 				return ob->loc[2];
 			case OB_ROT_X:	/* hack: euler rotations are divided by 10 deg to fit on same axes as other channels */
-				return ob->rot[0]/(M_PI_2/9.0);
+				return (float)( ob->rot[0]/(M_PI_2/9.0) );
 			case OB_ROT_Y:	/* hack: euler rotations are divided by 10 deg to fit on same axes as other channels */
-				return ob->rot[1]/(M_PI_2/9.0);
+				return (float)( ob->rot[1]/(M_PI_2/9.0) );
 			case OB_ROT_Z:	/* hack: euler rotations are divided by 10 deg to fit on same axes as other channels */
-				return ob->rot[2]/(M_PI_2/9.0);
+				return (float)( ob->rot[2]/(M_PI_2/9.0) );
 			case OB_SIZE_X:
 				return ob->size[0];
 			case OB_SIZE_Y:
@@ -1090,7 +1090,7 @@
 						angle = 2.0f * (saacos(quat[0]));
 						angle= ABS(angle);
 						
-						return (angle > M_PI) ? ((2.0f * M_PI) - angle) : (angle);
+						return (angle > M_PI) ? (float)((2.0f * M_PI) - angle) : (float)(angle);
 					}
 				}
 				
@@ -1112,11 +1112,11 @@
 					case OB_LOC_Z:
 						return loc[2];
 					case OB_ROT_X: /* hack: euler rotations are divided by 10 deg to fit on same axes as other channels */
-						return eul[0]/(M_PI_2/9.0);
+						return (float)( eul[0]/(M_PI_2/9.0) );
 					case OB_ROT_Y: /* hack: euler rotations are divided by 10 deg to fit on same axes as other channels */
-						return eul[1]/(M_PI_2/9.0);
+						return (float)( eul[1]/(M_PI_2/9.0) );
 					case OB_ROT_Z: /* hack: euler rotations are divided by 10 deg to fit on same axes as other channels */
-						return eul[2]/(M_PI_2/9.0);
+						return (float)( eul[2]/(M_PI_2/9.0) );
 					case OB_SIZE_X:
 						return size[0];
 					case OB_SIZE_Y:
@@ -2487,79 +2487,92 @@
 		{
 			switch (icu->adrcode & (MA_MAP1-1)) {
 				case TE_NSIZE:
-					icu->ymin= 0.0001;
-					icu->ymax= 2.0; break;
+					icu->ymin= 0.0001f;
+					icu->ymax= 2.0f; 
+					break;
 				case TE_NDEPTH:
 					icu->vartype= IPO_SHORT;
 					icu->ipo= IPO_CONST;
-					icu->ymax= 6.0; break;
+					icu->ymax= 6.0f; 
+					break;
 				case TE_NTYPE:
 					icu->vartype= IPO_SHORT;
 					icu->ipo= IPO_CONST;
-					icu->ymax= 1.0; break;
+					icu->ymax= 1.0f; 
+					break;
 				case TE_TURB:
-					icu->ymax= 200.0; break;
+					icu->ymax= 200.0f; 
+					break;
 				case TE_VNW1:
 				case TE_VNW2:
 				case TE_VNW3:
 				case TE_VNW4:
-					icu->ymax= 2.0;
-					icu->ymin= -2.0; break;
+					icu->ymax= 2.0f;
+					icu->ymin= -2.0f; 
+					break;
 				case TE_VNMEXP:
-					icu->ymax= 10.0;
-					icu->ymin= 0.01; break;
+					icu->ymax= 10.0f;
+					icu->ymin= 0.01f; 
+					break;
 				case TE_VN_DISTM:
 					icu->vartype= IPO_SHORT;
 					icu->ipo= IPO_CONST;
-					icu->ymax= 6.0; break;
+					icu->ymax= 6.0f; 
+					break;
 				case TE_VN_COLT:
 					icu->vartype= IPO_SHORT;
 					icu->ipo= IPO_CONST;
-					icu->ymax= 3.0; break;
+					icu->ymax= 3.0f; 
+					break;
 				case TE_ISCA:
-					icu->ymax= 10.0;
-					icu->ymin= 0.01; break;
+					icu->ymax= 10.0f;
+					icu->ymin= 0.01f; 
+					break;
 				case TE_DISTA:
-					icu->ymax= 10.0; break;
+					icu->ymax= 10.0f; 
+					break;
 				case TE_MG_TYP:
 					icu->vartype= IPO_SHORT;
 					icu->ipo= IPO_CONST;
-					icu->ymax= 6.0; break;
+					icu->ymax= 6.0f; 
+					break;
 				case TE_MGH:
-					icu->ymin= 0.0001;
-					icu->ymax= 2.0; break;
+					icu->ymin= 0.0001f;
+					icu->ymax= 2.0f; 
+					break;
 				case TE_MG_LAC:
 				case TE_MG_OFF:
 				case TE_MG_GAIN:
-					icu->ymax= 6.0; break;
+					icu->ymax= 6.0f; break;
 				case TE_MG_OCT:
-					icu->ymax= 8.0; break;
+					icu->ymax= 8.0f; break;
 				case TE_N_BAS1:
 				case TE_N_BAS2:
 					icu->vartype= IPO_SHORT;
 					icu->ipo= IPO_CONST;
-					icu->ymax= 8.0; break;
+					icu->ymax= 8.0f; 
+					break;
 				case TE_COL_R:
-					icu->ymax= 0.0; break;
+					icu->ymax= 0.0f; break;
 				case TE_COL_G:
-					icu->ymax= 2.0; break;
+					icu->ymax= 2.0f; break;
 				case TE_COL_B:
-					icu->ymax= 2.0; break;
+					icu->ymax= 2.0f; break;
 				case TE_BRIGHT:
-					icu->ymax= 2.0; break;
+					icu->ymax= 2.0f; break;
 				case TE_CONTRA:
-					icu->ymax= 5.0; break;	
+					icu->ymax= 5.0f; break;	
 			}
 		}
 			break;
 		case ID_SEQ: /* sequence channels -----------------------------  */
 		{
-			icu->ymax= 1.0;
+			icu->ymax= 1.0f;
 		}
 			break;
 		case ID_CU: /* curve channels -----------------------------  */
 		{
-			icu->ymax= 1.0;
+			icu->ymax= 1.0f;
 		}
 			break;
 		case ID_WO: /* world channels -----------------------------  */
@@ -2567,7 +2580,8 @@
 			if (icu->adrcode < MA_MAP1) {
 				switch (icu->adrcode) {
 				case WO_EXPOS:
-					icu->ymax= 5.0; break;
+					icu->ymax= 5.0f; break;
+				
 				case WO_MISTDI:
 				case WO_MISTSTA:
 				case WO_MISTHI:
@@ -2576,7 +2590,7 @@
 					break;
 					
 				default:
-					icu->ymax= 1.0;
+					icu->ymax= 1.0f;
 					break;
 				}
 			}
@@ -2588,8 +2602,8 @@
 				case MAP_SIZE_X:
 				case MAP_SIZE_Y:
 				case MAP_SIZE_Z:
-					icu->ymax= 100.0;
-					icu->ymin= -100.0;
+					icu->ymax= 100.0f;
+					icu->ymin= -100.0f;
 					break;
 				case MAP_R:
 				case MAP_G:
@@ -2599,7 +2613,7 @@
 				case MAP_NORF:
 				case MAP_VARF:
 				case MAP_DISP:
-					icu->ymax= 1.0;
+					icu->ymax= 1.0f;
 				}
 			}
 		}
@@ -2618,13 +2632,13 @@
 				case LA_SPOTBL:
 				case LA_QUAD1:
 				case LA_QUAD2:
-					icu->ymax= 1.0; break;
+					icu->ymax= 1.0f; break;
 					
 				case LA_SPOTSI:
-					icu->ymax= 180.0; break;
+					icu->ymax= 180.0f; break;
 				
 				case LA_HALOINT:
-					icu->ymax= 5.0; break;
+					icu->ymax= 5.0f; break;
 				}
 			}
 			else {
@@ -2635,8 +2649,8 @@
 				case MAP_SIZE_X:
 				case MAP_SIZE_Y:
 				case MAP_SIZE_Z:
-					icu->ymax= 100.0;
-					icu->ymin= -100.0;
+					icu->ymax= 100.0f;
+					icu->ymin= -100.0f;
 					break;
 				case MAP_R:
 				case MAP_G:
@@ -2646,7 +2660,7 @@
 				case MAP_NORF:
 				case MAP_VARF:
 				case MAP_DISP:
-					icu->ymax= 1.0;
+					icu->ymax= 1.0f;
 				}
 			}
 		}	
@@ -2655,8 +2669,8 @@
 		{
 			switch (icu->adrcode) {
 			case CAM_LENS:
-				icu->ymin= 1.0;

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list