diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-13 03:19:52 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-13 03:19:52 +0400 |
commit | 1a625d1416e5caaaa21a2dcc1fb00e66a1911758 (patch) | |
tree | 5ccb34b18d0444d5011a6140e478a577359b6733 /source/blender/editors | |
parent | b0038ae4996993f1dd808babe402e2e390933330 (diff) |
code cleanup: use const float's where possible and specify vector size.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mesh/editmesh_bvh.c | 4 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_bvh.h | 4 | ||||
-rw-r--r-- | source/blender/editors/mesh/meshtools.c | 3 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_manipulator.c | 2 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_parametrizer.c | 4 |
5 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/editors/mesh/editmesh_bvh.c b/source/blender/editors/mesh/editmesh_bvh.c index c5f8494836b..2cb03104874 100644 --- a/source/blender/editors/mesh/editmesh_bvh.c +++ b/source/blender/editors/mesh/editmesh_bvh.c @@ -308,7 +308,7 @@ static void vertsearchcallback(void *userdata, int index, const float *UNUSED(co } } -BMVert *BMBVH_FindClosestVert(BMBVHTree *tree, float *co, float maxdist) +BMVert *BMBVH_FindClosestVert(BMBVHTree *tree, const float co[3], float maxdist) { BVHTreeNearest hit; @@ -370,7 +370,7 @@ int BMBVH_VertVisible(BMBVHTree *tree, BMEdge *e, RegionView3D *r3d) } #endif -static BMFace *edge_ray_cast(BMBVHTree *tree, float *co, float *dir, float *hitout, BMEdge *e) +static BMFace *edge_ray_cast(BMBVHTree *tree, const float co[3], const float dir[3], float *hitout, BMEdge *e) { BMFace *f = BMBVH_RayCast(tree, co, dir, hitout, NULL); diff --git a/source/blender/editors/mesh/editmesh_bvh.h b/source/blender/editors/mesh/editmesh_bvh.h index 6512f054c1b..53d1c36119e 100644 --- a/source/blender/editors/mesh/editmesh_bvh.h +++ b/source/blender/editors/mesh/editmesh_bvh.h @@ -57,8 +57,8 @@ int BMBVH_EdgeVisible(struct BMBVHTree *tree, struct BMEdge *e, struct ARegion *ar, struct View3D *v3d, struct Object *obedit); /*find a vert closest to co in a sphere of radius maxdist*/ -struct BMVert *BMBVH_FindClosestVert(struct BMBVHTree *tree, float *co, float maxdist); - +struct BMVert *BMBVH_FindClosestVert(struct BMBVHTree *tree, const float co[3], const float maxdist); + /* BMBVH_NewBVH flag parameter */ enum { BMBVH_USE_CAGE = 1, /* project geometry onto modifier cage */ diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 989f1a36f99..59a0475ebb5 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -690,7 +690,8 @@ static void mesh_octree_free_node(MocNode **bt) /* temporal define, just to make nicer code below */ #define MOC_INDEX(vx, vy, vz) (((vx) * MOC_RES * MOC_RES) + (vy) * MOC_RES + (vz)) -static void mesh_octree_add_nodes(MocNode **basetable, float *co, float *offs, float *div, intptr_t index) +static void mesh_octree_add_nodes(MocNode **basetable, const float co[3], const float offs[3], + const float div[3], intptr_t index) { float fx, fy, fz; int vx, vy, vz; diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index e02ad00ac7f..b3ccf004810 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -108,7 +108,7 @@ #define MAN_MOVECOL 2 /* transform widget center calc helper for below */ -static void calc_tw_center(Scene *scene, float *co) +static void calc_tw_center(Scene *scene, const float co[3]) { float *twcent = scene->twcent; float *min = scene->twmin; diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index 16cd95a2f70..87ff36ebf27 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -706,7 +706,7 @@ static void p_face_restore_uvs(PFace *f) /* Construction (use only during construction, relies on u.key being set */ -static PVert *p_vert_add(PHandle *handle, PHashKey key, float *co, PEdge *e) +static PVert *p_vert_add(PHandle *handle, PHashKey key, const float co[3], PEdge *e) { PVert *v = (PVert *)BLI_memarena_alloc(handle->arena, sizeof *v); copy_v3_v3(v->co, co); @@ -719,7 +719,7 @@ static PVert *p_vert_add(PHandle *handle, PHashKey key, float *co, PEdge *e) return v; } -static PVert *p_vert_lookup(PHandle *handle, PHashKey key, float *co, PEdge *e) +static PVert *p_vert_lookup(PHandle *handle, PHashKey key, const float co[3], PEdge *e) { PVert *v = (PVert *)phash_lookup(handle->hash_verts, key); |