cleanup: style
authorCampbell Barton <ideasman42@gmail.com>
Fri, 23 Jan 2015 14:59:09 +0000 (01:59 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 23 Jan 2015 14:59:09 +0000 (01:59 +1100)
17 files changed:
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/tracking_auto.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/versioning_270.c
source/blender/collada/EffectExporter.cpp
source/blender/collada/MeshImporter.cpp
source/blender/compositor/intern/COM_MemoryBuffer.cpp
source/blender/compositor/intern/COM_MemoryBuffer.h
source/blender/compositor/intern/COM_OpenCLDevice.cpp
source/blender/compositor/intern/COM_OpenCLDevice.h
source/blender/compositor/operations/COM_DilateErodeOperation.cpp
source/blender/compositor/operations/COM_InpaintOperation.cpp
source/blender/compositor/operations/COM_ReadBufferOperation.cpp
source/blender/compositor/operations/COM_RenderLayersProg.cpp
source/blender/editors/armature/armature_relations.c
source/blender/gpu/intern/gpu_select.c
source/blender/render/intern/source/render_result.c

index 9c3e78d7bb3c1272f8e84f29738f35ece929c938..1aaacda1484630f828fc5c7b7bc3eccd1318fb50 100644 (file)
@@ -1175,7 +1175,7 @@ void BKE_sim_debug_data_clear_category(const char *category)
        if (_sim_debug_data->gh) {
                GHashIterator iter;
                BLI_ghashIterator_init(&iter, _sim_debug_data->gh);
-               while(!BLI_ghashIterator_done(&iter)) {
+               while (!BLI_ghashIterator_done(&iter)) {
                        SimDebugElement *elem = BLI_ghashIterator_getValue(&iter);
                        BLI_ghashIterator_step(&iter); /* removing invalidates the current iterator, so step before removing */
                        
index 22a380ea8353fd17529e783963979d7a566e52f6..4cb3f2ca4934a2e29daaa4fc5a424f60cac000e5 100644 (file)
@@ -373,7 +373,7 @@ bool BKE_autotrack_context_step(AutoTrackContext *context)
        bool ok = false;
        int track;
 
-#pragma omp parallel for if(context->num_tracks > 1)
+#pragma omp parallel for if (context->num_tracks > 1)
        for (track = 0; track < context->num_tracks; ++track) {
                AutoTrackOptions *options = &context->options[track];
                libmv_Marker libmv_current_marker,
index 8d41682334bc9a7becc38731641e1c8b41f7d8ea..5893c2275beb7a1e03fd2c2292f088ef072bbd81 100644 (file)
@@ -4549,7 +4549,7 @@ static void lib_link_object(FileData *fd, Main *main)
                                        steeringa->target = newlibadr(fd, ob->id.lib, steeringa->target);
                                        steeringa->navmesh = newlibadr(fd, ob->id.lib, steeringa->navmesh);
                                }
-                               else if(act->type == ACT_MOUSE) {
+                               else if (act->type == ACT_MOUSE) {
                                        /* bMouseActuator *moa= act->data; */
                                }
                        }
index c652f56bd93bf80c26cbabe72e167b8410ddf43c..652a4525a7ea2bf96b13089567f3b1cefae516ba 100644 (file)
@@ -479,11 +479,11 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
                for (ob = main->object.first; ob; ob = ob->id.next) {
                        for (md = ob->modifiers.first; md; md = md->next) {
                                if (md->type == eModifierType_Cloth) {
-                                       ClothModifierData *clmd = (ClothModifierData*) md;
+                                       ClothModifierData *clmd = (ClothModifierData *)md;
                                        clmd->sim_parms->bending_damping = 0.5f;
                                }
                                else if (md->type == eModifierType_ParticleSystem) {
-                                       ParticleSystemModifierData *pmd = (ParticleSystemModifierData*) md;
+                                       ParticleSystemModifierData *pmd = (ParticleSystemModifierData *)md;
                                        if (pmd->psys->clmd) {
                                                pmd->psys->clmd->sim_parms->bending_damping = 0.5f;
                                        }
index 3c35618a4cda8319000e236974e1c0472aeac5c2..1f0e00b3bd680f7f546e9a1f4e3f264fe9e33c58 100644 (file)
@@ -387,7 +387,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
        std::set<Image *>::iterator uv_t_iter;
        int idx;
        for (idx = 0, uv_t_iter = uv_textures.begin(); uv_t_iter != uv_textures.end(); uv_t_iter++, idx++ ) {
-               if(active_uv_layer>-1 && idx==active_uv_layer) {
+               if (active_uv_layer>-1 && idx==active_uv_layer) {
                        Image *ima = *uv_t_iter;
                        std::string key(id_name(ima));
                        key = translate_id(key);
index a4bf1d28366a6cc970fe1eaa5eea0862e5924c36..571faf8c2e933e07fe796655bb2d45433975caa0 100644 (file)
@@ -227,8 +227,7 @@ void MeshImporter::set_vcol(MLoopCol *mlc, VCOLDataWrapper &vob, int loop_index,
 {
        COLLADAFW::UIntValuesArray& indices =index_list.getIndices();
        int index;
-       for(index = 0; index < count; index++,mlc++)
-       {
+       for (index = 0; index < count; index++, mlc++) {
                int v_index = indices[index+loop_index];
                vob.get_vcol(v_index,mlc);
        }
@@ -708,8 +707,7 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh, Mesh *me)
                                                mpoly->flag |= ME_SMOOTH;
                                }
 
-                               for(unsigned int vcolor_index = 0 ; vcolor_index < index_list_array_vcolor.getCount();vcolor_index++)
-                               {
+                               for (unsigned int vcolor_index = 0 ; vcolor_index < index_list_array_vcolor.getCount();vcolor_index++) {
                                        COLLADAFW::IndexList& index_list = *index_list_array_vcolor[vcolor_index];
                                        COLLADAFW::String colname = extract_vcolname(index_list.getName());
                                        MLoopCol *mloopcol = (MLoopCol  *)CustomData_get_layer_named(&me->ldata, CD_MLOOPCOL, colname.c_str());
index 58767960cc850fdbbdb4832bec0a9c88998fd06f..37035c50d2c37301626f2553c5da803de5da38c6 100644 (file)
 using std::min;
 using std::max;
 
-static unsigned int determine_num_channels(DataType datatype) {
+static unsigned int determine_num_channels(DataType datatype)
+{
        switch (datatype) {
-       case COM_DT_VALUE:
-               return COM_NUM_CHANNELS_VALUE;
-       case COM_DT_VECTOR:
-               return COM_NUM_CHANNELS_VECTOR;
-       case COM_DT_COLOR:
-       default:
-               return COM_NUM_CHANNELS_COLOR;
+               case COM_DT_VALUE:
+                       return COM_NUM_CHANNELS_VALUE;
+               case COM_DT_VECTOR:
+                       return COM_NUM_CHANNELS_VECTOR;
+               case COM_DT_COLOR:
+               default:
+                       return COM_NUM_CHANNELS_COLOR;
        }
 }
 
@@ -226,7 +227,7 @@ static void read_ewa_pixel_sampled(void *userdata, int x, int y, float result[4]
 
 void MemoryBuffer::readEWA(float *result, const float uv[2], const float derivatives[2][2], PixelSampler sampler)
 {
-       BLI_assert(this->m_datatype==COM_DT_COLOR);
+       BLI_assert(this->m_datatype == COM_DT_COLOR);
        ReadEWAData data;
        data.buffer = this;
        data.sampler = sampler;
index 320de3d67cdeb438dc04bd0c8b612e9dec0eb4ba..e0c542108a125b0b418c4b024c05928ab09c477e 100644 (file)
@@ -215,7 +215,7 @@ public:
                bool clip_y = (extend_y == COM_MB_CLIP && (y < m_rect.ymin || y >= m_rect.ymax));
                if (clip_x || clip_y) {
                        /* clip result outside rect is zero */
-                       memset(result, 0, this->m_num_channels*sizeof(float));
+                       memset(result, 0, this->m_num_channels * sizeof(float));
                }
                else {
                        int u = x;
@@ -223,7 +223,7 @@ public:
                        this->wrap_pixel(u, v, extend_x, extend_y);
                        const int offset = (this->m_width * y + x) * this->m_num_channels;
                        float* buffer = &this->m_buffer[offset];
-                       memcpy(result, buffer, sizeof(float)*this->m_num_channels);
+                       memcpy(result, buffer, sizeof(float) * this->m_num_channels);
                }
        }
 
@@ -240,14 +240,14 @@ public:
                BLI_assert(offset >= 0);
                BLI_assert(offset < this->determineBufferSize() * this->m_num_channels);
                BLI_assert(!(extend_x == COM_MB_CLIP && (u < m_rect.xmin || u >= m_rect.xmax)) &&
-                                  !(extend_y == COM_MB_CLIP && (v < m_rect.ymin || v >= m_rect.ymax)));
+                          !(extend_y == COM_MB_CLIP && (v < m_rect.ymin || v >= m_rect.ymax)));
 #if 0
                /* always true */
                BLI_assert((int)(MEM_allocN_len(this->m_buffer) / sizeof(*this->m_buffer)) ==
                           (int)(this->determineBufferSize() * COM_NUMBER_OF_CHANNELS));
 #endif
-               floatbuffer = &this->m_buffer[offset];
-               memcpy(result, buffer, sizeof(float)*this->m_num_channels);
+               float *buffer = &this->m_buffer[offset];
+               memcpy(result, buffer, sizeof(float) * this->m_num_channels);
        }
        
        void writePixel(int x, int y, const float color[4]);
index 7fc4fd38abd3f84ce80ee201f79a5cd5fea7852c..5960082c2fd68a122d19252627142788755a311b 100644 (file)
@@ -90,9 +90,11 @@ const cl_image_format* OpenCLDevice::determineImageFormat(MemoryBuffer *memoryBu
        int num_channels = memoryBuffer->get_num_channels();
        if (num_channels == 1) {
                imageFormat = &IMAGE_FORMAT_VALUE;
-       } else if (num_channels == 3) {
+       }
+       else if (num_channels == 3) {
                imageFormat = &IMAGE_FORMAT_VECTOR;
-       } else {
+       }
+       else {
                imageFormat = &IMAGE_FORMAT_COLOR;
        }
 
index f8a8841ef475da5169adf0a67acd4050ed197d55..a513954ee0d624e7069783a7b7b58fbe322728c0 100644 (file)
@@ -98,7 +98,7 @@ public:
        * @brief determine an image format
        * @param memorybuffer
        */
-       static const cl_image_formatdetermineImageFormat(MemoryBuffer *memoryBuffer);
+       static const cl_image_format *determineImageFormat(MemoryBuffer *memoryBuffer);
 
        cl_context getContext() { return this->m_context; }
 
index cee39994aed0a4a955a4a870dcf7f06f50891b94..6d15ef3395b9cd6b402fc9a1c03f3cce957c4daa 100644 (file)
@@ -72,7 +72,7 @@ void DilateErodeThresholdOperation::executePixel(float output[4], int x, int y,
        const float inset = this->m_inset;
        float mindist = rd * 2;
 
-       MemoryBuffer *inputBuffer = (MemoryBuffer*)data;
+       MemoryBuffer *inputBuffer = (MemoryBuffer *)data;
        float *buffer = inputBuffer->getBuffer();
        rcti *rect = inputBuffer->getRect();
        const int minx = max(x - this->m_scope, rect->xmin);
index 922441a68b65893c96f41bf4f74f362f2447502c..18611c051d33126e765b867d0b52accd083844d4 100644 (file)
@@ -83,8 +83,8 @@ float *InpaintSimpleOperation::get_pixel(int x, int y)
        ASSERT_XY_RANGE(x, y);
 
        return &this->m_cached_buffer[
-                       y * width * COM_NUM_CHANNELS_COLOR +
-                       x * COM_NUM_CHANNELS_COLOR];
+               y * width * COM_NUM_CHANNELS_COLOR +
+               x * COM_NUM_CHANNELS_COLOR];
 }
 
 int InpaintSimpleOperation::mdist(int x, int y) 
index 709c30f4015fc72115eef6c0fe7bdb8ad066f038..ad4084a7092f1f067bffa921e2526b2e9f383c07 100644 (file)
@@ -60,18 +60,17 @@ void ReadBufferOperation::executePixelSampled(float output[4], float x, float y,
        }
        else {
                switch (sampler) {
-               case COM_PS_NEAREST:
-                       m_buffer->read(output, x, y);
-                       break;
-               case COM_PS_BILINEAR:
-               default:
-                       m_buffer->readBilinear(output, x, y);
-                       break;
-               case COM_PS_BICUBIC:
-                       m_buffer->readBilinear(output, x, y);
-                       break;
+                       case COM_PS_NEAREST:
+                               m_buffer->read(output, x, y);
+                               break;
+                       case COM_PS_BILINEAR:
+                       default:
+                               m_buffer->readBilinear(output, x, y);
+                               break;
+                       case COM_PS_BICUBIC:
+                               m_buffer->readBilinear(output, x, y);
+                               break;
                }
-
        }
 }
 
index 8e778e44a79d0ddbb471a2ec0f85c772f5bed720..4c6d5c2478132bf91496459a4b7cf35627ec8908 100644 (file)
@@ -142,7 +142,8 @@ void RenderLayersBaseProg::executePixelSampled(float output[4], float x, float y
                }
                else if (elemsize == 3) {
                        zero_v3(output);
-               } else {
+               }
+               else {
                        BLI_assert(elemsize == 4);
                        zero_v4(output);
                }
index 7a7adc5825236a4369ae87920c5ed33f2f27d711..41f528bc5e24eb36d339a35a4e9e9fb1ec075044 100644 (file)
@@ -153,7 +153,7 @@ static void joined_armature_fix_animdata_cb(ID *id, AnimData *adt, void *user_da
                                /* only remap if changed; this still means there will be some waste if there aren't many drivers/keys */
                                if (strcmp(old_name, new_name) && strstr(fcu->rna_path, old_name)) {
                                        fcu->rna_path = BKE_animsys_fix_rna_path_rename(id, fcu->rna_path, "pose.bones",
-                                                                                                                                   old_name, new_name, 0, 0, false);
+                                                                                       old_name, new_name, 0, 0, false);
                                        
                                        /* we don't want to apply a second remapping on this driver now, 
                                         * so stop trying names, but keep fixing drivers
@@ -193,7 +193,7 @@ static void joined_armature_fix_animdata_cb(ID *id, AnimData *adt, void *user_da
                                                                if ((dtar->rna_path) && strstr(dtar->rna_path, old_name)) {
                                                                        /* Fix up path */
                                                                        dtar->rna_path = BKE_animsys_fix_rna_path_rename(id, dtar->rna_path, "pose.bones",
-                                                                                                                                                    old_name, new_name, 0, 0, false);
+                                                                                                                        old_name, new_name, 0, 0, false);
                                                                        break; /* no need to try any more names for bone path */
                                                                }
                                                                else if (strcmp(dtar->pchan_name, old_name) == 0) {
index d8e1fab9f8006f20f6cc3cf88b9f6b0ed8694882..0515334feec2f361e7463ed9d0971df9f74125da 100644 (file)
@@ -135,7 +135,7 @@ void GPU_select_begin(unsigned int *buffer, unsigned int bufsize, rctf *input, c
 bool GPU_select_load_id(unsigned int id)
 {
        /* if no selection mode active, ignore */
-       if(!g_query_state.select_is_active)
+       if (!g_query_state.select_is_active)
                return true;
 
        if (!g_query_state.use_gpu_select) {
@@ -191,7 +191,7 @@ unsigned int GPU_select_end(void)
                        glGetQueryObjectuivARB(g_query_state.queries[i], GL_QUERY_RESULT_ARB, &result);
                        if (result > 0) {
                                if (g_query_state.mode != GPU_SELECT_NEAREST_SECOND_PASS) {
-                                       if(hits < g_query_state.bufsize) {
+                                       if (hits < g_query_state.bufsize) {
                                                g_query_state.buffer[hits * 4] = 1;
                                                g_query_state.buffer[hits * 4 + 1] = 0xFFFF;
                                                g_query_state.buffer[hits * 4 + 2] = 0xFFFF;
index 154c0c8570ccb0af5b3ea53e0328d942efbd9b40..0d859f81e0c93e02f5f26f408963077d77501810 100644 (file)
@@ -611,7 +611,7 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf
                        render_layer_add_pass(rr, rl, 3, SCE_PASS_SUBSURFACE_COLOR);
 
 #ifdef WITH_CYCLES_DEBUG
-               if(BKE_scene_use_new_shading_nodes(re->scene)) {
+               if (BKE_scene_use_new_shading_nodes(re->scene)) {
                        render_layer_add_debug_pass(rr, rl, 1, SCE_PASS_DEBUG,
                                RENDER_PASS_DEBUG_BVH_TRAVERSAL_STEPS);
                }