[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50482] trunk/blender/source/blender: style cleanup:

Campbell Barton ideasman42 at gmail.com
Sun Sep 9 02:00:23 CEST 2012


Revision: 50482
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50482
Author:   campbellbarton
Date:     2012-09-09 00:00:21 +0000 (Sun, 09 Sep 2012)
Log Message:
-----------
style cleanup:
also remove some redundant conversions int -> short -> int

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/action.c
    trunk/blender/source/blender/blenkernel/intern/blender.c
    trunk/blender/source/blender/blenkernel/intern/constraint.c
    trunk/blender/source/blender/editors/gpencil/drawgpencil.c
    trunk/blender/source/blender/editors/gpencil/gpencil_paint.c
    trunk/blender/source/blender/editors/interface/interface.c
    trunk/blender/source/blender/editors/interface/interface_handlers.c
    trunk/blender/source/blender/editors/interface/interface_icons.c
    trunk/blender/source/blender/editors/interface/view2d.c
    trunk/blender/source/blender/editors/interface/view2d_ops.c
    trunk/blender/source/blender/editors/mesh/editface.c
    trunk/blender/source/blender/editors/object/object_constraint.c
    trunk/blender/source/blender/editors/object/object_relations.c
    trunk/blender/source/blender/editors/object/object_vgroup.c
    trunk/blender/source/blender/editors/screen/screen_edit.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c
    trunk/blender/source/blender/editors/space_action/action_select.c
    trunk/blender/source/blender/editors/space_graph/graph_draw.c
    trunk/blender/source/blender/editors/space_graph/graph_select.c
    trunk/blender/source/blender/editors/space_image/image_ops.c
    trunk/blender/source/blender/editors/space_logic/logic_window.c
    trunk/blender/source/blender/editors/space_nla/nla_select.c
    trunk/blender/source/blender/editors/space_node/node_edit.c
    trunk/blender/source/blender/editors/space_outliner/outliner_draw.c
    trunk/blender/source/blender/editors/space_outliner/outliner_tree.c
    trunk/blender/source/blender/editors/space_sequencer/sequencer_edit.c
    trunk/blender/source/blender/editors/space_view3d/drawarmature.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_header.c
    trunk/blender/source/blender/editors/space_view3d/view3d_select.c
    trunk/blender/source/blender/editors/space_view3d/view3d_view.c

Modified: trunk/blender/source/blender/blenkernel/intern/action.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/action.c	2012-09-08 23:26:15 UTC (rev 50481)
+++ trunk/blender/source/blender/blenkernel/intern/action.c	2012-09-09 00:00:21 UTC (rev 50482)
@@ -810,7 +810,7 @@
 	/* TODO: proxies may/may not be correctly handled here... (this needs checking) */
 	for (ob = G.main->object.first; ob; ob = ob->id.next) {
 		/* we only need to do this on objects with a pose */
-		if ( (pose = ob->pose) ) {
+		if ((pose = ob->pose)) {
 			for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
 				if (pchan->bone) 
 					pchan->bone->flag &= ~BONE_UNKEYED;

Modified: trunk/blender/source/blender/blenkernel/intern/blender.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/blender.c	2012-09-08 23:26:15 UTC (rev 50481)
+++ trunk/blender/source/blender/blenkernel/intern/blender.c	2012-09-09 00:00:21 UTC (rev 50482)
@@ -513,8 +513,13 @@
 	int nr /*, success */ /* UNUSED */;
 	UndoElem *uel;
 	
-	if ( (U.uiflag & USER_GLOBALUNDO) == 0) return;
-	if (U.undosteps == 0) return;
+	if ((U.uiflag & USER_GLOBALUNDO) == 0) {
+		return;
+	}
+
+	if (U.undosteps == 0) {
+		return;
+	}
 	
 	/* remove all undos after (also when curundo == NULL) */
 	while (undobase.last != curundo) {

Modified: trunk/blender/source/blender/blenkernel/intern/constraint.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/constraint.c	2012-09-08 23:26:15 UTC (rev 50481)
+++ trunk/blender/source/blender/blenkernel/intern/constraint.c	2012-09-09 00:00:21 UTC (rev 50482)
@@ -4292,8 +4292,8 @@
 	}
 	
 	/* only return for valid types */
-	if ( (type >= CONSTRAINT_TYPE_NULL) && 
-	     (type < NUM_CONSTRAINT_TYPES) )
+	if ((type >= CONSTRAINT_TYPE_NULL) &&
+	    (type < NUM_CONSTRAINT_TYPES))
 	{
 		/* there shouldn't be any segfaults here... */
 		return constraintsTypeInfo[type];

Modified: trunk/blender/source/blender/editors/gpencil/drawgpencil.c
===================================================================
--- trunk/blender/source/blender/editors/gpencil/drawgpencil.c	2012-09-08 23:26:15 UTC (rev 50481)
+++ trunk/blender/source/blender/editors/gpencil/drawgpencil.c	2012-09-09 00:00:21 UTC (rev 50482)
@@ -177,8 +177,8 @@
 		/* if thickness is less than GP_DRAWTHICKNESS_SPECIAL, simple dot looks ok
 		 *  - also mandatory in if Image Editor 'image-based' dot
 		 */
-		if ( (thickness < GP_DRAWTHICKNESS_SPECIAL) ||
-		     ((dflag & GP_DRAWDATA_IEDITHACK) && (sflag & GP_STROKE_2DSPACE)) )
+		if ((thickness < GP_DRAWTHICKNESS_SPECIAL) ||
+		    ((dflag & GP_DRAWDATA_IEDITHACK) && (sflag & GP_STROKE_2DSPACE)))
 		{
 			glBegin(GL_POINTS);
 			glVertex2fv(co);
@@ -253,8 +253,8 @@
 	/* if thickness is less than GP_DRAWTHICKNESS_SPECIAL, 'smooth' opengl lines look better
 	 *  - 'smooth' opengl lines are also required if Image Editor 'image-based' stroke
 	 */
-	if ( (thickness < GP_DRAWTHICKNESS_SPECIAL) || 
-	     ((dflag & GP_DRAWDATA_IEDITHACK) && (dflag & GP_DRAWDATA_ONLYV2D)) )
+	if ((thickness < GP_DRAWTHICKNESS_SPECIAL) ||
+	    ((dflag & GP_DRAWDATA_IEDITHACK) && (dflag & GP_DRAWDATA_ONLYV2D)))
 	{
 		bGPDspoint *pt;
 		int i;

Modified: trunk/blender/source/blender/editors/gpencil/gpencil_paint.c
===================================================================
--- trunk/blender/source/blender/editors/gpencil/gpencil_paint.c	2012-09-08 23:26:15 UTC (rev 50481)
+++ trunk/blender/source/blender/editors/gpencil/gpencil_paint.c	2012-09-09 00:00:21 UTC (rev 50482)
@@ -778,7 +778,8 @@
 }
 
 /* eraser tool - check if part of stroke occurs within last segment drawn by eraser */
-static short gp_stroke_eraser_strokeinside(int mval[], int UNUSED(mvalo[]), short rad, short x0, short y0, short x1, short y1)
+static short gp_stroke_eraser_strokeinside(const int mval[], const int UNUSED(mvalo[]),
+                                           int rad, int x0, int y0, int x1, int y1)
 {
 	/* simple within-radius check for now */
 	if (edge_inside_circle(mval[0], mval[1], rad, x0, y0, x1, y1))
@@ -790,7 +791,9 @@
 
 /* eraser tool - evaluation per stroke */
 // TODO: this could really do with some optimization (KD-Tree/BVH?)
-static void gp_stroke_eraser_dostroke(tGPsdata *p, int mval[], int mvalo[], short rad, rcti *rect, bGPDframe *gpf, bGPDstroke *gps)
+static void gp_stroke_eraser_dostroke(tGPsdata *p,
+                                      const int mval[], const int mvalo[],
+                                      short rad, const rcti *rect, bGPDframe *gpf, bGPDstroke *gps)
 {
 	bGPDspoint *pt1, *pt2;
 	int x0 = 0, y0 = 0, x1 = 0, y1 = 0;
@@ -827,7 +830,7 @@
 		/* do boundbox check first */
 		if (BLI_rcti_isect_pt(rect, x0, y0)) {
 			/* only check if point is inside */
-			if ( ((x0 - mval[0]) * (x0 - mval[0]) + (y0 - mval[1]) * (y0 - mval[1])) <= rad * rad) {
+			if (((x0 - mval[0]) * (x0 - mval[0]) + (y0 - mval[1]) * (y0 - mval[1])) <= rad * rad) {
 				/* free stroke */
 				MEM_freeN(gps->points);
 				BLI_freelinkN(&gpf->strokes, gps);

Modified: trunk/blender/source/blender/editors/interface/interface.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface.c	2012-09-08 23:26:15 UTC (rev 50481)
+++ trunk/blender/source/blender/editors/interface/interface.c	2012-09-09 00:00:21 UTC (rev 50482)
@@ -1242,8 +1242,7 @@
 		else {
 			b = 0;
 			for (a = 0; a < (*(link->totlink)); a++) {
-				
-				if ( (*(link->ppoin))[a] != line->to->poin) {
+				if ((*(link->ppoin))[a] != line->to->poin) {
 					(*(link->ppoin))[b] = (*(link->ppoin))[a];
 					b++;
 				}
@@ -2468,7 +2467,7 @@
 					flag |= UI_BUT_ALIGN_TOP;
 				}
 				
-				if ( (flag & UI_BUT_ALIGN_TOP) == 0) {    /* stil top row */
+				if ((flag & UI_BUT_ALIGN_TOP) == 0) {  /* stil top row */
 					if (prev) {
 						if (next && buts_are_horiz(but, next))
 							flag = UI_BUT_ALIGN_DOWN | UI_BUT_ALIGN_LEFT | UI_BUT_ALIGN_RIGHT;

Modified: trunk/blender/source/blender/editors/interface/interface_handlers.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_handlers.c	2012-09-08 23:26:15 UTC (rev 50481)
+++ trunk/blender/source/blender/editors/interface/interface_handlers.c	2012-09-09 00:00:21 UTC (rev 50482)
@@ -755,7 +755,7 @@
 							b = 0;
 							for (a = 0; a < (*(link->totlink)); a++) {
 								
-								if ( (*(link->ppoin))[a] != line->to->poin) {
+								if ((*(link->ppoin))[a] != line->to->poin) {
 									(*(link->ppoin))[b] = (*(link->ppoin))[a];
 									b++;
 								}
@@ -866,7 +866,7 @@
 	void **oldppoin;
 	int a;
 	
-	if ( (line = ui_is_a_link(from, to)) ) {
+	if ((line = ui_is_a_link(from, to))) {
 		line->flag |= UI_SELECT;
 		ui_delete_active_linkline(from->block);
 		return;

Modified: trunk/blender/source/blender/editors/interface/interface_icons.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_icons.c	2012-09-08 23:26:15 UTC (rev 50481)
+++ trunk/blender/source/blender/editors/interface/interface_icons.c	2012-09-09 00:00:21 UTC (rev 50482)
@@ -620,7 +620,7 @@
 	if (restoredir && !chdir(olddir)) {} /* fix warning about checking return value */
 
 	for (i = 0; i < totfile; i++) {
-		if ( (dir[i].type & S_IFREG) ) {
+		if ((dir[i].type & S_IFREG)) {
 			char *filename = dir[i].relname;
 			
 			if (BLI_testextensie(filename, ".png")) {

Modified: trunk/blender/source/blender/editors/interface/view2d.c
===================================================================
--- trunk/blender/source/blender/editors/interface/view2d.c	2012-09-08 23:26:15 UTC (rev 50481)
+++ trunk/blender/source/blender/editors/interface/view2d.c	2012-09-09 00:00:21 UTC (rev 50482)
@@ -544,7 +544,7 @@
 		curheight = BLI_RCT_SIZE_Y(cur);
 		
 		/* width */
-		if ( (curwidth > totwidth) && !(v2d->keepzoom & (V2D_KEEPZOOM | V2D_LOCKZOOM_X | V2D_LIMITZOOM)) ) {
+		if ((curwidth > totwidth) && !(v2d->keepzoom & (V2D_KEEPZOOM | V2D_LOCKZOOM_X | V2D_LIMITZOOM))) {
 			/* if zoom doesn't have to be maintained, just clamp edges */
 			if (cur->xmin < tot->xmin) cur->xmin = tot->xmin;
 			if (cur->xmax > tot->xmax) cur->xmax = tot->xmax;
@@ -627,7 +627,7 @@
 		}
 		
 		/* height */
-		if ( (curheight > totheight) && !(v2d->keepzoom & (V2D_KEEPZOOM | V2D_LOCKZOOM_Y | V2D_LIMITZOOM)) ) {
+		if ((curheight > totheight) && !(v2d->keepzoom & (V2D_KEEPZOOM | V2D_LOCKZOOM_Y | V2D_LIMITZOOM))) {
 			/* if zoom doesn't have to be maintained, just clamp edges */
 			if (cur->ymin < tot->ymin) cur->ymin = tot->ymin;
 			if (cur->ymax > tot->ymax) cur->ymax = tot->ymax;
@@ -1874,7 +1874,7 @@
 	const int y = (int)(floorf(fabsf(viewy) + 0.5f) - starty);
 	
 	/* sizes must not be negative */
-	if ( (v2d == NULL) || ((columnwidth <= 0) && (rowheight <= 0)) ) {
+	if ((v2d == NULL) || ((columnwidth <= 0) && (rowheight <= 0))) {
 		if (column) *column = 0;
 		if (row) *row = 0;
 		

Modified: trunk/blender/source/blender/editors/interface/view2d_ops.c
===================================================================
--- trunk/blender/source/blender/editors/interface/view2d_ops.c	2012-09-08 23:26:15 UTC (rev 50481)
+++ trunk/blender/source/blender/editors/interface/view2d_ops.c	2012-09-09 00:00:21 UTC (rev 50482)
@@ -1719,8 +1719,8 @@
 		 * NOTE: see view2d.c for latest conditions, and keep this in sync with that
 		 */
 		if (ELEM(vsm->zone, SCROLLHANDLE_MIN, SCROLLHANDLE_MAX)) {
-			if ( ((vsm->scroller == 'h') && (v2d->scroll & V2D_SCROLL_SCALE_HORIZONTAL) == 0) ||
-			     ((vsm->scroller == 'v') && (v2d->scroll & V2D_SCROLL_SCALE_VERTICAL) == 0) )
+			if (((vsm->scroller == 'h') && (v2d->scroll & V2D_SCROLL_SCALE_HORIZONTAL) == 0) ||
+			    ((vsm->scroller == 'v') && (v2d->scroll & V2D_SCROLL_SCALE_VERTICAL) == 0))
 			{
 				/* switch to bar (i.e. no scaling gets handled) */
 				vsm->zone = SCROLLHANDLE_BAR;
@@ -1729,8 +1729,8 @@
 		
 		/* check if zone is inappropriate (i.e. 'bar' but panning is banned), so cannot continue */
 		if (vsm->zone == SCROLLHANDLE_BAR) {
-			if ( ((vsm->scroller == 'h') && (v2d->keepofs & V2D_LOCKOFS_X)) ||
-			     ((vsm->scroller == 'v') && (v2d->keepofs & V2D_LOCKOFS_Y)) )

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list