diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-02-11 10:38:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-02-11 10:39:28 +0300 |
commit | d4934f8f6d8d2da457adb6dd32047eb1627459a0 (patch) | |
tree | 246012077cd959563ca372767c319dbbc3345f50 | |
parent | 387d91829d787ac96afbb2b3f86899e0e3346222 (diff) |
cleanup: style/indentation
23 files changed, 67 insertions, 59 deletions
diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index 491fb46bd1f..73f75f4f96d 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -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); diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 11a6cb7acc3..6157d63047e 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -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. */ diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 941344cf21e..06d0627fd2c 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -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); diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c index f002ea54b32..5febf720b30 100644 --- a/source/blender/blenlib/intern/noise.c +++ b/source/blender/blenlib/intern/noise.c @@ -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); } diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c index b25572ed8e2..a418ade6cc1 100644 --- a/source/blender/bmesh/tools/bmesh_bevel.c +++ b/source/blender/bmesh/tools/bmesh_bevel.c @@ -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) diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.cpp b/source/blender/compositor/intern/COM_MemoryBuffer.cpp index 37035c50d2c..9e6e5a423f9 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.cpp +++ b/source/blender/compositor/intern/COM_MemoryBuffer.cpp @@ -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; + } } } diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 16b74c3bddd..512784437d6 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -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; diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index dee216d9c73..00d79b22e99 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -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; diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index b04f1d3e738..8fcd91b7791 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -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 diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index f338fa160f5..deb6c7b4ab2 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -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 */ diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 5ce3517696e..f3c6781b0fa 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -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 diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index abc82775c8d..c956d77d64a 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -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; } } } diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 2cf8031e439..92103c3b29f 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -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 */ diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index 4cb1f8943f9..f7a8735ccca 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -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++; } } diff --git a/source/blender/freestyle/intern/winged_edge/Curvature.cpp b/source/blender/freestyle/intern/winged_edge/Curvature.cpp index 31396688422..97dcc86cf31 100644 --- a/source/blender/freestyle/intern/winged_edge/Curvature.cpp +++ b/source/blender/freestyle/intern/winged_edge/Curvature.cpp @@ -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(); diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index d1102b03e9a..56167d466f1 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -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) { diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 41049e8430a..f8499ca2d34 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -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 { diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c index 59d08128e5f..65abf22ff2c 100644 --- a/source/blender/imbuf/intern/divers.c +++ b/source/blender/imbuf/intern/divers.c @@ -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); diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index 3fb047ebbe7..beffbc4c017 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -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), diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 718a9dd7c6e..fea8b630af6 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -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"); diff --git a/source/blender/quicktime/apple/qtkit_export.m b/source/blender/quicktime/apple/qtkit_export.m index 0c193df3861..cbc76e26aa9 100644 --- a/source/blender/quicktime/apple/qtkit_export.m +++ b/source/blender/quicktime/apple/qtkit_export.m @@ -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; + } } } diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 1e30e05fe1a..21ca7924fa0 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -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); } diff --git a/source/gameengine/Ketsji/KX_MouseActuator.cpp b/source/gameengine/Ketsji/KX_MouseActuator.cpp index 8774abe04b2..4afa1818536 100644 --- a/source/gameengine/Ketsji/KX_MouseActuator.cpp +++ b/source/gameengine/Ketsji/KX_MouseActuator.cpp @@ -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. |