[Bf-blender-cvs] [50a4b9d5021] master: Cleanup: replace 'unsigned in' with 'uint'
Campbell Barton
noreply at git.blender.org
Fri Jun 18 08:36:25 CEST 2021
Commit: 50a4b9d502104aabdd33ed924a89fe018cfa80b3
Author: Campbell Barton
Date: Fri Jun 18 14:27:41 2021 +1000
Branches: master
https://developer.blender.org/rB50a4b9d502104aabdd33ed924a89fe018cfa80b3
Cleanup: replace 'unsigned in' with 'uint'
===================================================================
M source/blender/blenkernel/intern/mesh.c
M source/blender/blenkernel/intern/mesh_convert.c
M source/blender/blenkernel/intern/mesh_evaluate.c
M source/blender/blenkernel/intern/mesh_fair.cc
M source/blender/blenkernel/intern/mesh_mapping.c
M source/blender/blenkernel/intern/mesh_merge.c
M source/blender/blenkernel/intern/mesh_remap.c
M source/blender/blenkernel/intern/mesh_remesh_voxel.c
M source/blender/blenkernel/intern/mesh_runtime.c
M source/blender/blenkernel/intern/mesh_sample.cc
M source/blender/blenkernel/intern/mesh_validate.c
===================================================================
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index b38bbc425fc..0068821bab0 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -1260,8 +1260,8 @@ int test_index_face(MFace *mface, CustomData *fdata, int mfindex, int nr)
if (mface->v3 == 0) {
static int corner_indices[4] = {1, 2, 0, 3};
- SWAP(unsigned int, mface->v1, mface->v2);
- SWAP(unsigned int, mface->v2, mface->v3);
+ SWAP(uint, mface->v1, mface->v2);
+ SWAP(uint, mface->v2, mface->v3);
if (fdata) {
CustomData_swap_corners(fdata, mfindex, corner_indices);
@@ -1272,8 +1272,8 @@ int test_index_face(MFace *mface, CustomData *fdata, int mfindex, int nr)
if (mface->v3 == 0 || mface->v4 == 0) {
static int corner_indices[4] = {2, 3, 0, 1};
- SWAP(unsigned int, mface->v1, mface->v3);
- SWAP(unsigned int, mface->v2, mface->v4);
+ SWAP(uint, mface->v1, mface->v3);
+ SWAP(uint, mface->v2, mface->v4);
if (fdata) {
CustomData_swap_corners(fdata, mfindex, corner_indices);
@@ -1375,7 +1375,7 @@ void BKE_mesh_material_index_clear(Mesh *me)
}
}
-void BKE_mesh_material_remap(Mesh *me, const unsigned int *remap, unsigned int remap_len)
+void BKE_mesh_material_remap(Mesh *me, const uint *remap, uint remap_len)
{
const short remap_len_short = (short)remap_len;
@@ -1439,10 +1439,7 @@ int poly_find_loop_from_vert(const MPoly *poly, const MLoop *loopstart, uint ver
* vertex. Returns the index of the loop matching vertex, or -1 if the
* vertex is not in \a poly
*/
-int poly_get_adj_loops_from_vert(const MPoly *poly,
- const MLoop *mloop,
- unsigned int vert,
- unsigned int r_adj[2])
+int poly_get_adj_loops_from_vert(const MPoly *poly, const MLoop *mloop, uint vert, uint r_adj[2])
{
int corner = poly_find_loop_from_vert(poly, &mloop[poly->loopstart], vert);
diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c
index c698d95ed8d..31cb21b0f00 100644
--- a/source/blender/blenkernel/intern/mesh_convert.c
+++ b/source/blender/blenkernel/intern/mesh_convert.c
@@ -148,7 +148,7 @@ static void make_edges_mdata_extend(
int totedge = *r_totedge;
int totedge_new;
EdgeHash *eh;
- unsigned int eh_reserve;
+ uint eh_reserve;
const MPoly *mp;
int i;
@@ -174,7 +174,7 @@ static void make_edges_mdata_extend(
if (totedge_new) {
EdgeHashIterator *ehi;
MEdge *medge;
- unsigned int e_index = totedge;
+ uint e_index = totedge;
*r_alledge = medge = (*r_alledge ?
MEM_reallocN(*r_alledge, sizeof(MEdge) * (totedge + totedge_new)) :
@@ -719,17 +719,17 @@ typedef struct EdgeLink {
typedef struct VertLink {
Link *next, *prev;
- unsigned int index;
+ uint index;
} VertLink;
-static void prependPolyLineVert(ListBase *lb, unsigned int index)
+static void prependPolyLineVert(ListBase *lb, uint index)
{
VertLink *vl = MEM_callocN(sizeof(VertLink), "VertLink");
vl->index = index;
BLI_addhead(lb, vl);
}
-static void appendPolyLineVert(ListBase *lb, unsigned int index)
+static void appendPolyLineVert(ListBase *lb, uint index)
{
VertLink *vl = MEM_callocN(sizeof(VertLink), "VertLink");
vl->index = index;
@@ -784,8 +784,8 @@ void BKE_mesh_to_curve_nurblist(const Mesh *me, ListBase *nurblist, const int ed
bool closed = false;
int totpoly = 0;
MEdge *med_current = ((EdgeLink *)edges.last)->edge;
- unsigned int startVert = med_current->v1;
- unsigned int endVert = med_current->v2;
+ uint startVert = med_current->v1;
+ uint endVert = med_current->v2;
bool ok = true;
appendPolyLineVert(&polyline, startVert);
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c
index bd79ec4a4bd..2ce6e1f15f0 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@ -478,7 +478,7 @@ void BKE_mesh_calc_normals_looptri(MVert *mverts,
for (int i = 0; i < looptri_num; i++) {
const MLoopTri *lt = &looptri[i];
float *f_no = fnors[i];
- const unsigned int vtri[3] = {
+ const uint vtri[3] = {
mloop[lt->tri[0]].v,
mloop[lt->tri[1]].v,
mloop[lt->tri[2]].v,
@@ -1058,7 +1058,7 @@ static void split_loop_nor_single_do(LoopSplitTaskDataCommon *common_data, LoopS
if (lnors_spacearr) {
float vec_curr[3], vec_prev[3];
- const unsigned int mv_pivot_index = ml_curr->v; /* The vertex we are "fanning" around! */
+ const uint mv_pivot_index = ml_curr->v; /* The vertex we are "fanning" around! */
const MVert *mv_pivot = &mverts[mv_pivot_index];
const MEdge *me_curr = &medges[ml_curr->e];
const MVert *mv_2 = (me_curr->v1 == mv_pivot_index) ? &mverts[me_curr->v2] :
@@ -1117,7 +1117,7 @@ static void split_loop_nor_fan_do(LoopSplitTaskDataCommon *common_data, LoopSpli
* number of sharp edges per vertex, I doubt the additional memory usage would be worth it,
* especially as it should not be a common case in real-life meshes anyway).
*/
- const unsigned int mv_pivot_index = ml_curr->v; /* The vertex we are "fanning" around! */
+ const uint mv_pivot_index = ml_curr->v; /* The vertex we are "fanning" around! */
const MVert *mv_pivot = &mverts[mv_pivot_index];
/* ml_curr would be mlfan_prev if we needed that one. */
@@ -1361,7 +1361,7 @@ static bool loop_split_generator_check_cyclic_smooth_fan(const MLoop *mloops,
const int ml_prev_index,
const int mp_curr_index)
{
- const unsigned int mv_pivot_index = ml_curr->v; /* The vertex we are "fanning" around! */
+ const uint mv_pivot_index = ml_curr->v; /* The vertex we are "fanning" around! */
const int *e2lfan_curr;
const MLoop *mlfan_curr;
/* mlfan_vert_index: the loop of our current edge might not be the loop of our current vertex! */
@@ -2133,7 +2133,7 @@ void BKE_mesh_normals_loop_to_vertex(const int numVerts,
int i;
const MLoop *ml;
for (i = 0, ml = mloops; i < numLoops; i++, ml++) {
- const unsigned int v = ml->v;
+ const uint v = ml->v;
add_v3_v3(r_vert_clnors[v], clnors[i]);
vert_loops_nbr[v]++;
@@ -2315,7 +2315,7 @@ float BKE_mesh_calc_poly_area(const MPoly *mpoly, const MLoop *loopstart, const
}
/* finally calculate the area */
- float area = area_poly_v3((const float(*)[3])vertexcos, (unsigned int)mpoly->totloop);
+ float area = area_poly_v3((const float(*)[3])vertexcos, (uint)mpoly->totloop);
return area;
}
@@ -2518,9 +2518,7 @@ void BKE_mesh_poly_edgehash_insert(EdgeHash *ehash, const MPoly *mp, const MLoop
}
}
-void BKE_mesh_poly_edgebitmap_insert(unsigned int *edge_bitmap,
- const MPoly *mp,
- const MLoop *mloop)
+void BKE_mesh_poly_edgebitmap_insert(uint *edge_bitmap, const MPoly *mp, const MLoop *mloop)
{
const MLoop *ml;
int i = mp->totloop;
@@ -2795,7 +2793,7 @@ void BKE_mesh_loops_to_mface_corners(
CustomData *fdata,
CustomData *ldata,
CustomData *UNUSED(pdata),
- unsigned int lindex[4],
+ uint lindex[4],
int findex,
const int UNUSED(polyindex),
const int mf_len, /* 3 or 4 */
@@ -2873,7 +2871,7 @@ void BKE_mesh_loops_to_tessdata(CustomData *fdata,
CustomData *ldata,
MFace *mface,
const int *polyindices,
- unsigned int (*loopindices)[4],
+ uint (*loopindices)[4],
const int num_faces)
{
/* Note: performances are sub-optimal when we get a NULL mface,
@@ -2889,7 +2887,7 @@ void BKE_mesh_loops_to_tessdata(CustomData *fdata,
const bool hasLoopTangent = CustomData_has_layer(ldata, CD_TANGENT);
int findex, i, j;
const int *pidx;
- unsigned int(*lidx)[4];
+ uint(*lidx)[4];
for (i = 0; i < numUV; i++) {
MTFace *texface = CustomData_get_layer_n(fdata, CD_MTFACE, i);
@@ -2966,7 +2964,7 @@ void BKE_mesh_tangent_loops_to_tessdata(CustomData *fdata,
CustomData *ldata,
MFace *mface,
const int *polyindices,
- unsigned int (*loopindices)[4],
+ uint (*loopindices)[4],
const int num_faces,
const char *layer_name)
{
@@ -2981,7 +2979,7 @@ void BKE_mesh_tangent_loops_to_tessdata(CustomData *fdata,
int findex, j;
const int *pidx;
- unsigned int(*lidx)[4];
+ uint(*lidx)[4];
if (layer_name) {
ltangents = CustomData_get_layer_named(ldata, CD_TANGENT, layer_name);
@@ -3043,9 +3041,9 @@ int BKE_mesh_tessface_calc_ex(CustomData *fdata,
MFace *mface, *mf;
MemArena *arena = NULL;
int *mface_to_poly_map;
- unsigned int(*lindices)[4];
+ uint(*lindices)[4];
int poly_index, mface_index;
- unsigned int j;
+ uint j;
mpoly = CustomData_get_layer(pdata, CD_MPOLY);
mloop = CustomData_get_layer(ldata, CD_MLOOP);
@@ -3060,10 +3058,10 @@ int BKE_mesh_tessface_calc_ex(CustomData *fdata,
mface_index = 0;
mp = mpoly;
for (poly_index = 0; poly_index < totpoly; poly_index++, mp++) {
- const unsigned int mp_loopstart = (unsigned int)mp->loopstart;
- const unsigned int mp_totloop = (unsigned int)mp->totloop;
- unsigned int l1, l2, l3, l4;
- unsigned int *lidx;
+ const uint mp_loopstart = (uint)mp->loopstart;
+ const uint mp_totloop = (uint)mp->totloop;
+ uint l1, l2, l3, l4;
+ uint *lidx;
if (mp_totloop < 3) {
/* do nothing */
}
@@ -3137,9 +3135,9 @@ int BKE_mesh_tessface_calc_ex(CustomData *fdata,
float axis_mat[3][3];
float(*projverts)[2];
- unsigne
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list