diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-12 02:12:32 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-12 02:12:32 +0400 |
commit | b96c6220157807cbfa3568031d5ab688280fe1d6 (patch) | |
tree | b357c12ac0d629577a7711769dcec4f410293ee4 /intern | |
parent | c567cf3fab5b962a4166ef44f45c80941021b60d (diff) |
style cleanup
Diffstat (limited to 'intern')
-rw-r--r-- | intern/container/CTR_HashedPtr.h | 2 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_C-api.cpp | 3 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.mm | 8 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCocoa.mm | 20 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowX11.cpp | 4 | ||||
-rw-r--r-- | intern/guardedalloc/test/simpletest/memtest.c | 4 | ||||
-rw-r--r-- | intern/string/STR_String.h | 16 |
7 files changed, 30 insertions, 27 deletions
diff --git a/intern/container/CTR_HashedPtr.h b/intern/container/CTR_HashedPtr.h index caf63f75606..11dc37b3625 100644 --- a/intern/container/CTR_HashedPtr.h +++ b/intern/container/CTR_HashedPtr.h @@ -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 diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp index 4cdd9384eee..bb6c90cd431 100644 --- a/intern/ghost/intern/GHOST_C-api.cpp +++ b/intern/ghost/intern/GHOST_C-api.cpp @@ -860,7 +860,8 @@ int GHOST_toggleConsole(int action) } -int GHOST_confirmQuit(GHOST_WindowHandle windowhandle){ +int GHOST_confirmQuit(GHOST_WindowHandle windowhandle) +{ GHOST_ISystem *system = GHOST_ISystem::getSystem(); return system->confirmQuit((GHOST_IWindow *) windowhandle); } diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index 9f08f4cff80..1bffbc8eb85 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -1662,17 +1662,19 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr) 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++) { diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index ac6cc548f32..31f91802e38 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -502,7 +502,7 @@ GHOST_WindowCocoa::GHOST_WindowCocoa( if (stereoVisual) pixelFormatAttrsWindow[i++] = NSOpenGLPFAStereo; - if (numOfAASamples>0) { + if (numOfAASamples > 0) { // Multisample anti-aliasing pixelFormatAttrsWindow[i++] = NSOpenGLPFAMultisample; @@ -550,7 +550,7 @@ GHOST_WindowCocoa::GHOST_WindowCocoa( } - 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 @@ void GHOST_WindowCocoa::setTitle(const STR_String& title) 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 @@ GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorShape(GHOST_TStandardCursor sha /** 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 @@ static GHOST_TUns8 uns8ReverseBits(GHOST_TUns8 ch) /** 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; } diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp index 3dc10d17169..17efecb4a82 100644 --- a/intern/ghost/intern/GHOST_WindowX11.cpp +++ b/intern/ghost/intern/GHOST_WindowX11.cpp @@ -1314,8 +1314,8 @@ validate() */ 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*/ diff --git a/intern/guardedalloc/test/simpletest/memtest.c b/intern/guardedalloc/test/simpletest/memtest.c index fdc91730d6f..7c6a0a2d546 100644 --- a/intern/guardedalloc/test/simpletest/memtest.c +++ b/intern/guardedalloc/test/simpletest/memtest.c @@ -80,7 +80,7 @@ int main (int argc, char *argv[]) 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 @@ int main (int argc, char *argv[]) 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)); } diff --git a/intern/string/STR_String.h b/intern/string/STR_String.h index 1705d7855e0..98de5be9647 100644 --- a/intern/string/STR_String.h +++ b/intern/string/STR_String.h @@ -102,7 +102,7 @@ public: // 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 @@ public: // 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 @@ public: 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); |