[Bf-blender-cvs] [e5e73cc] master: Math Lib: rename fill_*, to copy_*
Campbell Barton
noreply at git.blender.org
Tue May 5 09:09:41 CEST 2015
Commit: e5e73ccc901e478e85e312579dd2bc63dfae0292
Author: Campbell Barton
Date: Tue May 5 17:08:29 2015 +1000
Branches: master
https://developer.blender.org/rBe5e73ccc901e478e85e312579dd2bc63dfae0292
Math Lib: rename fill_*, to copy_*
matching convention for fixed length api, eg: copy_v3_fl
===================================================================
M source/blender/blenkernel/intern/DerivedMesh.c
M source/blender/blenkernel/intern/customdata.c
M source/blender/blenkernel/intern/deform.c
M source/blender/blenkernel/intern/editderivedmesh.c
M source/blender/blenkernel/intern/mesh_remap.c
M source/blender/blenlib/BLI_math_vector.h
M source/blender/blenlib/intern/astar.c
M source/blender/blenlib/intern/math_interp.c
M source/blender/blenlib/intern/math_vector.c
M source/blender/blenloader/intern/versioning_260.c
M source/blender/bmesh/intern/bmesh_interp.c
M source/blender/bmesh/tools/bmesh_decimate_dissolve.c
M source/blender/bmesh/tools/bmesh_path.c
M source/blender/editors/sculpt_paint/paint_vertex_proj.c
M source/blender/editors/space_view3d/view3d_buttons.c
M source/blender/editors/transform/transform.c
M source/blender/editors/transform/transform_conversions.c
M source/blender/editors/util/numinput.c
M source/blender/editors/uvedit/uvedit_ops.c
M source/blender/imbuf/intern/tiff.c
M source/blender/makesrna/intern/rna_object.c
M source/blender/modifiers/intern/MOD_array.c
M source/blender/modifiers/intern/MOD_correctivesmooth.c
M source/blender/modifiers/intern/MOD_skin.c
M source/blender/modifiers/intern/MOD_solidify.c
M source/blender/python/mathutils/mathutils_Matrix.c
M source/blender/python/mathutils/mathutils_Vector.c
===================================================================
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 38ae046..411de80 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -295,11 +295,11 @@ void DM_init(DerivedMesh *dm, DerivedMeshType type, int numVerts, int numEdges,
dm->dirty = 0;
/* don't use CustomData_reset(...); because we dont want to touch customdata */
- fill_vn_i(dm->vertData.typemap, CD_NUMTYPES, -1);
- fill_vn_i(dm->edgeData.typemap, CD_NUMTYPES, -1);
- fill_vn_i(dm->faceData.typemap, CD_NUMTYPES, -1);
- fill_vn_i(dm->loopData.typemap, CD_NUMTYPES, -1);
- fill_vn_i(dm->polyData.typemap, CD_NUMTYPES, -1);
+ copy_vn_i(dm->vertData.typemap, CD_NUMTYPES, -1);
+ copy_vn_i(dm->edgeData.typemap, CD_NUMTYPES, -1);
+ copy_vn_i(dm->faceData.typemap, CD_NUMTYPES, -1);
+ copy_vn_i(dm->loopData.typemap, CD_NUMTYPES, -1);
+ copy_vn_i(dm->polyData.typemap, CD_NUMTYPES, -1);
}
void DM_from_template(DerivedMesh *dm, DerivedMesh *source, DerivedMeshType type,
@@ -1276,7 +1276,7 @@ static void calc_weightpaint_vert_array(Object *ob, DerivedMesh *dm, int const d
else {
weightpaint_color(col, dm_wcinfo, 0.0f);
}
- fill_vn_i((int *)r_wtcol_v, numVerts, *((int *)col));
+ copy_vn_i((int *)r_wtcol_v, numVerts, *((int *)col));
}
}
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index add6bb0..eced263 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -1091,7 +1091,7 @@ static void layerDefault_mcol(void *data, int count)
static void layerDefault_origindex(void *data, int count)
{
- fill_vn_i((int *)data, count, ORIGINDEX_NONE);
+ copy_vn_i((int *)data, count, ORIGINDEX_NONE);
}
static void layerInterp_bweight(
@@ -1542,7 +1542,7 @@ static void CustomData_external_free(CustomData *data)
void CustomData_reset(CustomData *data)
{
memset(data, 0, sizeof(*data));
- fill_vn_i(data->typemap, CD_NUMTYPES, -1);
+ copy_vn_i(data->typemap, CD_NUMTYPES, -1);
}
void CustomData_free(CustomData *data, int totelem)
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c
index 72133cf..88885da 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -982,7 +982,7 @@ void BKE_defvert_extract_vgroup_to_vertweights(
}
}
else {
- fill_vn_fl(r_weights, num_verts, invert_vgroup ? 1.0f : 0.0f);
+ copy_vn_fl(r_weights, num_verts, invert_vgroup ? 1.0f : 0.0f);
}
}
@@ -1008,7 +1008,7 @@ void BKE_defvert_extract_vgroup_to_edgeweights(
MEM_freeN(tmp_weights);
}
else {
- fill_vn_fl(r_weights, num_edges, 0.0f);
+ copy_vn_fl(r_weights, num_edges, 0.0f);
}
}
@@ -1031,7 +1031,7 @@ void BKE_defvert_extract_vgroup_to_loopweights(
MEM_freeN(tmp_weights);
}
else {
- fill_vn_fl(r_weights, num_loops, 0.0f);
+ copy_vn_fl(r_weights, num_loops, 0.0f);
}
}
@@ -1060,7 +1060,7 @@ void BKE_defvert_extract_vgroup_to_polyweights(
MEM_freeN(tmp_weights);
}
else {
- fill_vn_fl(r_weights, num_polys, 0.0f);
+ copy_vn_fl(r_weights, num_polys, 0.0f);
}
}
diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c
index 40f3022..5230634 100644
--- a/source/blender/blenkernel/intern/editderivedmesh.c
+++ b/source/blender/blenkernel/intern/editderivedmesh.c
@@ -1968,7 +1968,7 @@ static void statvis_calc_thickness(
BLI_assert(min <= max);
- fill_vn_fl(face_dists, em->bm->totface, max);
+ copy_vn_fl(face_dists, em->bm->totface, max);
if (use_jit) {
int j;
@@ -2223,7 +2223,7 @@ static void statvis_calc_sharp(
(void)vertexCos; /* TODO */
- fill_vn_fl(vert_angles, em->bm->totvert, -M_PI);
+ copy_vn_fl(vert_angles, em->bm->totvert, -M_PI);
/* first assign float values to verts */
BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
diff --git a/source/blender/blenkernel/intern/mesh_remap.c b/source/blender/blenkernel/intern/mesh_remap.c
index f3e2f39..36b8a32 100644
--- a/source/blender/blenkernel/intern/mesh_remap.c
+++ b/source/blender/blenkernel/intern/mesh_remap.c
@@ -707,7 +707,7 @@ void BKE_mesh_remap_calc_edges_from_dm(
BLI_space_transform_apply_normal(space_transform, v2_no);
}
- fill_vn_fl(weights, (int)numedges_src, 0.0f);
+ copy_vn_fl(weights, (int)numedges_src, 0.0f);
/* We adjust our ray-casting grid to ray_radius (the smaller, the more rays are cast),
* with lower/upper bounds. */
@@ -1916,7 +1916,7 @@ void BKE_mesh_remap_calc_polys_from_dm(
BLI_space_transform_apply_normal(space_transform, tmp_no);
}
- fill_vn_fl(weights, (int)numpolys_src, 0.0f);
+ copy_vn_fl(weights, (int)numpolys_src, 0.0f);
if (UNLIKELY((size_t)mp->totloop > tmp_poly_size)) {
tmp_poly_size = (size_t)mp->totloop;
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index 82a2b9c..04c2baa 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -308,7 +308,7 @@ void dist_ensure_v2_v2fl(float v1[2], const float v2[2], const float dist);
void axis_sort_v3(const float axis_values[3], int r_axis_order[3]);
/***************************** Array Functions *******************************/
-/* attempted to follow fixed length vertex functions. names could be improved*/
+/* follow fixed length vector function conventions. */
double dot_vn_vn(const float *array_src_a, const float *array_src_b, const int size) ATTR_WARN_UNUSED_RESULT;
double len_squared_vn(const float *array, const int size) ATTR_WARN_UNUSED_RESULT;
float normalize_vn_vn(float *array_tar, const float *array_src, const int size);
@@ -329,11 +329,11 @@ void sub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_
void msub_vn_vn(float *array_tar, const float *array_src, const float f, const int size);
void msub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, const float f, const int size);
void interp_vn_vn(float *array_tar, const float *array_src, const float t, const int size);
-void fill_vn_i(int *array_tar, const int size, const int val);
-void fill_vn_short(short *array_tar, const int size, const short val);
-void fill_vn_ushort(unsigned short *array_tar, const int size, const unsigned short val);
-void fill_vn_uchar(unsigned char *array_tar, const int size, const unsigned char val);
-void fill_vn_fl(float *array_tar, const int size, const float val);
+void copy_vn_i(int *array_tar, const int size, const int val);
+void copy_vn_short(short *array_tar, const int size, const short val);
+void copy_vn_ushort(unsigned short *array_tar, const int size, const unsigned short val);
+void copy_vn_uchar(unsigned char *array_tar, const int size, const unsigned char val);
+void copy_vn_fl(float *array_tar, const int size, const float val);
/**************************** Inline Definitions ******************************/
diff --git a/source/blender/blenlib/intern/astar.c b/source/blender/blenlib/intern/astar.c
index b7b41d2..311d6dd 100644
--- a/source/blender/blenlib/intern/astar.c
+++ b/source/blender/blenlib/intern/astar.c
@@ -229,7 +229,7 @@ bool BLI_astar_graph_solve(
r_solution->steps = 0;
prev_nodes[node_index_src] = -1;
BLI_BITMAP_SET_ALL(done_nodes, false, as_graph->node_num);
- fill_vn_fl(g_costs, as_graph->node_num, FLT_MAX);
+ copy_vn_fl(g_costs, as_graph->node_num, FLT_MAX);
g_costs[node_index_src] = 0.0f;
g_steps[node_index_src] = 0;
diff --git a/source/blender/blenlib/intern/math_interp.c b/source/blender/blenlib/intern/math_interp.c
index 6785046..b45d8b4 100644
--- a/source/blender/blenlib/intern/math_interp.c
+++ b/source/blender/blenlib/intern/math_interp.c
@@ -112,10 +112,10 @@ BLI_INLINE void bicubic_interpolation(const unsigned char *byte_buffer, const fl
/* sample area entirely outside image? */
if (ceil(u) < 0 || floor(u) > width - 1 || ceil(v) < 0 || floor(v) > height - 1) {
if (float_output) {
- fill_vn_fl(float_output, components, 0.0f);
+ copy_vn_fl(float_output, components, 0.0f);
}
if (byte_output) {
- fill_vn_uchar(byte_output, components, 0);
+ copy_vn_uchar(byte_output, components, 0);
}
return;
}
@@ -281,7 +281,7 @@ BLI_INLINE void bilinear_interpolation(const unsigned char *byte_buffer, const f
/* sample area entirely outside image? */
if (x2 < 0 || x1 > width - 1 || y2 < 0 || y1 > height - 1) {
- fill_vn_fl(float_output, components, 0.0f);
+ copy_vn_fl(float_output, components, 0.0f);
return;
}
@@ -323,7 +323,7 @@ BLI_INLINE void bilinear_interpolation(const unsigned char *byte_buffer, const f
/* sample area entirely outside image? */
if (x2 < 0 || x1 > width - 1 || y2 < 0 || y1 > height - 1) {
- fill_vn_uchar(byte_output, components, 0);
+ copy_vn_uchar(byte_output, components, 0);
return;
}
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c
index 8f536bf..88eccd6 100644
--- a/source/blender/blenlib/intern/math_vector.c
+++ b/source/blender/blenlib/intern/math_vector.c
@@ -876,7 +876,7 @@ float normalize_vn_vn(float *array_tar, const float *array_src, const int size)
mul_vn_vn_fl(array_tar, array_src, size, 1.0f / d_sqrt);
}
else {
- fill_vn_fl(array_tar, size, 0.0f);
+ copy_vn_fl(array_tar, size, 0.0f);
d_sqrt = 0.0f;
}
return d_sqrt;
@@ -1051,7 +1051,7 @@ void interp_vn_vn(float *array_tar, const float *array_src, const float t, const
}
}
-void fill_vn_i(int *array_tar, const int size, const int val)
+void copy_vn_i(int *array_tar, const int size, const int val)
{
int *tar = array_tar + (size - 1);
int i = size;
@@ -1060,7 +1060,7 @@ void fill_vn_i(int *array_tar, const int size, const int val)
}
}
-void fill_vn_short(short *array_tar, const int size, const short val)
+void copy_vn_short(short *array_tar, const int size, const short val)
{
short *tar = array_tar + (size - 1);
int i = size;
@@ -1069,7 +1069,7 @@ void fill_vn_short(short *array_tar, const int size, const short val)
}
}
-void fill_vn_ushort(uns
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list