From 1c29fd77d31318fae9d72c5560bfdf0aa742cc3d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 26 Jan 2014 22:17:01 +1100 Subject: Code Cleanup: style and correct API class ref --- doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst | 4 ++-- doc/python_api/rst/bge_types/bge.types.KX_MeshProxy.rst | 2 +- source/blender/blenkernel/intern/object_dupli.c | 6 ++---- source/blender/bmesh/tools/bmesh_bevel.c | 6 +++--- .../operations/COM_ScreenLensDistortionOperation.cpp | 14 +++++++------- source/blender/editors/object/object_vgroup.c | 2 +- source/blender/modifiers/intern/MOD_bevel.c | 2 +- 7 files changed, 17 insertions(+), 19 deletions(-) diff --git a/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst b/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst index af4852d6ab1..a4c02ee6fec 100644 --- a/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst +++ b/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst @@ -720,8 +720,8 @@ base class --- :class:`SCA_IObject` :rtype: * 3-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz)) - * or 4-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz), :class:`PolyProxy`) - * or 5-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz), :class:`PolyProxy`, 2-tuple (u, v)) + * or 4-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz), :class:`KX_PolyProxy`) + * or 5-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz), :class:`KX_PolyProxy`, 2-tuple (u, v)) .. note:: diff --git a/doc/python_api/rst/bge_types/bge.types.KX_MeshProxy.rst b/doc/python_api/rst/bge_types/bge.types.KX_MeshProxy.rst index 2ec8b8ece5c..9ef8d6b2026 100644 --- a/doc/python_api/rst/bge_types/bge.types.KX_MeshProxy.rst +++ b/doc/python_api/rst/bge_types/bge.types.KX_MeshProxy.rst @@ -108,7 +108,7 @@ base class --- :class:`SCA_IObject` :arg index: polygon number :type index: integer :return: a polygon object. - :rtype: :class:`PolyProxy` + :rtype: :class:`KX_PolyProxy` .. method:: transform(matid, matrix) diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c index 0671c8ea171..0874d34b25d 100644 --- a/source/blender/blenkernel/intern/object_dupli.c +++ b/source/blender/blenkernel/intern/object_dupli.c @@ -170,7 +170,7 @@ static DupliObject *make_dupli(const DupliContext *ctx, * dupli object between frames, which is needed for motion blur. last level * goes first in the array. */ dob->persistent_id[0] = index; - for (i = 1; i < ctx->level+1; i++) + for (i = 1; i < ctx->level + 1; i++) dob->persistent_id[i] = ctx->persistent_id[ctx->level - i]; /* fill rest of values with INT_MAX which index will never have as value */ for (; i < MAX_DUPLI_RECUR; i++) @@ -367,8 +367,6 @@ static void make_duplis_frames(const DupliContext *ctx) } if (ok) { - DupliObject *dob; - /* WARNING: doing animation updates in this way is not terribly accurate, as the dependencies * and/or other objects which may affect this object's transforms are not updated either. * However, this has always been the way that this worked (i.e. pre 2.5), so I guess that it'll be fine! @@ -376,7 +374,7 @@ static void make_duplis_frames(const DupliContext *ctx) BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, (float)scene->r.cfra, ADT_RECALC_ANIM); /* ob-eval will do drivers, so we don't need to do them */ BKE_object_where_is_calc_time(scene, ob, (float)scene->r.cfra); - dob = make_dupli(ctx, ob, ob->obmat, scene->r.cfra, false, false); + make_dupli(ctx, ob, ob->obmat, scene->r.cfra, false, false); } } diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c index 1071f2522ca..612740baa94 100644 --- a/source/blender/bmesh/tools/bmesh_bevel.c +++ b/source/blender/bmesh/tools/bmesh_bevel.c @@ -1122,7 +1122,7 @@ static void superellipse_co(float u, float r, float r_co[2]) if (u <= 0.0f) { r_co[0] = 0.0f; r_co[1] = 1.0f; - } + } else if (u >= 2.0f) { r_co[0] = 1.0f; r_co[1] = 0.0f; @@ -3118,7 +3118,7 @@ static void build_vmesh(BevelParams *bp, BMesh *bm, BevVert *bv) copy_v3_v3(co, vb); } else if (weld2->profile.super_r == PRO_LINE_R && - weld1->profile.super_r != PRO_LINE_R) + weld1->profile.super_r != PRO_LINE_R) { copy_v3_v3(co, va); } @@ -3677,7 +3677,7 @@ static void find_even_superellipse_params(int n, float r, float *r_params) /* n is odd, so get one corner-cut chord. * Solve u == sqrt(2*(1-n2*u)^2) where n2 = floor(n/2) */ n2 = n / 2; - u = (2.0f * n2 - M_SQRT2) / (2.0f * n2 * n2 - 1); + u = (2.0f * n2 - (float)M_SQRT2) / (2.0f * n2 * n2 - 1.0f); for (i = 0; i < n; i++) r_params[i] = i * u; r_params[n] = umax; diff --git a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp index 035789e09e6..ad9b761da45 100644 --- a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp +++ b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp @@ -195,17 +195,17 @@ void ScreenLensDistortionOperation::deinitExecution() void ScreenLensDistortionOperation::determineUV(float result[6], float x, float y) const { - float xy[2] = { x, y }; + const float xy[2] = {x, y}; float uv[2]; get_uv(xy, uv); float uv_dot = len_squared_v2(uv); - copy_v2_v2(result+0, xy); - copy_v2_v2(result+2, xy); - copy_v2_v2(result+4, xy); - get_delta(uv_dot, m_k4[0], uv, result+0); - get_delta(uv_dot, m_k4[1], uv, result+2); - get_delta(uv_dot, m_k4[2], uv, result+4); + copy_v2_v2(result + 0, xy); + copy_v2_v2(result + 2, xy); + copy_v2_v2(result + 4, xy); + get_delta(uv_dot, m_k4[0], uv, result + 0); + get_delta(uv_dot, m_k4[1], uv, result + 2); + get_delta(uv_dot, m_k4[2], uv, result + 4); } bool ScreenLensDistortionOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 04efacdb89d..a14a4213d92 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -909,7 +909,7 @@ static bool ed_vgroup_transfer_weight(Object *ob_dst, Object *ob_src, bDeformGro } /* Get meshes.*/ - dmesh_src = mesh_get_derived_final(scene, ob_src, CD_MASK_BAREMESH|CD_MASK_MDEFORMVERT); + dmesh_src = mesh_get_derived_final(scene, ob_src, CD_MASK_BAREMESH | CD_MASK_MDEFORMVERT); me_dst = ob_dst->data; /* Get vertex group array from source mesh */ diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c index 4d05e4fe50f..2a6c594c5b9 100644 --- a/source/blender/modifiers/intern/MOD_bevel.c +++ b/source/blender/modifiers/intern/MOD_bevel.c @@ -116,7 +116,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *ob, bm = DM_to_bmesh(dm, true); if ((bmd->lim_flags & MOD_BEVEL_VGROUP) && bmd->defgrp_name[0]) - modifier_get_vgroup(ob, dm, bmd->defgrp_name, &dvert, &vgroup); + modifier_get_vgroup(ob, dm, bmd->defgrp_name, &dvert, &vgroup); if (vertex_only) { BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { -- cgit v1.2.3