cleanup: style/indentation
authorCampbell Barton <ideasman42@gmail.com>
Wed, 11 Feb 2015 07:38:41 +0000 (18:38 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 11 Feb 2015 07:39:28 +0000 (18:39 +1100)
23 files changed:
source/blender/blenkernel/intern/movieclip.c
source/blender/blenkernel/intern/seqeffects.c
source/blender/blenkernel/intern/softbody.c
source/blender/blenlib/intern/noise.c
source/blender/bmesh/tools/bmesh_bevel.c
source/blender/compositor/intern/COM_MemoryBuffer.cpp
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/render/render_internal.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_outliner/outliner_tree.c
source/blender/editors/transform/transform.c
source/blender/editors/uvedit/uvedit_smart_stitch.c
source/blender/freestyle/intern/winged_edge/Curvature.cpp
source/blender/gpu/intern/gpu_buffers.c
source/blender/gpu/intern/gpu_material.c
source/blender/imbuf/intern/divers.c
source/blender/makesdna/DNA_gpencil_types.h
source/blender/makesrna/intern/rna_ui_api.c
source/blender/quicktime/apple/qtkit_export.m
source/blender/render/intern/source/pipeline.c
source/gameengine/Ketsji/KX_MouseActuator.cpp

index 491fb46..73f75f4 100644 (file)
@@ -790,10 +790,10 @@ static ImBuf *postprocess_frame(MovieClip *clip, MovieClipUser *user, ImBuf *ibu
        }
 
        if (postprocess_flag) {
-               bool disable_red   = (postprocess_flag & MOVIECLIP_DISABLE_RED) != 0,
-                        disable_green = (postprocess_flag & MOVIECLIP_DISABLE_GREEN) != 0,
-                        disable_blue  = (postprocess_flag & MOVIECLIP_DISABLE_BLUE) != 0,
-                        grayscale     = (postprocess_flag & MOVIECLIP_PREVIEW_GRAYSCALE) != 0;
+               bool disable_red   = (postprocess_flag & MOVIECLIP_DISABLE_RED) != 0;
+               bool disable_green = (postprocess_flag & MOVIECLIP_DISABLE_GREEN) != 0;
+               bool disable_blue  = (postprocess_flag & MOVIECLIP_DISABLE_BLUE) != 0;
+               bool grayscale     = (postprocess_flag & MOVIECLIP_PREVIEW_GRAYSCALE) != 0;
 
                if (disable_red || disable_green || disable_blue || grayscale)
                        BKE_tracking_disable_channels(postproc_ibuf, disable_red, disable_green, disable_blue, 1);
index 11a6cb7..6157d63 100644 (file)
@@ -2670,8 +2670,8 @@ static void do_gaussian_blur_effect_byte(Sequence *seq,
 {
 #define INDEX(_x, _y) (((_y) * (x) + (_x)) * 4)
        GaussianBlurVars *data = seq->effectdata;
-       const int size_x = (int) (data->size_x + 0.5f),
-                 size_y = (int) (data->size_y + 0.5f);
+       const int size_x = (int) (data->size_x + 0.5f);
+       const int size_y = (int) (data->size_y + 0.5f);
        int i, j;
 
        /* Make gaussian weight tabke. */
@@ -2754,8 +2754,8 @@ static void do_gaussian_blur_effect_float(Sequence *seq,
 {
 #define INDEX(_x, _y) (((_y) * (x) + (_x)) * 4)
        GaussianBlurVars *data = seq->effectdata;
-       const int size_x = (int) (data->size_x + 0.5f),
-                 size_y = (int) (data->size_y + 0.5f);
+       const int size_x = (int) (data->size_x + 0.5f);
+       const int size_y = (int) (data->size_y + 0.5f);
        int i, j;
 
        /* Make gaussian weight tabke. */
index 941344c..06d0627 100644 (file)
@@ -1945,7 +1945,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
                                                        float dist;
 
                                                        closest_to_line_segment_v3(ve, opco, nv1, nv2);
-                                                        sub_v3_v3v3(ve, opco, ve);
+                                                       sub_v3_v3v3(ve, opco, ve);
                                                        dist = normalize_v3(ve);
                                                        if ((dist < outerfacethickness)&&(dist < mindistedge )) {
                                                                copy_v3_v3(coledge, ve);
index f002ea5..5febf72 100644 (file)
@@ -278,8 +278,8 @@ static float npfade(float t)
 static float grad(int hash_val, float x, float y, float z)
 {
        int h = hash_val & 15;                 /* CONVERT LO 4 BITS OF HASH CODE */
-       float u = h < 8 ? x : y,               /* INTO 12 GRADIENT DIRECTIONS. */
-             v = h < 4 ? y : h == 12 || h == 14 ? x : z;
+       float u = h < 8 ? x : y;               /* INTO 12 GRADIENT DIRECTIONS. */
+       float v = h < 4 ? y : h == 12 || h == 14 ? x : z;
        return ((h & 1) == 0 ? u : -u) + ((h & 2) == 0 ? v : -v);
 }
 
index b25572e..a418ade 100644 (file)
@@ -2896,8 +2896,9 @@ static BevVert *bevel_vert_construct(BMesh *bm, BevelParams *bp, BMVert *v)
                        nwire++;
                        /* If edge beveling, exclude wire edges from edges array.
                         * Mark this edge as "chosen" so loop below won't choose it. */
-                        if (!bp->vertex_only)
+                       if (!bp->vertex_only) {
                                BM_BEVEL_EDGE_TAG_ENABLE(bme);
+                       }
                }
        }
        if (!first_bme)
index 37035c5..9e6e5a4 100644 (file)
@@ -187,11 +187,11 @@ void MemoryBuffer::addPixel(int x, int y, const float color[4])
            y >= this->m_rect.ymin && y < this->m_rect.ymax)
        {
                const int offset = (this->m_width * (y - this->m_rect.ymin) + x - this->m_rect.xmin) * this->m_num_channels;
-                float *dst = &this->m_buffer[offset];
-                const float *src = color;
-                for (int i = 0; i < this->m_num_channels ; i++, dst++, src++) {
-                        *dst += *src;
-                }
+               float *dst = &this->m_buffer[offset];
+               const float *src = color;
+               for (int i = 0; i < this->m_num_channels ; i++, dst++, src++) {
+                       *dst += *src;
+               }
        }
 }
 
index 16b74c3..5127844 100644 (file)
@@ -2745,7 +2745,7 @@ static void mesh_separate_material_assign_mat_nr(Object *ob, const short mat_nr)
                }
 
                if (mat_nr < *totcolp) {
-                        ma_obdata = (*matarar)[mat_nr];
+                       ma_obdata = (*matarar)[mat_nr];
                }
                else {
                        ma_obdata = NULL;
index dee216d..00d79b2 100644 (file)
@@ -895,7 +895,7 @@ int ED_mesh_mirror_get_vert(Object *ob, int index)
                index_mirr = eve_mirr ? BM_elem_index_get(eve_mirr) : -1;
        }
        else {
-                index_mirr = mesh_get_x_mirror_vert(ob, index, use_topology);
+               index_mirr = mesh_get_x_mirror_vert(ob, index, use_topology);
        }
 
        return index_mirr;
index b04f1d3..8fcd91b 100644 (file)
@@ -1146,8 +1146,8 @@ BLI_INLINE void rcti_scale_coords(rcti *scaled_rect, const rcti *rect,
 static void render_update_resolution(Render *re, const RenderPreview *rp,
                                      bool use_border, const rcti *clip_rect)
 {
-       int winx = rp->ar->winx / rp->resolution_divider,
-           winy = rp->ar->winy / rp->resolution_divider;
+       int winx = rp->ar->winx / rp->resolution_divider;
+       int winy = rp->ar->winy / rp->resolution_divider;
        if (use_border) {
                rcti scaled_cliprct;
                rcti_scale_coords(&scaled_cliprct, clip_rect,
@@ -1461,7 +1461,7 @@ static void render_view3d_do(RenderEngine *engine, const bContext *C)
        engine->flag &= ~RE_ENGINE_DO_UPDATE;
 }
 
-/* callback for render engine , on changes */
+/* callback for render engine, on changes */
 void render_view3d_update(RenderEngine *engine, const bContext *C)
 {      
        /* this shouldn't be needed and causes too many database rebuilds, but we
index f338fa1..deb6c7b 100644 (file)
@@ -2093,7 +2093,7 @@ void ED_update_for_newframe(Main *bmain, Scene *scene, int UNUSED(mute))
        /* this function applies the changes too */
        BKE_scene_update_for_newframe(bmain->eval_ctx, bmain, scene, layers);
        
-       //if ( (CFRA>1) && (!mute) && (scene->r.audio.flag & AUDIO_SCRUB)) 
+       //if ((CFRA > 1) && (!mute) && (scene->r.audio.flag & AUDIO_SCRUB))
        //      audiostream_scrub( CFRA );
        
        /* 3d window, preview */
index 5ce3517..f3c6781 100644 (file)
@@ -242,7 +242,7 @@ static int sound_update_animation_flags_exec(bContext *C, wmOperator *UNUSED(op)
        }
        SEQ_END
 
-           fcu = id_data_find_fcurve(&scene->id, scene, &RNA_Scene, "audio_volume", 0, &driven);
+       fcu = id_data_find_fcurve(&scene->id, scene, &RNA_Scene, "audio_volume", 0, &driven);
        if (fcu || driven)
                scene->audio.flag |= AUDIO_VOLUME_ANIMATED;
        else
index abc8277..c956d77 100644 (file)
@@ -828,6 +828,7 @@ static void outliner_add_id_contents(SpaceOops *soops, TreeElement *te, TreeStor
                                outliner_add_element(soops, &te->subtree, gpl, te, TSE_GP_LAYER, a);
                                a++;
                        }
+                       break;
                }
        }
 }
index 2cf8031..92103c3 100644 (file)
@@ -1503,7 +1503,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
        if ((t->modifiers   & (MOD_SNAP | MOD_SNAP_INVERT)) !=
            (modifiers_prev & (MOD_SNAP | MOD_SNAP_INVERT)))
        {
-           applyMouseInput(t, &t->mouse, t->mval, t->values);
+               applyMouseInput(t, &t->mouse, t->mval, t->values);
        }
 
        /* Per transform event, if present */
index 4cb1f89..f7a8735 100644 (file)
@@ -574,11 +574,11 @@ static void stitch_island_calculate_vert_rotation(UvElement *element, StitchStat
                        edgecos = dot_v2v2(normal, state->normals + index_tmp1 * 2);
                        edgesin = cross_v2v2(normal, state->normals + index_tmp1 * 2);
                        if (edgesin > 0.0f) {
-                           rotation += acosf(max_ff(-1.0f, min_ff(1.0f, edgecos)));
+                               rotation += acosf(max_ff(-1.0f, min_ff(1.0f, edgecos)));
                                rot_elem++;
                        }
                        else {
-                           rotation_neg += acosf(max_ff(-1.0f, min_ff(1.0f, edgecos)));
+                               rotation_neg += acosf(max_ff(-1.0f, min_ff(1.0f, edgecos)));
                                rot_elem_neg++;
                        }
                }
index 3139668..97dcc86 100644 (file)
@@ -211,8 +211,9 @@ bool gts_vertex_gaussian_curvature(WVertex *v, real *Kg)
        }
 
        WVertex::incoming_edge_iterator itE;
-       for (itE = v->incoming_edges_begin(); itE != v->incoming_edges_end(); itE++)
-                area += (*itE)->GetaFace()->getArea();
+       for (itE = v->incoming_edges_begin(); itE != v->incoming_edges_end(); itE++) {
+               area += (*itE)->GetaFace()->getArea();
+       }
 
        for (itE = v->incoming_edges_begin(); itE != v->incoming_edges_end(); itE++) {
                WOEdge *e = (*itE)->getPrevOnFace();
index d1102b0..56167d4 100644 (file)
@@ -247,8 +247,9 @@ static GPUBuffer *gpu_buffer_alloc_intern(int size, bool use_VBO)
                bufsize = pool->buffers[i]->size;
 
                /* only return a buffer that matches the VBO preference */
-                if (pool->buffers[i]->use_vbo != use_VBO)
+               if (pool->buffers[i]->use_vbo != use_VBO) {
                         continue;
+               }
                
                /* check for an exact size match */
                if (bufsize == size) {
@@ -653,8 +654,8 @@ static GPUBuffer *gpu_buffer_setup(DerivedMesh *dm, GPUDrawObject *object,
 
                        /* attempt to map the buffer */
                        if (!(varray = glMapBufferARB(target, GL_WRITE_ONLY_ARB))) {
-                                buffer = gpu_try_realloc(pool, buffer, size, true);
-                                
+                               buffer = gpu_try_realloc(pool, buffer, size, true);
+
                                /* allocation still failed; fall back
                                 * to legacy mode */
                                if (!buffer) {
index 41049e8..f8499ca 100644 (file)
@@ -2128,18 +2128,18 @@ GPUNodeLink *GPU_lamp_get_data(GPUMaterial *mat, GPULamp *lamp, GPUNodeLink **co
 
                if (lamp->la->shadowmap_type == LA_SHADMAP_VARIANCE) {
                        GPU_link(mat, "shadows_only_vsm",
-                                GPU_builtin(GPU_VIEW_POSITION),
-                                GPU_dynamic_texture(lamp->tex, GPU_DYNAMIC_SAMPLER_2DSHADOW, lamp->ob),
-                                GPU_dynamic_uniform((float*)lamp->dynpersmat, GPU_DYNAMIC_LAMP_DYNPERSMAT, lamp->ob),
-                                GPU_uniform(&lamp->bias), GPU_uniform(&lamp->la->bleedbias),
-                                GPU_uniform(lamp->shadow_color), inp, shadow);
+                                GPU_builtin(GPU_VIEW_POSITION),
+                                GPU_dynamic_texture(lamp->tex, GPU_DYNAMIC_SAMPLER_2DSHADOW, lamp->ob),
+                                GPU_dynamic_uniform((float*)lamp->dynpersmat, GPU_DYNAMIC_LAMP_DYNPERSMAT, lamp->ob),
+                                GPU_uniform(&lamp->bias), GPU_uniform(&lamp->la->bleedbias),
+                                GPU_uniform(lamp->shadow_color), inp, shadow);
                }
                else {
                        GPU_link(mat, "shadows_only",
-                                GPU_builtin(GPU_VIEW_POSITION),
-                                GPU_dynamic_texture(lamp->tex, GPU_DYNAMIC_SAMPLER_2DSHADOW, lamp->ob),
-                                GPU_dynamic_uniform((float*)lamp->dynpersmat, GPU_DYNAMIC_LAMP_DYNPERSMAT, lamp->ob),
-                                GPU_uniform(&lamp->bias), GPU_uniform(lamp->shadow_color), inp, shadow);
+                                GPU_builtin(GPU_VIEW_POSITION),
+                                GPU_dynamic_texture(lamp->tex, GPU_DYNAMIC_SAMPLER_2DSHADOW, lamp->ob),
+                                GPU_dynamic_uniform((float*)lamp->dynpersmat, GPU_DYNAMIC_LAMP_DYNPERSMAT, lamp->ob),
+                                GPU_uniform(&lamp->bias), GPU_uniform(lamp->shadow_color), inp, shadow);
                }
        }
        else {
index 59d0812..65abf22 100644 (file)
@@ -169,8 +169,8 @@ void IMB_buffer_byte_from_float(uchar *rect_to, const float *rect_from,
        float tmp[4];
        int x, y;
        DitherContext *di = NULL;
-       float inv_width = 1.0f / width,
-             inv_height = 1.0f / height;
+       float inv_width = 1.0f / width;
+       float inv_height = 1.0f / height;
 
        /* we need valid profiles */
        BLI_assert(profile_to != IB_PROFILE_NONE);
index 3fb047e..beffbc4 100644 (file)
@@ -188,7 +188,7 @@ typedef enum eGPdata_Flag {
        GP_DATA_EXPAND          = (1 << 2),
        
        /* is the block overriding all clicks? */
-       /* GP_DATA_EDITPAINT = (1 << 3), */
+       /* GP_DATA_EDITPAINT = (1 << 3), */
        
        /* new strokes are added in viewport space */
        GP_DATA_VIEWALIGN       = (1 << 4),
index 718a9dd..fea8b63 100644 (file)
@@ -682,14 +682,14 @@ void RNA_api_ui_layout(StructRNA *srna)
        
        func = RNA_def_function(srna, "template_modifier", "uiTemplateModifier");
        RNA_def_function_flag(func, FUNC_USE_CONTEXT);
-       RNA_def_function_ui_description(func, "Layout . Generates the UI layout for modifiers");
+       RNA_def_function_ui_description(func, "Generates the UI layout for modifiers");
        parm = RNA_def_pointer(func, "data", "Modifier", "", "Modifier data");
        RNA_def_property_flag(parm, PROP_REQUIRED | PROP_RNAPTR | PROP_NEVER_NULL);
        parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
        RNA_def_function_return(func, parm);
 
        func = RNA_def_function(srna, "template_constraint", "uiTemplateConstraint");
-       RNA_def_function_ui_description(func, "Layout . Generates the UI layout for constraints");
+       RNA_def_function_ui_description(func, "Generates the UI layout for constraints");
        parm = RNA_def_pointer(func, "data", "Constraint", "", "Constraint data");
        RNA_def_property_flag(parm, PROP_REQUIRED | PROP_RNAPTR | PROP_NEVER_NULL);
        parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
index 0c193df..cbc76e2 100644 (file)
@@ -814,22 +814,26 @@ void free_qtcomponentdata(void)
 void quicktime_verify_image_type(RenderData *rd, ImageFormatData *imf)
 {
        if (imf->imtype == R_IMF_IMTYPE_QUICKTIME) {
-               if ((rd->qtcodecsettings.codecType<= 0) ||
-                       (rd->qtcodecsettings.codecSpatialQuality <0) ||
-                       (rd->qtcodecsettings.codecSpatialQuality > 100)) {
-                       
+               if ((rd->qtcodecsettings.codecType <= 0) ||
+                   (rd->qtcodecsettings.codecSpatialQuality < 0) ||
+                   (rd->qtcodecsettings.codecSpatialQuality > 100))
+               {
                        rd->qtcodecsettings.codecType = kJPEGCodecType;
-                       rd->qtcodecsettings.codecSpatialQuality = (codecHighQuality*100)/codecLosslessQuality;
+                       rd->qtcodecsettings.codecSpatialQuality = (codecHighQuality * 100) / codecLosslessQuality;
                }
                if ((rd->qtcodecsettings.audioSampleRate < 21000) ||
-                       (rd->qtcodecsettings.audioSampleRate > 193000)) 
+                   (rd->qtcodecsettings.audioSampleRate > 193000))
+               {
                        rd->qtcodecsettings.audioSampleRate = 48000;
+               }
                
-               if (rd->qtcodecsettings.audioBitDepth == 0)
+               if (rd->qtcodecsettings.audioBitDepth == 0) {
                        rd->qtcodecsettings.audioBitDepth = AUD_FORMAT_S16;
+               }
                
-               if (rd->qtcodecsettings.audioBitRate == 0)
+               if (rd->qtcodecsettings.audioBitRate == 0) {
                        rd->qtcodecsettings.audioBitRate = 256000;
+               }
        }
 }
 
index 1e30e05..21ca792 100644 (file)
@@ -718,10 +718,10 @@ static void render_result_rescale(Render *re)
                        scale_y = (float) result->recty / re->result->recty;
                        for (x = 0; x < re->result->rectx; ++x) {
                                for (y = 0; y < re->result->recty; ++y) {
-                                       int src_x = x * scale_x,
-                                           src_y = y * scale_y;
-                                       int dst_index = y * re->result->rectx + x,
-                                           src_index = src_y * result->rectx + src_x;
+                                       int src_x = x * scale_x;
+                                       int src_y = y * scale_y;
+                                       int dst_index = y * re->result->rectx + x;
+                                       int src_index = src_y * result->rectx + src_x;
                                        copy_v4_v4(dst_rectf + dst_index * 4,
                                                   src_rectf + src_index * 4);
                                }
index 8774abe..4afa181 100644 (file)
@@ -138,7 +138,7 @@ bool KX_MouseActuator::Update()
                                        center_x = ((m_canvas->GetWidth() - 1.0) / 2.0) / (m_canvas->GetWidth());
                                }
                                if ((m_canvas->GetHeight() % 2) != 0) {
-                                   center_y = ((m_canvas->GetHeight() - 1.0) / 2.0) / (m_canvas->GetHeight());
+                                       center_y = ((m_canvas->GetHeight() - 1.0) / 2.0) / (m_canvas->GetHeight());
                                }
 
                                //preventing initial skipping.