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

Campbell Barton ideasman42 at gmail.com
Sat Jul 21 18:21:45 CEST 2012


Revision: 49106
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49106
Author:   campbellbarton
Date:     2012-07-21 16:21:42 +0000 (Sat, 21 Jul 2012)
Log Message:
-----------
style cleanup

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/intern/math_rotation.c
    trunk/blender/source/blender/editors/interface/interface.c
    trunk/blender/source/blender/editors/interface/interface_icons.c
    trunk/blender/source/blender/editors/interface/resources.c
    trunk/blender/source/blender/editors/interface/view2d_ops.c

Modified: trunk/blender/source/blender/blenlib/intern/math_rotation.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_rotation.c	2012-07-21 15:40:47 UTC (rev 49105)
+++ trunk/blender/source/blender/blenlib/intern/math_rotation.c	2012-07-21 16:21:42 UTC (rev 49106)
@@ -1164,8 +1164,8 @@
 	compatible_eul(eul1, oldrot);
 	compatible_eul(eul2, oldrot);
 
-	d1 = (float)fabsf(eul1[0] - oldrot[0]) + (float)fabsf(eul1[1] - oldrot[1]) + (float)fabsf(eul1[2] - oldrot[2]);
-	d2 = (float)fabsf(eul2[0] - oldrot[0]) + (float)fabsf(eul2[1] - oldrot[1]) + (float)fabsf(eul2[2] - oldrot[2]);
+	d1 = fabsf(eul1[0] - oldrot[0]) + fabsf(eul1[1] - oldrot[1]) + fabsf(eul1[2] - oldrot[2]);
+	d2 = fabsf(eul2[0] - oldrot[0]) + fabsf(eul2[1] - oldrot[1]) + fabsf(eul2[2] - oldrot[2]);
 
 	/* return best, which is just the one with lowest difference */
 	if (d1 > d2) {

Modified: trunk/blender/source/blender/editors/interface/interface.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface.c	2012-07-21 15:40:47 UTC (rev 49105)
+++ trunk/blender/source/blender/editors/interface/interface.c	2012-07-21 16:21:42 UTC (rev 49106)
@@ -2243,8 +2243,12 @@
 			UI_GET_BUT_VALUE_INIT(but, value);
 
 			if (ui_is_but_float(but)) {
-				if (value == (double) FLT_MAX) BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%sinf", but->str);
-				else if (value == (double) -FLT_MAX) BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s-inf", but->str);
+				if (value == (double) FLT_MAX) {
+					BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%sinf", but->str);
+				}
+				else if (value == (double) -FLT_MAX) {
+					BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s-inf", but->str);
+				}
 				/* support length type buttons */
 				else if (ui_is_but_unit(but)) {
 					char new_str[sizeof(but->drawstr)];
@@ -2550,7 +2554,9 @@
  * - \a a2 Number of decimal point values to display. 0 defaults to 3 (0.000)
  *      1,2,3, and a maximum of 4, all greater values will be clamped to 4.
  */
-static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip)
+static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
+                         int x1, int y1, short x2, short y2,
+                         void *poin, float min, float max, float a1, float a2, const char *tip)
 {
 	uiBut *but;
 	int slen;
@@ -2622,10 +2628,14 @@
 		}
 	}
 
-	if ((block->flag & UI_BLOCK_LOOP) || ELEM8(but->type, MENU, TEX, LABEL, IDPOIN, BLOCK, BUTM, SEARCH_MENU, PROGRESSBAR))
+	if ((block->flag & UI_BLOCK_LOOP) ||
+	    ELEM8(but->type, MENU, TEX, LABEL, IDPOIN, BLOCK, BUTM, SEARCH_MENU, PROGRESSBAR))
+	{
 		but->flag |= (UI_TEXT_LEFT | UI_ICON_LEFT);
-	else if (but->type == BUT_TOGDUAL)
+	}
+	else if (but->type == BUT_TOGDUAL) {
 		but->flag |= UI_ICON_LEFT;
+	}
 
 	but->flag |= (block->flag & UI_BUT_ALIGN);
 
@@ -2670,7 +2680,10 @@
 	but->lockstr = ""
 
 
-static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, float a1, float a2,  const char *tip)
+static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *str,
+                             int x1, int y1, short x2, short y2,
+                             PointerRNA *ptr, PropertyRNA *prop, int index,
+                             float min, float max, float a1, float a2,  const char *tip)
 {
 	const PropertyType proptype = RNA_property_type(prop);
 	uiBut *but;

Modified: trunk/blender/source/blender/editors/interface/interface_icons.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_icons.c	2012-07-21 15:40:47 UTC (rev 49105)
+++ trunk/blender/source/blender/editors/interface/interface_icons.c	2012-07-21 16:21:42 UTC (rev 49106)
@@ -861,7 +861,8 @@
 	                    prv_img->w[size], prv_img->h[size]);
 }
 
-static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), int rw, int rh, unsigned int *rect, float alpha, const float rgb[3], short is_preview)
+static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), int rw, int rh,
+                           unsigned int *rect, float alpha, const float rgb[3], short is_preview)
 {
 	ImBuf *ima = NULL;
 
@@ -914,7 +915,8 @@
 	}
 }
 
-static void icon_draw_texture(float x, float y, float w, float h, int ix, int iy, int UNUSED(iw), int ih, float alpha, const float rgb[3])
+static void icon_draw_texture(float x, float y, float w, float h, int ix, int iy,
+                              int UNUSED(iw), int ih, float alpha, const float rgb[3])
 {
 	float x1, x2, y1, y2;
 
@@ -957,7 +959,8 @@
 	return 0;
 }
 
-static void icon_draw_size(float x, float y, int icon_id, float aspect, float alpha, const float rgb[3], enum eIconSizes size, int draw_size, int UNUSED(nocreate), short is_preview)
+static void icon_draw_size(float x, float y, int icon_id, float aspect, float alpha, const float rgb[3],
+                           enum eIconSizes size, int draw_size, int UNUSED(nocreate), short is_preview)
 {
 	bTheme *btheme = UI_GetTheme();
 	Icon *icon = NULL;

Modified: trunk/blender/source/blender/editors/interface/resources.c
===================================================================
--- trunk/blender/source/blender/editors/interface/resources.c	2012-07-21 15:40:47 UTC (rev 49105)
+++ trunk/blender/source/blender/editors/interface/resources.c	2012-07-21 16:21:42 UTC (rev 49106)
@@ -1213,7 +1213,8 @@
 }
 
 // get a 3 byte color, blended and shaded between two other char color pointers
-void UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3], float fac, int offset)
+void UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3],
+                                  float fac, int offset)
 {
 	int r, g, b;
 
@@ -1740,7 +1741,8 @@
 	}
 
 	if (bmain->versionfile < 257) {
-		/* clear "AUTOKEY_FLAG_ONLYKEYINGSET" flag from userprefs, so that it doesn't linger around from old configs like a ghost */
+		/* clear "AUTOKEY_FLAG_ONLYKEYINGSET" flag from userprefs,
+		 * so that it doesn't linger around from old configs like a ghost */
 		U.autokey_flag &= ~AUTOKEY_FLAG_ONLYKEYINGSET;
 	}
 

Modified: trunk/blender/source/blender/editors/interface/view2d_ops.c
===================================================================
--- trunk/blender/source/blender/editors/interface/view2d_ops.c	2012-07-21 15:40:47 UTC (rev 49105)
+++ trunk/blender/source/blender/editors/interface/view2d_ops.c	2012-07-21 16:21:42 UTC (rev 49106)
@@ -499,15 +499,15 @@
 /* ********************************************************* */
 /* SINGLE-STEP VIEW ZOOMING OPERATOR						 */
 
-/*  This group of operators come in several forms:
- *		1) Scrollwheel 'steps' - rolling mousewheel by one step zooms view by predefined amount
- *		2) Scrollwheel 'steps' + alt + ctrl/shift - zooms view on one axis only (ctrl=x, shift=y)  // XXX this could be implemented...
- *		3) Pad +/- Keys - pressing each key moves the zooms the view by a predefined amount
+/* This group of operators come in several forms:
+ * 1) Scrollwheel 'steps' - rolling mousewheel by one step zooms view by predefined amount
+ * 2) Scrollwheel 'steps' + alt + ctrl/shift - zooms view on one axis only (ctrl=x, shift=y)  // XXX this could be implemented...
+ * 3) Pad +/- Keys - pressing each key moves the zooms the view by a predefined amount
  *
- *	In order to make sure this works, each operator must define the following RNA-Operator Props:
- *		zoomfacx, zoomfacy	- These two zoom factors allow for non-uniform scaling.
- *							  It is safe to scale by 0, as these factors are used to determine
- *							  amount to enlarge 'cur' by
+ * In order to make sure this works, each operator must define the following RNA-Operator Props:
+ * zoomfacx, zoomfacy - These two zoom factors allow for non-uniform scaling.
+ *                      It is safe to scale by 0, as these factors are used to determine
+ *                      amount to enlarge 'cur' by
  */
 
 /* ------------------ 'Shared' stuff ------------------------ */




More information about the Bf-blender-cvs mailing list