style cleanup
authorCampbell Barton <ideasman42@gmail.com>
Thu, 20 Sep 2012 12:29:28 +0000 (12:29 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 20 Sep 2012 12:29:28 +0000 (12:29 +0000)
18 files changed:
intern/audaspace/intern/AUD_IFactory.h
intern/audaspace/intern/AUD_IReader.h
intern/audaspace/intern/AUD_IWriter.h
intern/cycles/kernel/kernel_montecarlo.h
intern/cycles/kernel/osl/nodes/node_magic_texture.osl
intern/cycles/kernel/osl/nodes/node_mix.osl
intern/cycles/kernel/svm/bsdf.h
intern/cycles/kernel/svm/bsdf_diffuse.h
intern/cycles/kernel/svm/bsdf_microfacet.h
intern/cycles/kernel/svm/bsdf_ward.h
intern/cycles/kernel/svm/bsdf_westin.h
intern/cycles/kernel/svm/svm_hsv.h
intern/cycles/kernel/svm/svm_noise.h
intern/cycles/render/camera.cpp
intern/ghost/intern/GHOST_SystemCocoa.mm
intern/guardedalloc/test/simpletest/memtest.c
release/windows/contrib/vfapi/vfapi-plugin.c
source/blender/gpu/intern/gpu_draw.c

index a7c214bb5a1a826d937b7c25293c8b496309f6e6..95b4643072e4096e9555cabab4891a5db0f3e33e 100644 (file)
@@ -45,7 +45,7 @@ public:
        /**
         * Destroys the factory.
         */
-       virtual ~AUD_IFactory(){}
+       virtual ~AUD_IFactory() {}
 
        /**
         * Creates a reader for playback of the sound source.
index 8e0e03dd95dcb13477edfd2b30e91e87bb87d28c..c2c9e607b55ccb57da35304e32ecf83be5273921 100644 (file)
@@ -42,7 +42,7 @@ public:
        /**
         * Destroys the reader.
         */
-       virtual ~AUD_IReader(){}
+       virtual ~AUD_IReader() {}
 
        /**
         * Tells whether the source provides seeking functionality or not.
index 3c92661c75da39d57845de8eb12652d2946a20ec..5406577dd50af78d137190357417310f71278101 100644 (file)
@@ -41,7 +41,7 @@ public:
        /**
         * Destroys the writer.
         */
-       virtual ~AUD_IWriter(){}
+       virtual ~AUD_IWriter() {}
 
        /**
         * Returns how many samples have been written so far.
index afc53b1117a04e53f513153854b21714cead8ec0..d0b588a88d455e428a5009b8fe52a7afd5f3c786 100644 (file)
@@ -46,16 +46,19 @@ __device void to_unit_disk(float *x, float *y)
        if(a > -b) {
                if(a > b) {
                        r = a;
-                        phi = M_PI_4_F *(b/a);
-                } else {
-                        r = b;
-                        phi = M_PI_4_F *(2.0f - a/b);
-                }
-       } else {
+                       phi = M_PI_4_F *(b/a);
+               }
+               else {
+                       r = b;
+                       phi = M_PI_4_F *(2.0f - a/b);
+               }
+       }
+       else {
                if(a < b) {
                        r = -a;
                        phi = M_PI_4_F *(4.0f + b/a);
-               } else {
+               }
+               else {
                        r = -b;
                        if(b != 0.0f)
                                phi = M_PI_4_F *(6.0f - a/b);
index 558660a6b67484967d101cab85e8606438c2685f..c013ebfe6580bab1e6569c71335afc2a5da539c1 100644 (file)
@@ -37,39 +37,39 @@ color magic(point p, int n, float distortion)
                y *= dist;
 
                if(n > 1) {
-                       x= cos(x-y-z);
+                       x = cos(x-y-z);
                        x *= dist;
 
                        if(n > 2) {
-                               z= sin(-x-y-z);
+                               z = sin(-x-y-z);
                                z *= dist;
 
                                if(n > 3) {
-                                       x= -cos(-x+y-z);
+                                       x = -cos(-x+y-z);
                                        x *= dist;
 
                                        if(n > 4) {
-                                               y= -sin(-x+y+z);
+                                               y = -sin(-x+y+z);
                                                y *= dist;
 
                                                if(n > 5) {
-                                                       y= -cos(-x+y+z);
+                                                       y = -cos(-x+y+z);
                                                        y *= dist;
 
                                                        if(n > 6) {
-                                                               x= cos(x+y+z);
+                                                               x = cos(x+y+z);
                                                                x *= dist;
 
                                                                if(n > 7) {
-                                                                       z= sin(x+y-z);
+                                                                       z = sin(x+y-z);
                                                                        z *= dist;
 
                                                                        if(n > 8) {
-                                                                               x= -cos(-x-y+z);
+                                                                               x = -cos(-x-y+z);
                                                                                x *= dist;
 
                                                                                if(n > 9) {
-                                                                                       y= -sin(x-y+z);
+                                                                                       y = -sin(x-y+z);
                                                                                        y *= dist;
                                                                                }
                                                                        }
index 661e543fdd801bb6b233091f2cb6933f29d5edf4..2ce342c49cd53b0b9c5c6900824c4659211d3e75 100644 (file)
@@ -239,8 +239,8 @@ color node_mix_soft(float t, color col1, color col2)
 {
        float tm = 1.0 - t;
 
-       color one= color(1.0);
-       color scr= one - (one - col2)*(one - col1);
+       color one = color(1.0);
+       color scr = one - (one - col2)*(one - col1);
 
        return tm*col1 + t*((one - col1)*col2*col1 + col1*scr);
 }
index 1a90eab0cd19395f525f93874c2bc7147a704640..cfb6321a91841cbebad59399bf936da89730ad45 100644 (file)
@@ -58,7 +58,8 @@ __device float fresnel_dielectric(float eta, const float3 N,
                neta = 1 / eta;
                Nn   = N;
                *is_inside = false;
-       } else {
+       }
+       else {
                // we are inside the surface, 
                cos  = -cos;
                neta = eta;
@@ -74,7 +75,8 @@ __device float fresnel_dielectric(float eta, const float3 N,
                *dTdy = make_float3(0.0f, 0.0f, 0.0f);
 #endif
                return 1; // total internal reflection
-       } else {
+       }
+       else {
                float dnp = sqrtf(arg);
                float nK = (neta * cos)- dnp;
                *T = -(neta * I)+(nK * Nn);
index 45e82a566c07831bed15cb5ed858f813f3f3f6e1..edf8dd933416ff75b72c30cfed74c7c1a1329272 100644 (file)
@@ -144,9 +144,10 @@ __device int bsdf_translucent_sample(const ShaderData *sd, const ShaderClosure *
                *domega_in_dx *= -125.0f;
                *domega_in_dy *= -125.0f;
 #endif
-       } else
+       }
+       else {
                *pdf = 0;
-
+       }
        return LABEL_TRANSMIT|LABEL_DIFFUSE;
 }
 
index 01e3acb76e83cdfa00e39cb7083d5609ad8f4767..d8f0310bd023ad4fd814d199849aee3d1433fb61 100644 (file)
@@ -210,7 +210,8 @@ __device int bsdf_microfacet_ggx_sample(const ShaderData *sd, const ShaderClosur
 #endif
                                }
                        }
-               } else {
+               }
+               else {
                        // CAUTION: the i and o variables are inverted relative to the paper
                        // eq. 39 - compute actual refractive direction
                        float3 R, T;
@@ -443,7 +444,8 @@ __device int bsdf_microfacet_beckmann_sample(const ShaderData *sd, const ShaderC
 #endif
                                }
                        }
-               } else {
+               }
+               else {
                        // CAUTION: the i and o variables are inverted relative to the paper
                        // eq. 39 - compute actual refractive direction
                        float3 R, T;
index 86bca69425d7710c84eaca355d415d9c69f3d221..6ae45948a73b6c91e9c742083a0998f6cbf35d91 100644 (file)
@@ -127,19 +127,22 @@ __device int bsdf_ward_sample(const ShaderData *sd, const ShaderClosure *sc, flo
                        float tanPhi = alphaRatio * tanf(M_PI_2_F * val);
                        cosPhi = 1 / sqrtf(1 + tanPhi * tanPhi);
                        sinPhi = tanPhi * cosPhi;
-               } else if(randu < 0.5f) {
+               }
+               else if(randu < 0.5f) {
                        float val = 1 - 4 * (0.5f - randu);
                        float tanPhi = alphaRatio * tanf(M_PI_2_F * val);
                        // phi = M_PI_F - phi;
                        cosPhi = -1 / sqrtf(1 + tanPhi * tanPhi);
                        sinPhi = -tanPhi * cosPhi;
-               } else if(randu < 0.75f) {
+               }
+               else if(randu < 0.75f) {
                        float val = 4 * (randu - 0.5f);
                        float tanPhi = alphaRatio * tanf(M_PI_2_F * val);
                        //phi = M_PI_F + phi;
                        cosPhi = -1 / sqrtf(1 + tanPhi * tanPhi);
                        sinPhi = tanPhi * cosPhi;
-               } else {
+               }
+               else {
                        float val = 1 - 4 * (1 - randu);
                        float tanPhi = alphaRatio * tanf(M_PI_2_F * val);
                        // phi = 2 * M_PI_F - phi;
index 6193d81c244e78fddc51c8ca6b26ba0e24cca32e..3e7c27f44a4aae77e18c8413693afc16988cb3f4 100644 (file)
@@ -196,8 +196,10 @@ __device int bsdf_westin_sheen_sample(const ShaderData *sd, const ShaderClosure
                *domega_in_dx *= 125.0f;
                *domega_in_dy *= 125.0f;
 #endif
-       } else
+       }
+       else {
                pdf = 0;
+       }
        return LABEL_REFLECT|LABEL_DIFFUSE;
 }
 
index ed17d3fc985ee7aa4cb6c7e1cb3d73c0b2c1ebae..bce11d6292349a271c85ca46aa4ca3627024d18d 100644 (file)
@@ -69,11 +69,11 @@ __device float3 hsv_to_rgb(float3 hsv)
        s = hsv.y;
        v = hsv.z;
 
-       if(s==0.0f) {
+       if(s == 0.0f) {
                rgb = make_float3(v, v, v);
        }
        else {
-               if(h==1.0f)
+               if(h == 1.0f)
                        h = 0.0f;
                
                h *= 6.0f;
index dfaf43acbd4402536e39da8373d725cda3be42ec..224a1d96543be3e94187c6b9d6c9022a2126ae1f 100644 (file)
@@ -104,7 +104,7 @@ __device float grad(int hash, float x, float y, float z)
        // use vectors pointing to the edges of the cube
        int h = hash & 15;
        float u = h<8 ? x : y;
-       float v = h<4 ? y : h==12||h==14 ? x : z;
+       float v = h<4 ? y : h == 12 || h == 14 ? x : z;
        return ((h&1) ? -u : u) + ((h&2) ? -v : v);
 }
 
index e44caa90f12e91bd52ff5d9a05ee2a46cc81123f..3fd7a1b28e390a4d00688003557949419594572a 100644 (file)
@@ -245,7 +245,7 @@ void Camera::device_free(Device *device, DeviceScene *dscene)
 
 bool Camera::modified(const Camera& cam)
 {
-       return !((shuttertime== cam.shuttertime) &&
+       return !((shuttertime == cam.shuttertime) &&
                (aperturesize == cam.aperturesize) &&
                (blades == cam.blades) &&
                (bladesrotation == cam.bladesrotation) &&
index 76ebdcc07e0b08a2a2b64c59587d84b790d53846..fed3bdbc8f0309edef84e163cbdbbcea71046404 100644 (file)
@@ -459,7 +459,8 @@ extern "C" int GHOST_HACK_getFirstFile(char buf[FIRSTFILEBUFLG])
                strncpy(buf, g_firstFileBuf, FIRSTFILEBUFLG - 1);
                buf[FIRSTFILEBUFLG - 1] = '\0';
                return 1;
-       } else {
+       }
+       else {
                return 0; 
        }
 }
index 7c6a0a2d54674c09759cb2e683fb49372519749f..749e2500dd16d79a73d3c8af9859a7ffe3c93280 100644 (file)
@@ -94,7 +94,8 @@ int main (int argc, char *argv[])
        if (verbose) {
                if (error_status) {
                        fprintf(stderr, "|--* Memory test FAILED\n|\n");
-               } else {
+               }
+               else {
                        fprintf(stderr, "|--* Memory tested as good (as it should be)\n|\n");
                }
        } 
@@ -130,7 +131,8 @@ int main (int argc, char *argv[])
        if (verbose) {
                if (retval) {
                        fprintf(stderr, "|--* Memory test failed (as it should be)\n");
-               } else {
+               }
+               else {
                        fprintf(stderr, "|--* Memory test FAILED to find corrupted blocks \n");
                }
        } 
@@ -147,7 +149,8 @@ int main (int argc, char *argv[])
        if (verbose) {
                if (error_status) {
                        fprintf(stderr,"|\n|--* Errors were detected\n");
-               } else {
+               }
+               else {
                        fprintf(stderr,"|\n|--* Test exited succesfully\n");
                }
                
index 81547b8bb1a4551c69c8fdaaaf3c5fbbb8a9d55e..8e1bfb0f247610f5875d3766d9fe4b445279d2fd 100644 (file)
@@ -157,7 +157,8 @@ static int my_gets(SOCKET sock, char * line, int maxlen)
                        line++;
                        *line = 0;
                        break;
-               } else {
+               }
+               else {
                        line++;
                        maxlen--;
                }
@@ -251,15 +252,20 @@ HRESULT __stdcall VF_OpenFileFunc_Blen(
                        
                        if (strcmp(key, "width") == 0) {
                                rval->width = atoi(val);
-                       } else if (strcmp(key, "height") == 0) {
+                       }
+                       else if (strcmp(key, "height") == 0) {
                                rval->height = atoi(val);
-                       } else if (strcmp(key, "start") == 0) {
+                       }
+                       else if (strcmp(key, "start") == 0) {
                                rval->start = atoi(val);
-                       } else if (strcmp(key, "end") == 0) {
+                       }
+                       else if (strcmp(key, "end") == 0) {
                                rval->end = atoi(val);
-                       } else if (strcmp(key, "rate") == 0) {
+                       }
+                       else if (strcmp(key, "rate") == 0) {
                                rval->rate = atoi(val);
-                       } else if (strcmp(key, "ratescale") == 0) {
+                       }
+                       else if (strcmp(key, "ratescale") == 0) {
                                rval->ratescale = atoi(val);
                        }
                }
index 9ae505ef0d01cb4f00bbaaa0181f6b1a7bd4d074..962bb0aed2288d0662412ae582cb09b135d98f42 100644 (file)
@@ -915,7 +915,8 @@ void GPU_paint_update_image(Image *ima, int x, int y, int w, int h)
                         * so we will be using GPU mipmap generation here */
                        if (GPU_get_mipmap()) {
                                glGenerateMipmapEXT(GL_TEXTURE_2D);
-                       } else {
+                       }
+                       else {
                                ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
                        }
 
@@ -942,7 +943,8 @@ void GPU_paint_update_image(Image *ima, int x, int y, int w, int h)
                /* see comment above as to why we are using gpu mipmap generation here */
                if (GPU_get_mipmap()) {
                        glGenerateMipmapEXT(GL_TEXTURE_2D);
-               } else {
+               }
+               else {
                        ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
                }
        }