[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53020] trunk/blender/source: style cleanup: stop the style checker script from complaining about '!*ptr '

Campbell Barton ideasman42 at gmail.com
Sat Dec 15 03:48:30 CET 2012


Revision: 53020
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53020
Author:   campbellbarton
Date:     2012-12-15 02:48:25 +0000 (Sat, 15 Dec 2012)
Log Message:
-----------
style cleanup: stop the style checker script from complaining about '!*ptr'

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/intern/BLI_kdopbvh.c
    trunk/blender/source/blender/blenlib/intern/math_matrix.c
    trunk/blender/source/blender/editors/interface/interface_regions.c
    trunk/blender/source/tools/check_style_c.py

Modified: trunk/blender/source/blender/blenlib/intern/BLI_kdopbvh.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_kdopbvh.c	2012-12-15 01:01:35 UTC (rev 53019)
+++ trunk/blender/source/blender/blenlib/intern/BLI_kdopbvh.c	2012-12-15 02:48:25 UTC (rev 53020)
@@ -1237,7 +1237,7 @@
 
 #define DEFAULT_FIND_NEAREST_HEAP_SIZE 1024
 
-#define NodeDistance_priority(a, b) ( (a).dist < (b).dist)
+#define NodeDistance_priority(a, b) ((a).dist < (b).dist)
 
 static void NodeDistance_push_heap(NodeDistance *heap, int heap_size)
 PUSH_HEAP_BODY(NodeDistance, NodeDistance_priority, heap, heap_size)

Modified: trunk/blender/source/blender/blenlib/intern/math_matrix.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_matrix.c	2012-12-15 01:01:35 UTC (rev 53019)
+++ trunk/blender/source/blender/blenlib/intern/math_matrix.c	2012-12-15 02:48:25 UTC (rev 53020)
@@ -1906,7 +1906,7 @@
 void pseudoinverse_m3_m3(float Ainv[3][3], float A[3][3], float epsilon)
 {
 	/* try regular inverse when possible, otherwise fall back to slow svd */
-	if(!invert_m3_m3(Ainv, A)) {
+	if (!invert_m3_m3(Ainv, A)) {
 		float tmp[4][4], tmpinv[4][4];
 
 		copy_m4_m3(tmp, A);

Modified: trunk/blender/source/blender/editors/interface/interface_regions.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_regions.c	2012-12-15 01:01:35 UTC (rev 53019)
+++ trunk/blender/source/blender/editors/interface/interface_regions.c	2012-12-15 02:48:25 UTC (rev 53020)
@@ -425,7 +425,7 @@
 /*	IDProperty *prop;*/
 	char buf[512];
 	float fonth, fontw, aspect = but->block->aspect;
-	int winx, winy, ofsx, ofsy, w, h, a;
+	int winx /*, winy */, ofsx, ofsy, w, h, a;
 	rctf rect_fl;
 	rcti rect_i;
 
@@ -675,7 +675,7 @@
 	}
 
 	winx = WM_window_pixels_x(win);
-	winy = WM_window_pixels_y(win);
+	// winy = WM_window_pixels_y(win);  /* UNUSED */
 	//wm_window_get_size(win, &winx, &winy);
 
 	if (rect_i.xmax > winx) {
@@ -1109,7 +1109,7 @@
 	float aspect = but->block->aspect;
 	rctf rect_fl;
 	rcti rect_i;
-	int winx, winy, ofsx, ofsy;
+	int winx /*, winy */, ofsx, ofsy;
 	int i;
 	
 	/* create area region */
@@ -1191,7 +1191,7 @@
 		BLI_rcti_translate(&rect_i, butregion->winrct.xmin, butregion->winrct.ymin);
 
 		winx = WM_window_pixels_x(win);
-		winy = WM_window_pixels_y(win);
+		// winy = WM_window_pixels_y(win);  /* UNUSED */
 		//wm_window_get_size(win, &winx, &winy);
 		
 		if (rect_i.xmax > winx) {

Modified: trunk/blender/source/tools/check_style_c.py
===================================================================
--- trunk/blender/source/tools/check_style_c.py	2012-12-15 01:01:35 UTC (rev 53019)
+++ trunk/blender/source/tools/check_style_c.py	2012-12-15 02:48:25 UTC (rev 53020)
@@ -322,7 +322,7 @@
                        "<<", ">>",
                        "%=",
                        # not operators, pointer mix-ins
-                       ">*", "<*", "-*", "+*", "=*", "/*", "%*", "^*", "!*", "|*",
+                       ">*", "<*", "-*", "+*", "=*", "/*", "%*", "^*", "|*",
                        }:
             if not _is_ws_pad(index_start, index_end):
                 if not (is_cpp and ("<" in op_text or ">" in op_text)):
@@ -335,7 +335,9 @@
                     tokens[index_end   + 1].text.isspace()):
                 warning("spaces surrounding operator '%s'" % op_text, index_start, index_end)
             '''
-        elif op_text == "!!":
+        elif op_text in {"!!", "!*"}:
+            # operators we _dont_ want whitespace after (pointers mainly)
+            # we can assume these are pointers
             if tokens[index_end + 1].text.isspace():
                 warning("spaces after operator '%s'" % op_text, index_start, index_end)
 




More information about the Bf-blender-cvs mailing list