[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52146] trunk/blender/source/blender/bmesh /operators/bmo_bevel.c: change bevel do/ while loops to step the pointer in the while check, no functional changes.

Campbell Barton ideasman42 at gmail.com
Mon Nov 12 13:16:24 CET 2012


Revision: 52146
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52146
Author:   campbellbarton
Date:     2012-11-12 12:16:21 +0000 (Mon, 12 Nov 2012)
Log Message:
-----------
change bevel do/while loops to step the pointer in the while check, no functional changes.

Modified Paths:
--------------
    trunk/blender/source/blender/bmesh/operators/bmo_bevel.c

Modified: trunk/blender/source/blender/bmesh/operators/bmo_bevel.c
===================================================================
--- trunk/blender/source/blender/bmesh/operators/bmo_bevel.c	2012-11-12 12:10:46 UTC (rev 52145)
+++ trunk/blender/source/blender/bmesh/operators/bmo_bevel.c	2012-11-12 12:16:21 UTC (rev 52146)
@@ -188,10 +188,10 @@
 		from_e = &bv->edges[bv->edgecount - 1];
 	e = from_e;
 	do {
-		if (e->isbev)
+		if (e->isbev) {
 			return e;
-		e = e->next;
-	} while (e != from_e);
+		}
+	} while ((e = e->next) != from_e);
 	return NULL;
 }
 
@@ -440,8 +440,7 @@
 {
 	float otherco[3];
 
-	if (!isect_line_line_v3(e->v1->co, e->v2->co, co_a, co_b,
-	                        projco, otherco)) {
+	if (!isect_line_line_v3(e->v1->co, e->v2->co, co_a, co_b, projco, otherco)) {
 		BLI_assert(!"project meet failure");
 		copy_v3_v3(projco, e->v1->co);
 	}
@@ -639,10 +638,9 @@
 			/* e is not beveled */
 			if (e->next->isbev) {
 				/* next iteration will place e between beveled previous and next edges */
-				e = e->next;
-				continue;
+				/* do nothing... */
 			}
-			if (e->prev->isbev) {
+			else if (e->prev->isbev) {
 				/* on-edge meet between e->prev and e */
 				offset_meet(e->prev, e, bv->v, e->fprev, TRUE, co);
 				v = add_new_bound_vert(vm, co);
@@ -663,8 +661,7 @@
 				e->leftv = v;
 			}
 		}
-		e = e->next;
-	} while (e != efirst);
+	} while ((e = e->next) != efirst);
 
 	BLI_assert(vm->count >= 2);
 	if (vm->count == 2 && bv->edgecount == 3)
@@ -733,8 +730,7 @@
 					copy_v3_v3(mesh_vert(vm, i, ring, k)->co, co);
 				}
 			}
-			v = v->next;
-		} while (v != vm->boundstart);
+		} while ((v = v->next) != vm->boundstart);
 	}
 
 	/* Now make sure cross points of rings share coordinates and vertices.
@@ -783,8 +779,7 @@
 				}
 			}
 		}
-		v = v->next;
-	} while (v != vm->boundstart);
+	} while ((v = v->next) != vm->boundstart);
 
 	if (ns % 2 == 0) {
 		/* Do special case center lines.
@@ -829,8 +824,7 @@
 					}
 				}
 			}
-			v = v->next;
-		} while (v != vm->boundstart);
+		} while ((v = v->next) != vm->boundstart);
 
 		/* center point need to be average of all centers of rings */
 		/* TODO: this is wrong if not all verts have ebev: could have
@@ -845,8 +839,7 @@
 				add_v3_v3(midco, nv->co);
 				nn++;
 			}
-			v = v->next;
-		} while (v != vm->boundstart);
+		} while ((v = v->next) != vm->boundstart);
 		mul_v3_fl(midco, 1.0f / nn);
 		bmv = BM_vert_create(bm, midco, NULL);
 		v = vm->boundstart;
@@ -857,8 +850,7 @@
 				copy_v3_v3(nv->co, midco);
 				nv->v = bmv;
 			}
-			v = v->next;
-		} while (v != vm->boundstart);
+		} while ((v = v->next) != vm->boundstart);
 	}
 
 	/* Make the ring quads */
@@ -896,8 +888,7 @@
 					bev_create_quad_tri(bm, bmv1, bmv2, bmv3, bmv4, f);
 				}
 			}
-			v = v->next;
-		} while (v != vm->boundstart);
+		} while ((v = v->next) != vm->boundstart);
 	}
 
 	/* Make center ngon if odd number of segments and fully beveled */
@@ -910,8 +901,7 @@
 			i = v->index;
 			BLI_assert(v->ebev);
 			BLI_array_append(vv, mesh_vert(vm, i, ns2, ns2)->v);
-			v = v->next;
-		} while (v != vm->boundstart);
+		} while ((v = v->next) != vm->boundstart);
 		f = boundvert_rep_face(vm->boundstart);
 		bev_create_ngon(bm, vv, BLI_array_count(vv), f);
 
@@ -968,8 +958,7 @@
 				BLI_array_append(vv, mesh_vert(vm, i, 0, 0)->v);
 				j++;
 			}
-			v = v->next;
-		} while (v != vm->boundstart);
+		} while ((v = v->next) != vm->boundstart);
 		if (vv[0] == vv[j - 1])
 			j--;
 		bev_create_ngon(bm, vv, j, f);
@@ -999,8 +988,7 @@
 				n++;
 			}
 		}
-		v = v->next;
-	} while (v != vm->boundstart);
+	} while ((v = v->next) != vm->boundstart);
 	if (n > 2) {
 		f = bev_create_ngon(bm, vv, n, boundvert_rep_face(v));
 	}
@@ -1036,13 +1024,13 @@
 
 			if (f_new->len > f->len) {
 				f = f_new;
-				if      (l_new->v ==       v_fan) { l_fan = l_new; }
+				if      (l_new->v       == v_fan) { l_fan = l_new; }
 				else if (l_new->next->v == v_fan) { l_fan = l_new->next; }
 				else if (l_new->prev->v == v_fan) { l_fan = l_new->prev; }
 				else { BLI_assert(0); }
 			}
 			else {
-				if      (l_fan->v ==       v_fan) { l_fan = l_fan; }
+				if      (l_fan->v       == v_fan) { l_fan = l_fan; }
 				else if (l_fan->next->v == v_fan) { l_fan = l_fan->next; }
 				else if (l_fan->prev->v == v_fan) { l_fan = l_fan->prev; }
 				else { BLI_assert(0); }
@@ -1084,8 +1072,7 @@
 			else
 				weld2 = v;
 		}
-		v = v->next;
-	} while (v != vm->boundstart);
+	} while ((v = v->next) != vm->boundstart);
 
 	/* copy other ends to (i, 0, ns) for all i, and fill in profiles for beveled edges */
 	v = vm->boundstart;
@@ -1103,8 +1090,7 @@
 					create_mesh_bmvert(bm, vm, i, 0, k, bv->v);
 			}
 		}
-		v = v->next;
-	} while (v != vm->boundstart);
+	} while ((v = v->next) != vm->boundstart);
 
 	if (weld) {
 		vm->mesh_kind = M_NONE;
@@ -1419,8 +1405,7 @@
 			do {
 				vnext = v->next;
 				MEM_freeN(v);
-				v = vnext;
-			} while (v != vm->boundstart);
+			} while ((v = vnext) != vm->boundstart);
 		}
 		if (vm->mesh)
 			MEM_freeN(vm->mesh);




More information about the Bf-blender-cvs mailing list