Math Lib: rename fill_*, to copy_*
authorCampbell Barton <ideasman42@gmail.com>
Tue, 5 May 2015 07:08:29 +0000 (17:08 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 5 May 2015 07:08:29 +0000 (17:08 +1000)
matching convention for fixed length api, eg: copy_v3_fl

27 files changed:
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/deform.c
source/blender/blenkernel/intern/editderivedmesh.c
source/blender/blenkernel/intern/mesh_remap.c
source/blender/blenlib/BLI_math_vector.h
source/blender/blenlib/intern/astar.c
source/blender/blenlib/intern/math_interp.c
source/blender/blenlib/intern/math_vector.c
source/blender/blenloader/intern/versioning_260.c
source/blender/bmesh/intern/bmesh_interp.c
source/blender/bmesh/tools/bmesh_decimate_dissolve.c
source/blender/bmesh/tools/bmesh_path.c
source/blender/editors/sculpt_paint/paint_vertex_proj.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/util/numinput.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/imbuf/intern/tiff.c
source/blender/makesrna/intern/rna_object.c
source/blender/modifiers/intern/MOD_array.c
source/blender/modifiers/intern/MOD_correctivesmooth.c
source/blender/modifiers/intern/MOD_skin.c
source/blender/modifiers/intern/MOD_solidify.c
source/blender/python/mathutils/mathutils_Matrix.c
source/blender/python/mathutils/mathutils_Vector.c

index 38ae0461c84286524e056f7d16e088dd67aa3e97..411de80ddbca9b65b7b00925e9b6f7ac74c54477 100644 (file)
@@ -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));
        }
 }
 
index add6bb0fd0ba8bd2a48e9f908064411c5b41468b..eced263d493f2d0ef20674110ae12d5b03c3514a 100644 (file)
@@ -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)
index 72133cf6460624322bb1e023e1fd9aeb6acc3506..88885da474bbddc2095610d1876d7099d4614401 100644 (file)
@@ -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);
        }
 }
 
index 40f3022c1926bc49f09dd20ede70f49042a29ef3..5230634fe4c293418fa8017c0bf2207345f45400 100644 (file)
@@ -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) {
index f3e2f39500251243c63347b5808fd1025c5c5836..36b8a3264e9f896f40c46de81aa9ce3be6f52a1a 100644 (file)
@@ -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;
index 82a2b9c9ab20dc74a7263e756b1837643d85a048..04c2baa5359bf9b6bf16392eb4e57b65e2c0d3bf 100644 (file)
@@ -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 ******************************/
 
index b7b41d2497eee04a1a2f5559479bec61c8370e86..311d6dd89ae0a6a23ef1f0029d2018f0e25a3a6f 100644 (file)
@@ -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;
 
index 67850463fe212874b5350b488c2c8954b10dc779..b45d8b4c13b25149e8d681c2a6e98bc12068931b 100644 (file)
@@ -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;
                }
 
index 8f536bfe75c20a0c3d9190d90f83e4272d07c04f..88eccd6035218aa1334eaf897f183b30295cb2c0 100644 (file)
@@ -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(unsigned short *array_tar, const int size, const unsigned short val)
+void copy_vn_ushort(unsigned short *array_tar, const int size, const unsigned short val)
 {
        unsigned short *tar = array_tar + (size - 1);
        int i = size;
@@ -1078,7 +1078,7 @@ void fill_vn_ushort(unsigned short *array_tar, const int size, const unsigned sh
        }
 }
 
-void fill_vn_uchar(unsigned char *array_tar, const int size, const unsigned char val)
+void copy_vn_uchar(unsigned char *array_tar, const int size, const unsigned char val)
 {
        unsigned char *tar = array_tar + (size - 1);
        int i = size;
@@ -1087,7 +1087,7 @@ void fill_vn_uchar(unsigned char *array_tar, const int size, const unsigned char
        }
 }
 
-void fill_vn_fl(float *array_tar, const int size, const float val)
+void copy_vn_fl(float *array_tar, const int size, const float val)
 {
        float *tar = array_tar + (size - 1);
        int i = size;
index 734dc33ea24dc38ae514799f70c4a1fe8f577871..72a320281fe97c108dd3e9087a75ba7021848200 100644 (file)
@@ -845,7 +845,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
                Object *ob;
                for (ob = main->object.first; ob; ob = ob->id.next) {
                        if (is_zero_v3(ob->dscale)) {
-                               fill_vn_fl(ob->dscale, 3, 1.0f);
+                               copy_vn_fl(ob->dscale, 3, 1.0f);
                        }
                }
        }
index 169af6f62c3c8d25a77ef712ac8593629c358d17..30ac76ab7e1f084f1fb983776d6315804bad99f8 100644 (file)
@@ -1057,7 +1057,7 @@ LinkNode *BM_vert_loop_groups_data_layer_create(
                                mul_vn_fl(lf->data_weights, lf->data_len, 1.0f / lwc.weight_accum);
                        }
                        else {
-                               fill_vn_fl(lf->data_weights, lf->data_len, 1.0f / (float)lf->data_len);
+                               copy_vn_fl(lf->data_weights, lf->data_len, 1.0f / (float)lf->data_len);
                        }
 
                        BLI_linklist_prepend_arena(&groups, lf, lwc.arena);
index 09c7b932b7a13a1756ed7df7bf0a880b49430f68..6d3b738a462b0672b85bb85e20cb34fa954acea0 100644 (file)
@@ -190,7 +190,7 @@ void BM_mesh_decimate_dissolve_ex(
                /* prepare for cleanup */
                BM_mesh_elem_index_ensure(bm, BM_VERT);
                vert_reverse_lookup = MEM_mallocN(sizeof(int) * bm->totvert, __func__);
-               fill_vn_i(vert_reverse_lookup, bm->totvert, -1);
+               copy_vn_i(vert_reverse_lookup, bm->totvert, -1);
                for (i = 0; i < vinput_len; i++) {
                        BMVert *v = vinput_arr[i];
                        vert_reverse_lookup[BM_elem_index_get(v)] = i;
index 8ae3507a738b8520a0c2bf5b122c3e841bd8cf72..6633803414b9369af2345af4022b9db818a34294 100644 (file)
@@ -126,7 +126,7 @@ LinkNode *BM_mesh_calc_path_vert(
        verts_prev = MEM_callocN(sizeof(*verts_prev) * totvert, __func__);
        cost = MEM_mallocN(sizeof(*cost) * totvert, __func__);
 
-       fill_vn_fl(cost, totvert, 1e20f);
+       copy_vn_fl(cost, totvert, 1e20f);
 
        /*
         * Arrays are now filled as follows:
@@ -252,7 +252,7 @@ LinkNode *BM_mesh_calc_path_edge(
        edges_prev = MEM_callocN(sizeof(*edges_prev) * totedge, "SeamPathPrevious");
        cost = MEM_mallocN(sizeof(*cost) * totedge, "SeamPathCost");
 
-       fill_vn_fl(cost, totedge, 1e20f);
+       copy_vn_fl(cost, totedge, 1e20f);
 
        /*
         * Arrays are now filled as follows:
@@ -378,7 +378,7 @@ LinkNode *BM_mesh_calc_path_face(
        faces_prev = MEM_callocN(sizeof(*faces_prev) * totface, __func__);
        cost = MEM_mallocN(sizeof(*cost) * totface, __func__);
 
-       fill_vn_fl(cost, totface, 1e20f);
+       copy_vn_fl(cost, totface, 1e20f);
 
        /*
         * Arrays are now filled as follows:
index ae729248f7e7c6a8d3f844dc677abae6a7ad4dc2..c939eb6df35ed7a17c1ef5c8e5b19ba0ab532623 100644 (file)
@@ -186,7 +186,7 @@ static void vpaint_proj_dm_map_cosnos_update(struct VertProjHandle *vp_handle,
 
        /* highly unlikely this will become unavailable once painting starts (perhaps with animated modifiers) */
        if (LIKELY(dm->foreachMappedVert)) {
-               fill_vn_fl(vp_handle->dists_sq, me->totvert, FLT_MAX);
+               copy_vn_fl(vp_handle->dists_sq, me->totvert, FLT_MAX);
 
                dm->foreachMappedVert(dm, vpaint_proj_dm_map_cosnos_update__map_cb, &vp_update, DM_FOREACH_USE_NORMAL);
        }
index 87fe29325bcf9341096950d61fab4e3d45d36098..1f8a69adba0d6a2cc05f05efd809f88a3c19e7e0 100644 (file)
@@ -199,7 +199,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
        bool has_skinradius = false;
        PointerRNA data_ptr;
 
-       fill_vn_fl(median, NBR_TRANSFORM_PROPERTIES, 0.0f);
+       copy_vn_fl(median, NBR_TRANSFORM_PROPERTIES, 0.0f);
        tot = totedgedata = totcurvedata = totlattdata = totcurvebweight = 0;
 
        /* make sure we got storage */
index 3cf0c53d5645d4982a209bccbde1f7469b84d721..7d80044762c564663bab1120f8d4f3a99628e52e 100644 (file)
@@ -6017,7 +6017,7 @@ static bool createEdgeSlideVerts(TransInfo *t)
 
        loop_dir = MEM_callocN(sizeof(float) * 3 * loop_nr, "sv loop_dir");
        loop_maxdist = MEM_mallocN(sizeof(float) * loop_nr, "sv loop_maxdist");
-       fill_vn_fl(loop_maxdist, loop_nr, -1.0f);
+       copy_vn_fl(loop_maxdist, loop_nr, -1.0f);
 
        BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
                if (BM_elem_flag_test(e, BM_ELEM_SELECT)) {
index 8aa26c3241373001abaf7f74c0440f8b90699de1..9efbc1bc54921a7cedf6befe79ea8562c6673886 100644 (file)
@@ -2124,7 +2124,7 @@ static struct TransIslandData *editmesh_islands_info_calc(BMEditMesh *em, int *r
        vert_map = MEM_mallocN(sizeof(*vert_map) * bm->totvert, __func__);
        /* we shouldn't need this, but with incorrect selection flushing
         * its possible we have a selected vertex thats not in a face, for now best not crash in that case. */
-       fill_vn_i(vert_map, bm->totvert, -1);
+       copy_vn_i(vert_map, bm->totvert, -1);
 
        BM_mesh_elem_table_ensure(bm, htype);
        ele_array = (htype == BM_FACE) ? (void **)bm->ftable : (void **)bm->etable;
index 050631362b4deff06a05f259b4a75b1f89db7377..effb45a61abaaca5dbd7615b57e43d8c3bf155ae 100644 (file)
@@ -73,14 +73,14 @@ void initNumInput(NumInput *n)
 {
        n->idx_max = 0;
        n->unit_sys = USER_UNIT_NONE;
-       fill_vn_i(n->unit_type, NUM_MAX_ELEMENTS, B_UNIT_NONE);
+       copy_vn_i(n->unit_type, NUM_MAX_ELEMENTS, B_UNIT_NONE);
        n->unit_use_radians = false;
 
        n->flag = 0;
-       fill_vn_short(n->val_flag, NUM_MAX_ELEMENTS, 0);
+       copy_vn_short(n->val_flag, NUM_MAX_ELEMENTS, 0);
        zero_v3(n->val);
-       fill_vn_fl(n->val_org, NUM_MAX_ELEMENTS, 0.0f);
-       fill_vn_fl(n->val_inc, NUM_MAX_ELEMENTS, 1.0f);
+       copy_vn_fl(n->val_org, NUM_MAX_ELEMENTS, 0.0f);
+       copy_vn_fl(n->val_inc, NUM_MAX_ELEMENTS, 1.0f);
 
        n->idx = 0;
        n->str[0] = '\0';
index 2ec7fe677ae0081995fb20643555712af4dc30e9..37070a37c056c4d334788bd71178c7428206f0b6 100644 (file)
@@ -2120,7 +2120,7 @@ static int uv_mouse_select(bContext *C, const float co[2], bool extend, bool loo
                /* mark 1 vertex as being hit */
                hitv  = BLI_array_alloca(hitv,  hit.efa->len);
                hituv = BLI_array_alloca(hituv, hit.efa->len);
-               fill_vn_i(hitv, hit.efa->len, 0xFFFFFFFF);
+               copy_vn_i(hitv, hit.efa->len, 0xFFFFFFFF);
 
                hitv[hit.lindex] = BM_elem_index_get(hit.l->v);
                hituv[hit.lindex] = hit.luv->uv;
@@ -2137,7 +2137,7 @@ static int uv_mouse_select(bContext *C, const float co[2], bool extend, bool loo
                /* mark 2 edge vertices as being hit */
                hitv  = BLI_array_alloca(hitv,  hit.efa->len);
                hituv = BLI_array_alloca(hituv, hit.efa->len);
-               fill_vn_i(hitv, hit.efa->len, 0xFFFFFFFF);
+               copy_vn_i(hitv, hit.efa->len, 0xFFFFFFFF);
 
                hitv[hit.lindex] = BM_elem_index_get(hit.l->v);
                hitv[(hit.lindex + 1) % hit.efa->len] = BM_elem_index_get(hit.l->next->v);
index 4d58642e9c47013777d5c911620f7d1bec06823e..62097635296b781819b0d75ed2e77783a650d78f 100644 (file)
@@ -454,7 +454,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image)
                                
                                if (bitspersample == 32) {
                                        if (chan == 3 && spp == 3) /* fill alpha if only RGB TIFF */
-                                               fill_vn_fl(fbuf, ibuf->x, 1.0f);
+                                               copy_vn_fl(fbuf, ibuf->x, 1.0f);
                                        else if (chan >= spp) /* for grayscale, duplicate first channel into G and B */
                                                success |= TIFFReadScanline(image, fbuf, row, 0);
                                        else
@@ -464,7 +464,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image)
                                }
                                else if (bitspersample == 16) {
                                        if (chan == 3 && spp == 3) /* fill alpha if only RGB TIFF */
-                                               fill_vn_ushort(sbuf, ibuf->x, 65535);
+                                               copy_vn_ushort(sbuf, ibuf->x, 65535);
                                        else if (chan >= spp) /* for grayscale, duplicate first channel into G and B */
                                                success |= TIFFReadScanline(image, fbuf, row, 0);
                                        else
index 92f8ad62924872d3a1a3277184ff15c8e9a0d57b..8bb3e9c265b939cf1f45b64b80e177aaacbd7821 100644 (file)
@@ -1387,7 +1387,7 @@ static void rna_Object_boundbox_get(PointerRNA *ptr, float *values)
                memcpy(values, bb->vec, sizeof(bb->vec));
        }
        else {
-               fill_vn_fl(values, sizeof(bb->vec) / sizeof(float), 0.0f);
+               copy_vn_fl(values, sizeof(bb->vec) / sizeof(float), 0.0f);
        }
 
 }
index 8ebee0dc1b4341d81aa30d222b862489443422a3..44660b15c3c73b42f57e831a46d9439c7fb26ed3 100644 (file)
@@ -364,22 +364,22 @@ static void dm_merge_transform(
        /* set origindex */
        index_orig = result->getVertDataArray(result, CD_ORIGINDEX);
        if (index_orig) {
-               fill_vn_i(index_orig + cap_verts_index, cap_nverts, ORIGINDEX_NONE);
+               copy_vn_i(index_orig + cap_verts_index, cap_nverts, ORIGINDEX_NONE);
        }
 
        index_orig = result->getEdgeDataArray(result, CD_ORIGINDEX);
        if (index_orig) {
-               fill_vn_i(index_orig + cap_edges_index, cap_nedges, ORIGINDEX_NONE);
+               copy_vn_i(index_orig + cap_edges_index, cap_nedges, ORIGINDEX_NONE);
        }
 
        index_orig = result->getPolyDataArray(result, CD_ORIGINDEX);
        if (index_orig) {
-               fill_vn_i(index_orig + cap_polys_index, cap_npolys, ORIGINDEX_NONE);
+               copy_vn_i(index_orig + cap_polys_index, cap_npolys, ORIGINDEX_NONE);
        }
 
        index_orig = result->getLoopDataArray(result, CD_ORIGINDEX);
        if (index_orig) {
-               fill_vn_i(index_orig + cap_loops_index, cap_nloops, ORIGINDEX_NONE);
+               copy_vn_i(index_orig + cap_loops_index, cap_nloops, ORIGINDEX_NONE);
        }
 }
 
@@ -525,7 +525,7 @@ static DerivedMesh *arrayModifier_doArray(
        if (use_merge) {
                /* Will need full_doubles_map for handling merge */
                full_doubles_map = MEM_mallocN(sizeof(int) * result_nverts, "mod array doubles map");
-               fill_vn_i(full_doubles_map, result_nverts, -1);
+               copy_vn_i(full_doubles_map, result_nverts, -1);
        }
 
        /* copy customdata to original geometry */
index 295f303974da780e50ecb5882c87708a51009cb2..162f45b4e91714b990a518179e833217ca0688c4 100644 (file)
@@ -391,7 +391,7 @@ static void smooth_verts(
                                smooth_weights);
                }
                else {
-                       fill_vn_fl(smooth_weights, (int)numVerts, 1.0f);
+                       copy_vn_fl(smooth_weights, (int)numVerts, 1.0f);
                }
 
                if (csmd->flag & MOD_CORRECTIVESMOOTH_PIN_BOUNDARY) {
index 50b1404a8e588808562d8d9b93311b2c6275d81b..5ebb3f98f6c23ae902d1bc2a2fa7896f747859b1 100644 (file)
@@ -1801,7 +1801,7 @@ static void skin_set_orig_indices(DerivedMesh *dm)
        totpoly = dm->getNumPolys(dm);
        orig = CustomData_add_layer(&dm->polyData, CD_ORIGINDEX,
                                    CD_CALLOC, NULL, totpoly);
-       fill_vn_i(orig, totpoly, ORIGINDEX_NONE);
+       copy_vn_i(orig, totpoly, ORIGINDEX_NONE);
 }
 
 /*
index c96080d8cf97fd096f2cf6d974250bf39d720186..fdba8e54a98953d85c5d6fc7513f07ceeeec15a4 100644 (file)
@@ -298,7 +298,7 @@ static DerivedMesh *applyModifier(
 
                /* save doing 2 loops here... */
 #if 0
-               fill_vn_i(edge_users, numEdges, INVALID_UNUSED);
+               copy_vn_i(edge_users, numEdges, INVALID_UNUSED);
 #endif
 
                for (eidx = 0, ed = orig_medge; eidx < numEdges; eidx++, ed++) {
@@ -505,7 +505,7 @@ static DerivedMesh *applyModifier(
                        unsigned int i;
 
                        vert_lens = MEM_mallocN(sizeof(float) * numVerts, "vert_lens");
-                       fill_vn_fl(vert_lens, (int)numVerts, FLT_MAX);
+                       copy_vn_fl(vert_lens, (int)numVerts, FLT_MAX);
                        for (i = 0; i < numEdges; i++) {
                                const float ed_len_sq = len_squared_v3v3(mvert[medge[i].v1].co, mvert[medge[i].v2].co);
                                vert_lens[medge[i].v1] = min_ff(vert_lens[medge[i].v1], ed_len_sq);
@@ -672,7 +672,7 @@ static DerivedMesh *applyModifier(
                        float *vert_lens_sq = MEM_mallocN(sizeof(float) * numVerts, "vert_lens");
                        const float offset    = fabsf(smd->offset) * smd->offset_clamp;
                        const float offset_sq = offset * offset;
-                       fill_vn_fl(vert_lens_sq, (int)numVerts, FLT_MAX);
+                       copy_vn_fl(vert_lens_sq, (int)numVerts, FLT_MAX);
                        for (i = 0; i < numEdges; i++) {
                                const float ed_len = len_squared_v3v3(mvert[medge[i].v1].co, mvert[medge[i].v2].co);
                                vert_lens_sq[medge[i].v1] = min_ff(vert_lens_sq[medge[i].v1], ed_len);
index 67905f8e34037f2028e637405393071e14303ecf..91e2a635400c2fc5599666423fa6c7c859b4314c 100644 (file)
@@ -1858,7 +1858,7 @@ static PyObject *Matrix_zero(MatrixObject *self)
        if (BaseMath_Prepare_ForWrite(self) == -1)
                return NULL;
 
-       fill_vn_fl(self->matrix, self->num_col * self->num_row, 0.0f);
+       copy_vn_fl(self->matrix, self->num_col * self->num_row, 0.0f);
 
        if (BaseMath_WriteCallback(self) == -1)
                return NULL;
index a33b55c35dc63f135fe96f511346ef11f9f011aa..3d7a505eb1293798940cb2b6ed90f79e90ada142 100644 (file)
@@ -76,7 +76,7 @@ static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
                                return NULL;
                        }
 
-                       fill_vn_fl(vec, size, 0.0f);
+                       copy_vn_fl(vec, size, 0.0f);
                        break;
                case 1:
                        if ((size = mathutils_array_parse_alloc(&vec, 2, PyTuple_GET_ITEM(args, 0), "mathutils.Vector()")) == -1) {
@@ -142,7 +142,7 @@ static PyObject *C_Vector_Fill(PyObject *cls, PyObject *args)
                return NULL;
        }
 
-       fill_vn_fl(vec, size, fill);
+       copy_vn_fl(vec, size, fill);
 
        return Vector_CreatePyObject_alloc(vec, size, (PyTypeObject *)cls);
 }
@@ -339,7 +339,7 @@ static PyObject *Vector_zero(VectorObject *self)
        if (BaseMath_Prepare_ForWrite(self) == -1)
                return NULL;
 
-       fill_vn_fl(self->vec, self->size, 0.0f);
+       copy_vn_fl(self->vec, self->size, 0.0f);
 
        if (BaseMath_WriteCallback(self) == -1)
                return NULL;
@@ -426,7 +426,7 @@ static PyObject *Vector_resize(VectorObject *self, PyObject *value)
 
        /* If the vector has increased in length, set all new elements to 0.0f */
        if (size > self->size) {
-               fill_vn_fl(self->vec + self->size, size - self->size, 0.0f);
+               copy_vn_fl(self->vec + self->size, size - self->size, 0.0f);
        }
 
        self->size = size;
@@ -465,7 +465,7 @@ static PyObject *Vector_resized(VectorObject *self, PyObject *value)
                return NULL;
        }
 
-       fill_vn_fl(vec, size, 0.0f);
+       copy_vn_fl(vec, size, 0.0f);
        memcpy(vec, self->vec, self->size * sizeof(float));
 
        return Vector_CreatePyObject_alloc(vec, size, NULL);
@@ -2236,7 +2236,7 @@ static int Vector_length_set(VectorObject *self, PyObject *value)
                return -1;
        }
        if (param == 0.0) {
-               fill_vn_fl(self->vec, self->size, 0.0f);
+               copy_vn_fl(self->vec, self->size, 0.0f);
                return 0;
        }
 
@@ -3030,7 +3030,7 @@ PyObject *Vector_CreatePyObject(
                        memcpy(self->vec, vec, size * sizeof(float));
                }
                else { /* new empty */
-                       fill_vn_fl(self->vec, size, 0.0f);
+                       copy_vn_fl(self->vec, size, 0.0f);
                        if (size == 4) {  /* do the homogeneous thing */
                                self->vec[3] = 1.0f;
                        }