[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44801] trunk/blender: style cleanup: + some warning fixes, also remove unused metaelem extern.

Campbell Barton ideasman42 at gmail.com
Sat Mar 10 23:00:56 CET 2012


Revision: 44801
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44801
Author:   campbellbarton
Date:     2012-03-10 22:00:55 +0000 (Sat, 10 Mar 2012)
Log Message:
-----------
style cleanup: + some warning fixes, also remove unused metaelem extern.

Modified Paths:
--------------
    trunk/blender/extern/recastnavigation/Detour/Source/DetourStatNavMesh.cpp
    trunk/blender/source/blender/editors/mesh/bmesh_select.c
    trunk/blender/source/blender/editors/mesh/bmesh_tools.c
    trunk/blender/source/blender/editors/space_view3d/drawarmature.c
    trunk/blender/source/blender/editors/space_view3d/drawmesh.c
    trunk/blender/source/blender/editors/space_view3d/drawobject.c
    trunk/blender/source/blender/editors/space_view3d/view3d_edit.c
    trunk/blender/source/blender/editors/space_view3d/view3d_fly.c
    trunk/blender/source/blender/editors/space_view3d/view3d_select.c
    trunk/blender/source/blender/editors/space_view3d/view3d_snap.c
    trunk/blender/source/blender/editors/transform/transform_conversions.c
    trunk/blender/source/blender/editors/transform/transform_generics.c
    trunk/blender/source/blender/editors/transform/transform_orientations.c

Modified: trunk/blender/extern/recastnavigation/Detour/Source/DetourStatNavMesh.cpp
===================================================================
--- trunk/blender/extern/recastnavigation/Detour/Source/DetourStatNavMesh.cpp	2012-03-10 21:56:45 UTC (rev 44800)
+++ trunk/blender/extern/recastnavigation/Detour/Source/DetourStatNavMesh.cpp	2012-03-10 22:00:55 UTC (rev 44801)
@@ -465,7 +465,7 @@
 	if (!m_header) return 0;
 	if (!centerRef) return 0;
 	
-	dtStatPolyRef prevRef = centerRef;
+	/* dtStatPolyRef prevRef = centerRef; */ /* UNUSED */
 	dtStatPolyRef curRef = centerRef;
 	t = 0;
 
@@ -506,7 +506,7 @@
 		}
 		
 		// No hit, advance to neighbour polygon.
-		prevRef = curRef;
+		/* prevRef = curRef; */ /* UNUSED */
 		curRef = nextRef;
 	}
 	

Modified: trunk/blender/source/blender/editors/mesh/bmesh_select.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/bmesh_select.c	2012-03-10 21:56:45 UTC (rev 44800)
+++ trunk/blender/source/blender/editors/mesh/bmesh_select.c	2012-03-10 22:00:55 UTC (rev 44801)
@@ -227,9 +227,9 @@
 	
 	/* method in use for face selecting too */
 	if (vc->obedit == NULL) {
-		if (paint_facesel_test(vc->obact));
-		else if (paint_vertsel_test(vc->obact));
-		else return 0;
+		if (!(paint_facesel_test(vc->obact) || paint_vertsel_test(vc->obact))) {
+			return 0;
+		}
 	}
 	else if (vc->v3d->drawtype < OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT) == 0) {
 		return 0;
@@ -289,9 +289,9 @@
 	
 	/* method in use for face selecting too */
 	if (vc->obedit == NULL) {
-		if (paint_facesel_test(vc->obact));
-		else if (paint_vertsel_test(vc->obact));
-		else return 0;
+		if (!(paint_facesel_test(vc->obact) || paint_vertsel_test(vc->obact))) {
+			return 0;
+		}
 	}
 	else if (vc->v3d->drawtype < OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT) == 0) return 0;
 	

Modified: trunk/blender/source/blender/editors/mesh/bmesh_tools.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/bmesh_tools.c	2012-03-10 21:56:45 UTC (rev 44800)
+++ trunk/blender/source/blender/editors/mesh/bmesh_tools.c	2012-03-10 22:00:55 UTC (rev 44801)
@@ -465,7 +465,7 @@
 
 	if (nr < 1) return 'g';
 
-	if (nr == 1 && em->selectmode & SCE_SELECT_VERTEX)
+	if (nr == 1 && (em->selectmode & SCE_SELECT_VERTEX))
 		transmode = EDBM_Extrude_vert(obedit, em, BM_ELEM_SELECT, nor);
 	else if (nr == 1) transmode = EDBM_Extrude_edge(obedit, em, BM_ELEM_SELECT, nor);
 	else if (nr == 4) transmode = EDBM_Extrude_verts_indiv(em, op, BM_ELEM_SELECT, nor);
@@ -1810,12 +1810,6 @@
 
 /********************** UV/Color Operators *************************/
 
-
-static const EnumPropertyItem axis_items[] = {
-	{OPUVC_AXIS_X, "X", 0, "X", ""},
-	{OPUVC_AXIS_Y, "Y", 0, "Y", ""},
-	{0, NULL, 0, NULL, NULL}};
-
 static int mesh_rotate_uvs(bContext *C, wmOperator *op)
 {
 	Object *ob = CTX_data_edit_object(C);

Modified: trunk/blender/source/blender/editors/space_view3d/drawarmature.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawarmature.c	2012-03-10 21:56:45 UTC (rev 44800)
+++ trunk/blender/source/blender/editors/space_view3d/drawarmature.c	2012-03-10 22:00:55 UTC (rev 44801)
@@ -170,10 +170,18 @@
 			glColor3ubv(cp);
 		}
 		else {
-			if (boneflag & BONE_DRAW_ACTIVE && boneflag & BONE_SELECTED) UI_ThemeColorShade(TH_BONE_POSE, 40);
-			else if (boneflag & BONE_DRAW_ACTIVE) UI_ThemeColorBlend(TH_WIRE, TH_BONE_POSE, 0.15f); /* unselected active */
-			else if (boneflag & BONE_SELECTED) UI_ThemeColor(TH_BONE_POSE);
-			else UI_ThemeColor(TH_WIRE);
+			if ((boneflag & BONE_DRAW_ACTIVE) && (boneflag & BONE_SELECTED)) {
+				UI_ThemeColorShade(TH_BONE_POSE, 40);
+			}
+			else if (boneflag & BONE_DRAW_ACTIVE) {
+				UI_ThemeColorBlend(TH_WIRE, TH_BONE_POSE, 0.15f); /* unselected active */
+			}
+			else if (boneflag & BONE_SELECTED) {
+				UI_ThemeColor(TH_BONE_POSE);
+			}
+			else {
+				UI_ThemeColor(TH_WIRE);
+			}
 		}
 		
 		return 1;
@@ -290,10 +298,18 @@
 
 static void set_ebone_glColor(const unsigned int boneflag)
 {
-	if (boneflag & BONE_DRAW_ACTIVE && boneflag & BONE_SELECTED) UI_ThemeColor(TH_EDGE_SELECT);
-	else if (boneflag & BONE_DRAW_ACTIVE) UI_ThemeColorBlend(TH_WIRE, TH_EDGE_SELECT, 0.15f); /* unselected active */
-	else if (boneflag & BONE_SELECTED) UI_ThemeColorShade(TH_EDGE_SELECT, -20);
-	else UI_ThemeColor(TH_WIRE);
+	if ((boneflag & BONE_DRAW_ACTIVE) && (boneflag & BONE_SELECTED)) {
+		UI_ThemeColor(TH_EDGE_SELECT);
+	}
+	else if (boneflag & BONE_DRAW_ACTIVE) {
+		UI_ThemeColorBlend(TH_WIRE, TH_EDGE_SELECT, 0.15f); /* unselected active */
+	}
+	else if (boneflag & BONE_SELECTED) {
+		UI_ThemeColorShade(TH_EDGE_SELECT, -20);
+	}
+	else {
+		UI_ThemeColor(TH_WIRE);
+	}
 }
 
 /* *************** Armature drawing, helper calls for parts ******************* */
@@ -1749,16 +1765,21 @@
 							                 OB_SOLID, arm->flag, flag, index, bone->length);
 						}
 					}
-					else if (arm->drawtype==ARM_LINE)
-						;	/* nothing in solid */
-					else if (arm->drawtype==ARM_WIRE)
-						; 	/* nothing in solid */
-					else if (arm->drawtype==ARM_ENVELOPE)
+					else if (arm->drawtype == ARM_LINE) {
+						/* nothing in solid */
+					}
+					else if (arm->drawtype == ARM_WIRE) {
+						/* nothing in solid */
+					}
+					else if (arm->drawtype == ARM_ENVELOPE) {
 						draw_sphere_bone(OB_SOLID, arm->flag, flag, 0, index, pchan, NULL);
-					else if (arm->drawtype==ARM_B_BONE)
+					}
+					else if (arm->drawtype == ARM_B_BONE) {
 						draw_b_bone(OB_SOLID, arm->flag, flag, 0, index, pchan, NULL);
-					else
+					}
+					else {
 						draw_bone(OB_SOLID, arm->flag, flag, 0, index, bone->length);
+					}
 						
 					glPopMatrix();
 				}
@@ -1937,8 +1958,9 @@
 					/* set color-set to use */
 					set_pchan_colorset(ob, pchan);
 					
-					if ((pchan->custom) && !(arm->flag & ARM_NO_CUSTOM))
-						; // custom bone shapes should not be drawn here!
+					if ((pchan->custom) && !(arm->flag & ARM_NO_CUSTOM)) {
+						/* custom bone shapes should not be drawn here! */
+					}
 					else if (arm->drawtype==ARM_ENVELOPE) {
 						if (dt < OB_SOLID)
 							draw_sphere_bone_wire(smat, imat, arm->flag, flag, constflag, index, pchan, NULL);
@@ -1973,7 +1995,7 @@
 		draw_pose_dofs(ob);
 
 	/* finally names and axes */
-	if (arm->flag & (ARM_DRAWNAMES|ARM_DRAWAXES) && is_outline == 0) {
+	if ((arm->flag & (ARM_DRAWNAMES|ARM_DRAWAXES)) && (is_outline == 0)) {
 		/* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */
 		if ((G.f & G_PICKSEL) == 0) {
 			float vec[3];

Modified: trunk/blender/source/blender/editors/space_view3d/drawmesh.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawmesh.c	2012-03-10 21:56:45 UTC (rev 44800)
+++ trunk/blender/source/blender/editors/space_view3d/drawmesh.c	2012-03-10 22:00:55 UTC (rev 44801)
@@ -404,7 +404,7 @@
 		glColor3ub(0xFF, 0x00, 0xFF);
 		return DM_DRAW_OPTION_NO_MCOL; /* Don't set color */
 	}
-	else if (ma && ma->shade_flag&MA_OBCOLOR) {
+	else if (ma && (ma->shade_flag&MA_OBCOLOR)) {
 		glColor3ubv(Gtexdraw.obcol);
 		return DM_DRAW_OPTION_NO_MCOL; /* Don't set color */
 	}
@@ -444,7 +444,7 @@
 	if (tface && set_draw_settings_cached(0, tface, ma, Gtexdraw)) {
 		return DM_DRAW_OPTION_NO_MCOL; /* Don't set color */
 	}
-	else if (tface && tface->mode&TF_OBCOL) {
+	else if (tface && (tface->mode & TF_OBCOL)) {
 		return DM_DRAW_OPTION_NO_MCOL; /* Don't set color */
 	}
 	else if (!has_mcol) {
@@ -486,7 +486,7 @@
 				finalCol[i*4+j].r = 255;
 			}
 		}
-		else if (tface && tface->mode&TF_OBCOL) {
+		else if (tface && (tface->mode & TF_OBCOL)) {
 			for (j=0;j<4;j++) {
 				finalCol[i*4+j].b = FTOCHAR(Gtexdraw.obcol[0]);
 				finalCol[i*4+j].g = FTOCHAR(Gtexdraw.obcol[1]);

Modified: trunk/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawobject.c	2012-03-10 21:56:45 UTC (rev 44800)
+++ trunk/blender/source/blender/editors/space_view3d/drawobject.c	2012-03-10 22:00:55 UTC (rev 44801)
@@ -197,7 +197,7 @@
 	if (dt==OB_TEXTURE && vd->drawtype==OB_TEXTURE)
 		return 0;
 
-	if (vd->drawtype>=OB_SOLID && vd->flag2 & V3D_SOLID_TEX)
+	if ((vd->drawtype >= OB_SOLID) && (vd->flag2 & V3D_SOLID_TEX))
 		return 0;
 
 	return 1;
@@ -3246,7 +3246,7 @@
 	glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
 
 	if (dt==OB_BOUNDBOX) {
-		if ((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_WIRE)==0)
+		if (((v3d->flag2 & V3D_RENDER_OVERRIDE) && v3d->drawtype >= OB_WIRE)==0)
 			draw_bounding_volume(scene, ob, ob->boundtype);
 	}
 	else if (hasHaloMat || (totface==0 && totedge==0)) {
@@ -3498,7 +3498,7 @@
 			glDepthMask(0);	// disable write in zbuffer, selected edge wires show better
 		}
 		
-		if ((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_SOLID)==0)
+		if (((v3d->flag2 & V3D_RENDER_OVERRIDE) && v3d->drawtype >= OB_SOLID)==0)
 			dm->drawEdges(dm, (dt==OB_WIRE || totface==0), me->drawflag & ME_ALLEDGES);
 
 		if (dt!=OB_WIRE && (draw_wire == OBDRAW_WIRE_ON_DEPTH)) {
@@ -3540,8 +3540,8 @@
 	}
 	
 	if (obedit && ob!=obedit && ob->data==obedit->data) {
-		if (ob_get_key(ob) || ob_get_key(obedit));
-		else if (ob->modifiers.first || obedit->modifiers.first);
+		if (ob_get_key(ob) || ob_get_key(obedit)) {}
+		else if (ob->modifiers.first || obedit->modifiers.first) {}
 		else drawlinked= 1;
 	}
 	
@@ -3853,7 +3853,7 @@
 		GPU_end_object_materials();
 	}
 	else {
-		if ((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_SOLID)==0)
+		if (((v3d->flag2 & V3D_RENDER_OVERRIDE) && v3d->drawtype >= OB_SOLID)==0)
 			drawCurveDMWired (ob);
 	}
 
@@ -5407,7 +5407,9 @@
 								}
 							}
 							else {
-								if ( (bp->f1 & SELECT) && ( bp1->f1 & SELECT) );
+								if ((bp->f1 & SELECT) && (bp1->f1 & SELECT)) {
+									/* pass */
+								}
 								else {
 									UI_ThemeColor(TH_NURB_ULINE);
 		
@@ -5440,7 +5442,9 @@
 									}
 								}
 								else {
-									if ( (bp->f1 & SELECT) && ( bp1->f1 & SELECT) );
+									if ((bp->f1 & SELECT) && (bp1->f1 & SELECT)) {
+										/* pass */
+									}
 									else {
 										UI_ThemeColor(TH_NURB_VLINE);
 			
@@ -5504,7 +5508,7 @@
 
 	/* direction vectors for 3d curve paths

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list