style cleanup: whitespace & odd indentation
authorCampbell Barton <ideasman42@gmail.com>
Sat, 21 Sep 2013 10:46:58 +0000 (10:46 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 21 Sep 2013 10:46:58 +0000 (10:46 +0000)
13 files changed:
intern/ghost/intern/GHOST_DisplayManagerCocoa.mm
intern/ghost/intern/GHOST_SystemCocoa.mm
intern/ghost/intern/GHOST_SystemWin32.cpp
intern/ghost/intern/GHOST_WindowWin32.cpp
intern/locale/boost_locale_wrapper.cpp
source/blender/blenloader/intern/writefile.c
source/blender/collada/DocumentImporter.cpp
source/blender/collada/MeshImporter.cpp
source/blender/freestyle/intern/stroke/StrokeRep.cpp
source/blender/quicktime/apple/qtkit_export.m
source/blender/quicktime/apple/qtkit_import.m
source/blender/render/intern/include/texture.h
source/blender/render/intern/source/rayshade.c

index 555f883cbf2083db16593c9aa2f5deb88e5157b4..88f338c0649b3e7de7266cddc75052d7e703d530 100644 (file)
@@ -74,7 +74,7 @@ GHOST_TSuccess GHOST_DisplayManagerCocoa::getDisplaySetting(GHOST_TUns8 display,
        else
                askedDisplay = [[NSScreen screens] objectAtIndex:display];
        
-       if(askedDisplay == nil) {
+       if (askedDisplay == nil) {
                [pool drain];
                return GHOST_kFailure;
        }
@@ -109,7 +109,7 @@ GHOST_TSuccess GHOST_DisplayManagerCocoa::getCurrentDisplaySetting(GHOST_TUns8 d
        else
                askedDisplay = [[NSScreen screens] objectAtIndex:display];
        
-       if(askedDisplay == nil) {
+       if (askedDisplay == nil) {
                [pool drain];
                return GHOST_kFailure;
        }
index 004821a0857a2e4f7f7518b1fdc5b558a542ea93..37b698c8d3d0c7c8300a098081f521d67c8e4252 100644 (file)
@@ -1541,8 +1541,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
                                                
                                                window->clientToScreenIntern(x_warp+x_accum, y_warp+y_accum, x, y);
                                                pushEvent(new GHOST_EventCursor([event timestamp] * 1000, GHOST_kEventCursorMove, window, x, y));
-                                       }
                                                break;
+                                       }
                                        case GHOST_kGrabWrap: //Wrap cursor at area/window boundaries
                                        {
                                                NSPoint mousePos = [cocoawindow mouseLocationOutsideOfEventStream];
@@ -1552,7 +1552,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
                                                GHOST_Rect bounds, windowBounds, correctedBounds;
                                                
                                                /* fallback to window bounds */
-                                               if(window->getCursorGrabBounds(bounds)==GHOST_kFailure)
+                                               if (window->getCursorGrabBounds(bounds) == GHOST_kFailure)
                                                        window->getClientBounds(bounds);
                                                
                                                //Switch back to Cocoa coordinates orientation (y=0 at botton,the same as blender internal btw!), and to client coordinates
@@ -1586,8 +1586,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
                                                window->getCursorGrabInitPos(x_cur, y_cur);
                                                window->clientToScreenIntern(x_cur + x_accum, y_cur + y_accum, x, y);
                                                pushEvent(new GHOST_EventCursor([event timestamp] * 1000, GHOST_kEventCursorMove, window, x, y));
-                                       }
                                                break;
+                                       }
                                        default:
                                        {
                                                //Normal cursor operation: send mouse position in window
@@ -1599,8 +1599,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
 
                                                m_cursorDelta_x=0;
                                                m_cursorDelta_y=0; //Mouse motion occurred between two cursor warps, so we can reset the delta counter
-                                       }
                                                break;
+                                       }
                                }
                        }
                        break;
@@ -1854,7 +1854,7 @@ GHOST_TUns8* GHOST_SystemCocoa::getClipboard(bool selection) const
        
        [pool drain];
 
-       if(temp_buff) {
+       if (temp_buff) {
                return temp_buff;
        }
        else {
@@ -1866,7 +1866,7 @@ void GHOST_SystemCocoa::putClipboard(GHOST_TInt8 *buffer, bool selection) const
 {
        NSString *textToCopy;
        
-       if(selection) {return;} // for copying the selection, used on X11
+       if (selection) return;  // for copying the selection, used on X11
 
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
                
index b43758b345f108114f4d9e20f34d2192c99a3e92..ebb419b6c047f217d9b7ed41bbe6ce0eddbfb59f 100644 (file)
@@ -599,17 +599,19 @@ GHOST_TKey GHOST_SystemWin32::convertKey(GHOST_IWindow *window, short vKey, shor
                        case VK_GR_LESS:        key = GHOST_kKeyGrLess;         break;
 
                        case VK_SHIFT:
-                                       /* Check single shift presses */
-                                       if (scanCode == 0x36) {
-                                               key = GHOST_kKeyRightShift;
-                                       } else if (scanCode == 0x2a) {
-                                               key = GHOST_kKeyLeftShift;
-                                       } else {
-                                               /* Must be a combination SHIFT (Left or Right) + a Key 
-                                                * Ignore this as the next message will contain
-                                                * the desired "Key" */
-                                               key = GHOST_kKeyUnknown;
-                                       }
+                               /* Check single shift presses */
+                               if (scanCode == 0x36) {
+                                       key = GHOST_kKeyRightShift;
+                               }
+                               else if (scanCode == 0x2a) {
+                                       key = GHOST_kKeyLeftShift;
+                               }
+                               else {
+                                       /* Must be a combination SHIFT (Left or Right) + a Key
+                                        * Ignore this as the next message will contain
+                                        * the desired "Key" */
+                                       key = GHOST_kKeyUnknown;
+                               }
                                break;
                        case VK_CONTROL:
                                key = (extend) ? GHOST_kKeyRightControl : GHOST_kKeyLeftControl;
@@ -1162,7 +1164,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                         * message without calling DefWindowProc.
                                         */
                                        /* we get first WM_SIZE before we fully init. So, do not dispatch before we continiously resizng */
-                                       if(window->m_inLiveResize) {
+                                       if (window->m_inLiveResize) {
                                                system->pushEvent(processWindowEvent(GHOST_kEventWindowSize, window));
                                                system->dispatchEvents();
                                        }
index 2b311f96647f442ef1d42a4e9706e14d6d52b82c..a409f5c357a55fb7fd8949030b8e90fa79b97b32 100644 (file)
@@ -179,12 +179,12 @@ GHOST_WindowWin32::GHOST_WindowWin32(
                RECT rect, desktop;
                int wintype = WS_OVERLAPPEDWINDOW;
 
-               if (m_parentWindowHwnd != 0)
-               {
+               if (m_parentWindowHwnd != 0) {
                        wintype = WS_CHILD;
                        /* check against parent window if given */
                        GetWindowRect((HWND)m_parentWindowHwnd, &rect);
-               } else {
+               }
+               else {
                        int framex = GetSystemMetrics(SM_CXSIZEFRAME);
                        int framey = GetSystemMetrics(SM_CYSIZEFRAME);
                        int caption = GetSystemMetrics(SM_CYCAPTION);
@@ -203,10 +203,10 @@ GHOST_WindowWin32::GHOST_WindowWin32(
                desktop.bottom = GetSystemMetrics(SM_CYVIRTUALSCREEN);
 
                /* virtual screen (desktop) bound checks */
-               if(rect.left < desktop.left) rect.left = desktop.left;
-               if(rect.top < desktop.top) rect.top = desktop.top;
-               if(rect.bottom > desktop.bottom) rect.bottom = desktop.bottom;
-               if(rect.right > desktop.right) rect.right = desktop.right;
+               if (rect.left < desktop.left) rect.left = desktop.left;
+               if (rect.top < desktop.top) rect.top = desktop.top;
+               if (rect.bottom > desktop.bottom) rect.bottom = desktop.bottom;
+               if (rect.right > desktop.right) rect.right = desktop.right;
 
                /* dimension vars to use in window creation */
                left = rect.left;
index 5d7ba5994676846ef3d7ea2aa1341628d70c4774..945d0bbc5da995d933bd1e8f77ac2e82dfaea087 100644 (file)
@@ -109,7 +109,7 @@ const char *bl_locale_pgettext(const char *msgctxt, const char *msgid)
                std::locale l;
                char_message_facet const &facet = std::use_facet<char_message_facet>(l);
                char const *r = facet.get(0, msgctxt, msgid);
-               if(r)
+               if (r)
                        return r;
                return msgid;
        }
index 21136f0ca6df10e037251195d4fd43127cc72cbd..1e4e57b1dd235f274665ad1c16ff9f298138a840 100644 (file)
@@ -2449,7 +2449,8 @@ static void write_soops(WriteData *wd, SpaceOops *so, LinkNode **tmp_mem_list)
 
                /* restore old treestore */
                so->treestore = ts;
-       } else {
+       }
+       else {
                writestruct(wd, DATA, "SpaceOops", 1, so);
        }
 }
index 5592be6e872c1d784b35df7ae1c5493ccc55d153..79c725166f68df3af3152260b9b840d00eb762e9 100644 (file)
@@ -944,7 +944,7 @@ bool DocumentImporter::writeCamera(const COLLADAFW::Camera *camera)
                return true;
        }
 
-       if(et && et->isProfile("blender")) {
+       if (et && et->isProfile("blender")) {
                et->setData("shiftx",&(cam->shiftx));
                et->setData("shifty",&(cam->shifty));
                et->setData("YF_dofdist",&(cam->YF_dofdist));
index 09d71f22a0d29ae40d2e54228fd09ed630f72309..c7652bd7ae7f1cdd880069f646a9def171fb1e13 100644 (file)
@@ -665,9 +665,10 @@ void MeshImporter::get_vector(float v[3], COLLADAFW::MeshVertexData& arr, int i,
 
                        v[0] = (*values)[i++];
                        v[1] = (*values)[i++];
-                       if(stride>=3) {
+                       if (stride>=3) {
                                v[2] = (*values)[i];
-                       } else {
+                       }
+                       else {
                                v[2] = 0.0f;
                        }
 
@@ -680,9 +681,10 @@ void MeshImporter::get_vector(float v[3], COLLADAFW::MeshVertexData& arr, int i,
 
                        v[0] = (float)(*values)[i++];
                        v[1] = (float)(*values)[i++];
-                       if(stride>=3) {
+                       if (stride >= 3) {
                                v[2] = (float)(*values)[i];
-                       } else {
+                       }
+                       else {
                                v[2] = 0.0f;
                        }
                }
index 2615df0a124c09226d2d5dd7f6b2545b814d7b55..fb6da853e0248bdd90b7c1402c60e033d9213423 100644 (file)
@@ -149,7 +149,8 @@ void Strip::createStrip (const vector<StrokeVertex*>& iStrokeVertices)
                        if (dp < 0)
                                userDir = userDir * (-1.0f);
                        stripDir = userDir;
-               } else {
+               }
+               else {
                        ++orientationErrors;
                }
        }
@@ -207,7 +208,8 @@ void Strip::createStrip (const vector<StrokeVertex*>& iStrokeVertices)
                                if (dp < 0)
                                        userDir = userDir * (-1.0f);
                                stripDir = userDir;
-                       } else {
+                       }
+                       else {
                                ++orientationErrors;
                        }
                }
@@ -226,7 +228,8 @@ void Strip::createStrip (const vector<StrokeVertex*>& iStrokeVertices)
                                if (dp < 0)
                                        userDir = userDir * (-1.0f);
                                stripDirPrev = userDir;
-                       } else {
+                       }
+                       else {
                                ++orientationErrors;
                        }
                }
@@ -302,7 +305,8 @@ void Strip::createStrip (const vector<StrokeVertex*>& iStrokeVertices)
                        if (dp < 0)
                                userDir = userDir * (-1.0f);
                        stripDirLast = userDir;
-               } else {
+               }
+               else {
                        ++orientationErrors;
                }
        }
index 7b42c89d936160c604b8e197c9519b5e6a46e339..8cf91e44c777e7824ec9e09087eeb3d9dd214b24 100644 (file)
@@ -317,7 +317,7 @@ int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, R
        int success = 1;
        OSStatus err = noErr;
 
-       if(qtexport == NULL) qtexport = MEM_callocN(sizeof(QuicktimeExport), "QuicktimeExport");
+       if (qtexport == NULL) qtexport = MEM_callocN(sizeof(QuicktimeExport), "QuicktimeExport");
        
        [QTMovie enterQTKitOnThread];
        
@@ -476,7 +476,7 @@ int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, R
                                err = AudioFileCreateWithURL(outputFileURL, audioFileType, &qtexport->audioOutputFormat, kAudioFileFlags_EraseFile, &qtexport->audioFile);
                                CFRelease(outputFileURL);
                                
-                               if(err)
+                               if (err)
                                        BKE_report(reports, RPT_ERROR, "\nQuicktime: unable to create temporary audio file. Format error ?");
                                else {
                                        err = AudioConverterNew(&qtexport->audioInputFormat, &qtexport->audioOutputFormat, &qtexport->audioConverter);
@@ -542,7 +542,7 @@ int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, R
                else
                        qtexport->movie = [[QTMovie alloc] initToWritableFile:qtexport->filename error:&error];
 
-               if(qtexport->movie == nil) {
+               if (qtexport->movie == nil) {
                        BKE_report(reports, RPT_ERROR, "Unable to create quicktime movie.");
                        success = 0;
                        if (qtexport->filename) [qtexport->filename release];
@@ -749,13 +749,11 @@ void end_qt(void)
                        if (audioTmpMovie) {
                                NSArray *audioTracks = [audioTmpMovie tracksOfMediaType:QTMediaTypeSound];
                                QTTrack *audioTrack = nil;
-                               if( [audioTracks count] > 0 )
-                               {
+                               if ( [audioTracks count] > 0 ) {
                                        audioTrack = [audioTracks objectAtIndex:0];
                                }
                        
-                               if( audioTrack )
-                               {
+                               if (audioTrack) {
                                        QTTimeRange totalRange;
                                        totalRange.time = QTZeroTime;
                                        totalRange.duration = [[audioTmpMovie attributeForKey:QTMovieDurationAttribute] QTTimeValue];
@@ -798,7 +796,7 @@ void end_qt(void)
        
        [QTMovie exitQTKitOnThread];
 
-       if(qtexport) {
+       if (qtexport) {
                MEM_freeN(qtexport);
                qtexport = NULL;
        }
index bee26c5348e6cfb0e10f27b56b25e08e5892864c..fbe4733c3b18c8d57a550dd58b03c9de1cdc19eb 100644 (file)
@@ -128,7 +128,7 @@ void free_anim_quicktime(struct anim *anim)
        if (anim == NULL) return;
        if (anim->qtime == NULL) return;
 
-       if(anim->qtime->ibuf)
+       if (anim->qtime->ibuf)
                IMB_freeImBuf(anim->qtime->ibuf);
 
        [anim->qtime->media release];
@@ -136,7 +136,7 @@ void free_anim_quicktime(struct anim *anim)
 
        [QTMovie exitQTKitOnThread];
 
-       if(anim->qtime) MEM_freeN (anim->qtime);
+       if (anim->qtime) MEM_freeN (anim->qtime);
 
        anim->qtime = NULL;
 
@@ -289,7 +289,7 @@ ImBuf *qtime_fetchibuf (struct anim *anim, int position)
        }
                
        if (frameImage == nil) {
-               if(QTIME_DEBUG) printf ("Error reading frame from Quicktime");
+               if (QTIME_DEBUG) printf ("Error reading frame from Quicktime");
                [pool drain];
                return NULL;
        }
@@ -312,7 +312,7 @@ int startquicktime(struct anim *anim)
        anim->qtime = MEM_callocN(sizeof(QuicktimeMovie),"animqt");
 
        if (anim->qtime == NULL) {
-               if(QTIME_DEBUG) printf("Can't alloc qtime: %s\n", anim->name);
+               if (QTIME_DEBUG) printf("Can't alloc qtime: %s\n", anim->name);
                return -1;
        }
 
@@ -329,9 +329,9 @@ int startquicktime(struct anim *anim)
        anim->qtime->movie = [QTMovie movieWithAttributes:attributes error:NULL];
        
        if (!anim->qtime->movie) {
-               if(QTIME_DEBUG) printf("qt: bad movie %s\n", anim->name);
+               if (QTIME_DEBUG) printf("qt: bad movie %s\n", anim->name);
                MEM_freeN(anim->qtime);
-               if(QTIME_DEBUG) printf("qt: can't load %s\n", anim->name);
+               if (QTIME_DEBUG) printf("qt: can't load %s\n", anim->name);
                [QTMovie exitQTKitOnThread];
                [pool drain];
                return -1;
@@ -342,11 +342,11 @@ int startquicktime(struct anim *anim)
        
        videoTracks = [anim->qtime->movie tracksOfMediaType:QTMediaTypeVideo];
        
-       if([videoTracks count] == 0) {
-               if(QTIME_DEBUG) printf("qt: no video tracks for movie %s\n", anim->name);
+       if ([videoTracks count] == 0) {
+               if (QTIME_DEBUG) printf("qt: no video tracks for movie %s\n", anim->name);
                [anim->qtime->movie release];
                MEM_freeN(anim->qtime);
-               if(QTIME_DEBUG) printf("qt: can't load %s\n", anim->name);
+               if (QTIME_DEBUG) printf("qt: can't load %s\n", anim->name);
                [QTMovie exitQTKitOnThread];
                [pool drain];
                return -1;
@@ -360,8 +360,8 @@ int startquicktime(struct anim *anim)
        anim->x = frameSize.width;
        anim->y = frameSize.height;
 
-       if(anim->x == 0 && anim->y == 0) {
-               if(QTIME_DEBUG) printf("qt: error, no dimensions\n");
+       if (anim->x == 0 && anim->y == 0) {
+               if (QTIME_DEBUG) printf("qt: error, no dimensions\n");
                free_anim_quicktime(anim);
                [pool drain];
                return -1;
@@ -398,12 +398,12 @@ int imb_is_a_quicktime(char *name)
        int result;
        NSAutoreleasePool *pool;
        
-       if(!G.have_quicktime) return 0;
+       if (!G.have_quicktime) return 0;
 
        pool = [[NSAutoreleasePool alloc] init];
        
        // don't let quicktime image import handle these
-       ifBLI_testextensie(name, ".swf") ||
+       if (BLI_testextensie(name, ".swf") ||
                BLI_testextensie(name, ".txt") ||
                BLI_testextensie(name, ".mpg") ||
                BLI_testextensie(name, ".wav") ||
@@ -437,7 +437,7 @@ ImBuf  *imb_quicktime_decode(unsigned char *mem, int size, int flags)
        NSBitmapImageRep *blBitmapFormatImageRGB,*blBitmapFormatImageRGBA;
        NSAutoreleasePool *pool;
 
-       if(!G.have_quicktime)
+       if (!G.have_quicktime)
                return NULL;
        
        pool = [[NSAutoreleasePool alloc] init];
index 2dc12f39db7f4bbb829a671cc8d964c6a6a8793e..b23d6b09524fefe4e7d59b54b68e3075f001bf1d 100644 (file)
 
 #define BRICONT                                                               \
        texres->tin= (texres->tin-0.5f) * tex->contrast+tex->bright-0.5f;         \
-       if(texres->tin < 0.0f)      texres->tin= 0.0f;                            \
-       else if(texres->tin > 1.0f) texres->tin= 1.0f;                            \
+       if (texres->tin < 0.0f)      texres->tin= 0.0f;                           \
+       else if (texres->tin > 1.0f) texres->tin= 1.0f;                           \
 
 #define BRICONTRGB                                                            \
        texres->tr= tex->rfac*((texres->tr-0.5f)*tex->contrast+tex->bright-0.5f); \
-       if(texres->tr<0.0f) texres->tr= 0.0f;                                     \
+       if (texres->tr<0.0f) texres->tr= 0.0f;                                    \
        texres->tg= tex->gfac*((texres->tg-0.5f)*tex->contrast+tex->bright-0.5f); \
-       if(texres->tg<0.0f) texres->tg= 0.0f;                                     \
+       if (texres->tg<0.0f) texres->tg= 0.0f;                                    \
        texres->tb= tex->bfac*((texres->tb-0.5f)*tex->contrast+tex->bright-0.5f); \
-       if(texres->tb<0.0f) texres->tb= 0.0f;                                     \
-       if(tex->saturation != 1.0f) {                                             \
+       if (texres->tb<0.0f) texres->tb= 0.0f;                                    \
+       if (tex->saturation != 1.0f) {                                            \
                float _hsv[3];                                                        \
                rgb_to_hsv(texres->tr, texres->tg, texres->tb,                        \
                           _hsv, _hsv+1, _hsv+2);                                     \
index 768fd2cdcf56f966ccf0501c3b3901ddbc2ab747..90ae39ee76757113a09185d60b517a17de724ee5 100644 (file)
@@ -739,7 +739,7 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, con
         * in two each time, giving 2^depth rays. we need to be able to cancel such
         * a render to avoid hanging, a better solution would be random picking
         * between directions and russian roulette termination */
-       if(R.test_break(R.tbh)) {
+       if (R.test_break(R.tbh)) {
                zero_v4(col);
                return;
        }