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

Campbell Barton ideasman42 at gmail.com
Sun Aug 12 00:12:33 CEST 2012


Revision: 49824
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49824
Author:   campbellbarton
Date:     2012-08-11 22:12:32 +0000 (Sat, 11 Aug 2012)
Log Message:
-----------
style cleanup

Modified Paths:
--------------
    trunk/blender/intern/container/CTR_HashedPtr.h
    trunk/blender/intern/ghost/intern/GHOST_C-api.cpp
    trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm
    trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm
    trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp
    trunk/blender/intern/guardedalloc/test/simpletest/memtest.c
    trunk/blender/intern/string/STR_String.h
    trunk/blender/source/blender/blenkernel/intern/key.c
    trunk/blender/source/blender/blenkernel/intern/sca.c
    trunk/blender/source/blender/blenkernel/intern/tracking.c
    trunk/blender/source/blender/blenkernel/intern/unit.c
    trunk/blender/source/blender/blenlib/BLI_array.h
    trunk/blender/source/blender/blenlib/BLI_kdopbvh.h
    trunk/blender/source/blender/blenlib/intern/math_geom.c
    trunk/blender/source/blender/blenlib/intern/scanfill.c
    trunk/blender/source/blender/blenlib/intern/string_utf8.c
    trunk/blender/source/blender/bmesh/operators/bmo_create.c
    trunk/blender/source/blender/collada/ArmatureExporter.cpp
    trunk/blender/source/blender/collada/MeshImporter.cpp
    trunk/blender/source/blender/compositor/intern/COM_WorkScheduler.cpp
    trunk/blender/source/blender/compositor/operations/COM_BokehBlurOperation.cpp
    trunk/blender/source/blender/editors/include/ED_object.h
    trunk/blender/source/blender/editors/interface/interface_handlers.c
    trunk/blender/source/blender/editors/physics/physics_fluid.c
    trunk/blender/source/blender/editors/space_image/image_ops.c
    trunk/blender/source/blender/editors/space_node/node_select.c
    trunk/blender/source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_frag.glsl
    trunk/blender/source/blender/makesdna/DNA_action_types.h
    trunk/blender/source/blender/makesdna/DNA_constraint_types.h
    trunk/blender/source/blender/python/bmesh/bmesh_py_ops.c
    trunk/blender/source/blender/windowmanager/WM_api.h
    trunk/blender/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
    trunk/blender/source/gameengine/Expressions/PyObjectPlus.h
    trunk/blender/source/gameengine/Expressions/StringValue.h
    trunk/blender/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
    trunk/blender/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
    trunk/blender/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
    trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp

Modified: trunk/blender/intern/container/CTR_HashedPtr.h
===================================================================
--- trunk/blender/intern/container/CTR_HashedPtr.h	2012-08-11 21:35:24 UTC (rev 49823)
+++ trunk/blender/intern/container/CTR_HashedPtr.h	2012-08-11 22:12:32 UTC (rev 49824)
@@ -38,7 +38,7 @@
 inline unsigned int CTR_Hash(void *inDWord)
 {
 	size_t key = (size_t)inDWord;
-	return (unsigned int)(key ^ (key>>4));
+	return (unsigned int)(key ^ (key >> 4));
 }
 
 class CTR_HashedPtr

Modified: trunk/blender/intern/ghost/intern/GHOST_C-api.cpp
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_C-api.cpp	2012-08-11 21:35:24 UTC (rev 49823)
+++ trunk/blender/intern/ghost/intern/GHOST_C-api.cpp	2012-08-11 22:12:32 UTC (rev 49824)
@@ -860,7 +860,8 @@
 }
 
 
-int GHOST_confirmQuit(GHOST_WindowHandle windowhandle){
+int GHOST_confirmQuit(GHOST_WindowHandle windowhandle)
+{
 	GHOST_ISystem *system = GHOST_ISystem::getSystem();
 	return system->confirmQuit((GHOST_IWindow *) windowhandle);
 }

Modified: trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm	2012-08-11 21:35:24 UTC (rev 49823)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm	2012-08-11 22:12:32 UTC (rev 49824)
@@ -1662,17 +1662,19 @@
 		case NSKeyDown:
 		case NSKeyUp:
 			charsIgnoringModifiers = [event charactersIgnoringModifiers];
-			if ([charsIgnoringModifiers length]>0)
+			if ([charsIgnoringModifiers length] > 0) {
 				keyCode = convertKey([event keyCode],
 									 [charsIgnoringModifiers characterAtIndex:0],
 									 [event type] == NSKeyDown?kUCKeyActionDown:kUCKeyActionUp);
-			else
+			}
+			else {
 				keyCode = convertKey([event keyCode],0,
 									 [event type] == NSKeyDown?kUCKeyActionDown:kUCKeyActionUp);
+			}
 
 			/* handling both unicode or ascii */
 			characters = [event characters];
-			if ([characters length]>0) {
+			if ([characters length] > 0) {
 				convertedCharacters = [characters dataUsingEncoding:NSUTF8StringEncoding];
 				
 				for (int x = 0; x < [convertedCharacters length]; x++) {

Modified: trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm	2012-08-11 21:35:24 UTC (rev 49823)
+++ trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm	2012-08-11 22:12:32 UTC (rev 49824)
@@ -502,7 +502,7 @@
 	
 	if (stereoVisual) pixelFormatAttrsWindow[i++] = NSOpenGLPFAStereo;
 	
-	if (numOfAASamples>0) {
+	if (numOfAASamples > 0) {
 		// Multisample anti-aliasing
 		pixelFormatAttrsWindow[i++] = NSOpenGLPFAMultisample;
 		
@@ -550,7 +550,7 @@
 		
 	}
 	
-	if (numOfAASamples>0) { //Set m_numOfAASamples to the actual value
+	if (numOfAASamples > 0) { //Set m_numOfAASamples to the actual value
 		GLint gli;
 		[pixelFormat getValues:&gli forAttribute:NSOpenGLPFASamples forVirtualScreen:0];
 		if (m_numOfAASamples != (GHOST_TUns16)gli) {
@@ -653,7 +653,7 @@
 		fileStrRange.location = [windowTitle rangeOfString:@"["].location+1;
 		len = [windowTitle rangeOfString:@"]"].location - fileStrRange.location;
 	
-		if (len >0)
+		if (len > 0)
 		{
 			fileStrRange.length = len;
 			associatedFileName = [windowTitle substringWithRange:fileStrRange];
@@ -1424,9 +1424,9 @@
 /** Reverse the bits in a GHOST_TUns8
 static GHOST_TUns8 uns8ReverseBits(GHOST_TUns8 ch)
 {
-	ch= ((ch>>1)&0x55) | ((ch<<1)&0xAA);
-	ch= ((ch>>2)&0x33) | ((ch<<2)&0xCC);
-	ch= ((ch>>4)&0x0F) | ((ch<<4)&0xF0);
+	ch= ((ch >> 1) & 0x55) | ((ch << 1) & 0xAA);
+	ch= ((ch >> 2) & 0x33) | ((ch << 2) & 0xCC);
+	ch= ((ch >> 4) & 0x0F) | ((ch << 4) & 0xF0);
 	return ch;
 }
 */
@@ -1435,10 +1435,10 @@
 /** Reverse the bits in a GHOST_TUns16 */
 static GHOST_TUns16 uns16ReverseBits(GHOST_TUns16 shrt)
 {
-	shrt= ((shrt>>1)&0x5555) | ((shrt<<1)&0xAAAA);
-	shrt= ((shrt>>2)&0x3333) | ((shrt<<2)&0xCCCC);
-	shrt= ((shrt>>4)&0x0F0F) | ((shrt<<4)&0xF0F0);
-	shrt= ((shrt>>8)&0x00FF) | ((shrt<<8)&0xFF00);
+	shrt = ((shrt >> 1) & 0x5555) | ((shrt << 1) & 0xAAAA);
+	shrt = ((shrt >> 2) & 0x3333) | ((shrt << 2) & 0xCCCC);
+	shrt = ((shrt >> 4) & 0x0F0F) | ((shrt << 4) & 0xF0F0);
+	shrt = ((shrt >> 8) & 0x00FF) | ((shrt << 8) & 0xFF00);
 	return shrt;
 }
 

Modified: trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp	2012-08-11 21:35:24 UTC (rev 49823)
+++ trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp	2012-08-11 22:12:32 UTC (rev 49824)
@@ -1314,8 +1314,8 @@
  */
 
 GHOST_WindowX11::
-~GHOST_WindowX11(
-    ){
+~GHOST_WindowX11()
+{
 	static Atom Primary_atom, Clipboard_atom;
 	Window p_owner, c_owner;
 	/*Change the owner of the Atoms to None if we are the owner*/

Modified: trunk/blender/intern/guardedalloc/test/simpletest/memtest.c
===================================================================
--- trunk/blender/intern/guardedalloc/test/simpletest/memtest.c	2012-08-11 21:35:24 UTC (rev 49823)
+++ trunk/blender/intern/guardedalloc/test/simpletest/memtest.c	2012-08-11 22:12:32 UTC (rev 49824)
@@ -80,7 +80,7 @@
 	for (i = 0; i < NUM_BLOCKS; i++) {
 		int blocksize = 10000;
 		char tagstring[1000];
-		if (verbose >1) printf("|--* Allocating block %d\n", i);
+		if (verbose > 1) printf("|--* Allocating block %d\n", i);
 		sprintf(tagstring,"Memblock no. %d : ", i);
 		p[i]= MEM_callocN(blocksize, strdup(tagstring));
 	}
@@ -112,7 +112,7 @@
 	for (i = 0; i < NUM_BLOCKS; i++) {
 		int blocksize = 10000;
 		char tagstring[1000];
-		if (verbose >1) printf("|--* Allocating block %d\n", i);
+		if (verbose > 1) printf("|--* Allocating block %d\n", i);
 		sprintf(tagstring,"Memblock no. %d : ", i);
 		p[i]= MEM_callocN(blocksize, strdup(tagstring));
 	}

Modified: trunk/blender/intern/string/STR_String.h
===================================================================
--- trunk/blender/intern/string/STR_String.h	2012-08-11 21:35:24 UTC (rev 49823)
+++ trunk/blender/intern/string/STR_String.h	2012-08-11 22:12:32 UTC (rev 49824)
@@ -102,7 +102,7 @@
 	// Properties
 	bool				IsUpper() const;
 	bool				IsLower() const;
-	inline bool			IsEmpty() const								{ return Len==0; }
+	inline bool			IsEmpty() const								{ return Len == 0; }
 	inline int			Length() const								{ return Len; }
 
 	// Data access
@@ -122,8 +122,8 @@
 	// Comparison
 	int					Compare(rcSTR_String rhs) const;
 	int					CompareNoCase(rcSTR_String rhs) const;
-	inline bool			IsEqual(rcSTR_String rhs) const					{ return (Compare(rhs)==0); }
-	inline bool			IsEqualNoCase(rcSTR_String rhs) const			{ return (CompareNoCase(rhs)==0); }
+	inline bool			IsEqual(rcSTR_String rhs) const					{ return (Compare(rhs) == 0); }
+	inline bool			IsEqualNoCase(rcSTR_String rhs) const			{ return (CompareNoCase(rhs) == 0); }
 
 	// Search/replace
 	int					Find(char c, int pos = 0) const;
@@ -178,12 +178,12 @@
 	inline friend bool operator>=(rcSTR_String     lhs, rcSTR_String     rhs)	{ return (strcmp(lhs, rhs)>=0); }
 	inline friend bool operator>=(rcSTR_String     lhs, const char      *rhs)	{ return (strcmp(lhs, rhs)>=0); }
 	inline friend bool operator>=(const char      *lhs, rcSTR_String     rhs)	{ return (strcmp(lhs, rhs)>=0); }
-	inline friend bool operator==(rcSTR_String     lhs, rcSTR_String     rhs)	{ return ((lhs.Length() == rhs.Length()) && (memcmp(lhs, rhs, lhs.Length())==0)); }
-	inline friend bool operator==(rcSTR_String     lhs, const char      *rhs)	{ return (memcmp(lhs, rhs, lhs.Length()+1)==0); }
-	inline friend bool operator==(const char      *lhs, rcSTR_String     rhs)	{ return (memcmp(lhs, rhs, rhs.Length()+1)==0); }
+	inline friend bool operator==(rcSTR_String     lhs, rcSTR_String     rhs)	{ return ((lhs.Length() == rhs.Length()) && (memcmp(lhs, rhs, lhs.Length()) == 0)); }
+	inline friend bool operator==(rcSTR_String     lhs, const char      *rhs)	{ return (memcmp(lhs, rhs, lhs.Length() + 1) == 0); }
+	inline friend bool operator==(const char      *lhs, rcSTR_String     rhs)	{ return (memcmp(lhs, rhs, rhs.Length() + 1) == 0); }
 	inline friend bool operator!=(rcSTR_String     lhs, rcSTR_String     rhs)	{ return ((lhs.Length() != rhs.Length()) || (memcmp(lhs, rhs, lhs.Length())!=0)); }
-	inline friend bool operator!=(rcSTR_String     lhs, const char      *rhs)	{ return (memcmp(lhs, rhs, lhs.Length()+1)!=0); }
-	inline friend bool operator!=(const char       *lhs, rcSTR_String    rhs)	{ return (memcmp(lhs, rhs, rhs.Length()+1)!=0); }
+	inline friend bool operator!=(rcSTR_String     lhs, const char      *rhs)	{ return (memcmp(lhs, rhs, lhs.Length() + 1) != 0); }
+	inline friend bool operator!=(const char       *lhs, rcSTR_String    rhs)	{ return (memcmp(lhs, rhs, rhs.Length() + 1) != 0); }
 
 	// serializing
 	//int			Serialize(pCStream stream);

Modified: trunk/blender/source/blender/blenkernel/intern/key.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/key.c	2012-08-11 21:35:24 UTC (rev 49823)
+++ trunk/blender/source/blender/blenkernel/intern/key.c	2012-08-11 22:12:32 UTC (rev 49824)
@@ -377,7 +377,7 @@
 	k1 = k[0] = k[1] = k[2] = k[3] = firstkey;
 	t[0] = t[1] = t[2] = t[3] = k1->pos;
 
-	/* if (fac<0.0 || fac>1.0) return 1; */
+	/* if (fac < 0.0 || fac > 1.0) return 1; */
 
 	if (k1->next == NULL) return 1;
 

Modified: trunk/blender/source/blender/blenkernel/intern/sca.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/sca.c	2012-08-11 21:35:24 UTC (rev 49823)
+++ trunk/blender/source/blender/blenkernel/intern/sca.c	2012-08-11 22:12:32 UTC (rev 49824)
@@ -717,7 +717,7 @@
 	if (!sens) return;
 
 	/* move up */
-	if ( val==1 && sens->prev) {
+	if (val == 1 && sens->prev) {
 		for (tmp=sens->prev; tmp; tmp=tmp->prev) {
 			if (tmp->flag & SENS_VISIBLE)
 				break;
@@ -728,7 +728,7 @@
 		}
 	}
 	/* move down */
-	else if ( val==2 && sens->next) {
+	else if (val == 2 && sens->next) {
 		for (tmp=sens->next; tmp; tmp=tmp->next) {
 			if (tmp->flag & SENS_VISIBLE)
 				break;
@@ -756,7 +756,7 @@
 	if (!cont) return;
 
 	/* move up */
-	if ( val==1 && cont->prev) {
+	if (val == 1 && cont->prev) {
 		/* locate the controller that has the same state mask but is earlier in the list */

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list