From 86590b90aa78c7087a588275030a4f1490e37297 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 19 Sep 2019 13:32:36 +1000 Subject: Cleanup: use uint,ushort,uchar for modifiers --- .../gpencil_modifiers/intern/MOD_gpencilhook.c | 4 +- source/blender/modifiers/intern/MOD_array.c | 4 +- source/blender/modifiers/intern/MOD_collision.c | 2 +- .../modifiers/intern/MOD_correctivesmooth.c | 61 +++++++++--------- source/blender/modifiers/intern/MOD_decimate.c | 4 +- source/blender/modifiers/intern/MOD_explode.c | 6 +- source/blender/modifiers/intern/MOD_hook.c | 4 +- .../blender/modifiers/intern/MOD_laplaciandeform.c | 10 +-- .../blender/modifiers/intern/MOD_laplaciansmooth.c | 8 +-- source/blender/modifiers/intern/MOD_mask.c | 8 +-- .../blender/modifiers/intern/MOD_meshcache_mdd.c | 4 +- .../blender/modifiers/intern/MOD_meshcache_pc2.c | 4 +- source/blender/modifiers/intern/MOD_screw.c | 75 +++++++++++----------- source/blender/modifiers/intern/MOD_skin.c | 2 +- source/blender/modifiers/intern/MOD_smooth.c | 8 +-- source/blender/modifiers/intern/MOD_solidify.c | 70 ++++++++++---------- source/blender/modifiers/intern/MOD_surface.c | 2 +- .../blender/modifiers/intern/MOD_surfacedeform.c | 66 +++++++++---------- source/blender/modifiers/intern/MOD_util.c | 6 +- source/blender/modifiers/intern/MOD_uvproject.c | 24 +++---- .../modifiers/intern/MOD_weightvgproximity.c | 4 +- 21 files changed, 187 insertions(+), 189 deletions(-) (limited to 'source') diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c index 810a2ba7e25..234b4deeceb 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c @@ -63,8 +63,8 @@ struct GPHookData_cb { float falloff_sq; float fac_orig; - unsigned int use_falloff : 1; - unsigned int use_uniform : 1; + uint use_falloff : 1; + uint use_uniform : 1; float cent[3]; diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c index 3c3aae8fda6..644ac3a10e8 100644 --- a/source/blender/modifiers/intern/MOD_array.c +++ b/source/blender/modifiers/intern/MOD_array.c @@ -269,8 +269,8 @@ static void dm_mvert_map_doubles(int *doubles_map, static void mesh_merge_transform(Mesh *result, Mesh *cap_mesh, const float cap_offset[4][4], - unsigned int cap_verts_index, - unsigned int cap_edges_index, + uint cap_verts_index, + uint cap_edges_index, int cap_loops_index, int cap_polys_index, int cap_nverts, diff --git a/source/blender/modifiers/intern/MOD_collision.c b/source/blender/modifiers/intern/MOD_collision.c index 3d43c6de88e..56e84423db4 100644 --- a/source/blender/modifiers/intern/MOD_collision.c +++ b/source/blender/modifiers/intern/MOD_collision.c @@ -118,7 +118,7 @@ static void deformVerts(ModifierData *md, if (mesh_src) { float current_time = 0; - unsigned int mvert_num = 0; + uint mvert_num = 0; BKE_mesh_vert_coords_apply(mesh_src, vertexCos); BKE_mesh_calc_normals(mesh_src); diff --git a/source/blender/modifiers/intern/MOD_correctivesmooth.c b/source/blender/modifiers/intern/MOD_correctivesmooth.c index a234f468e45..fbf955abc98 100644 --- a/source/blender/modifiers/intern/MOD_correctivesmooth.c +++ b/source/blender/modifiers/intern/MOD_correctivesmooth.c @@ -117,11 +117,11 @@ static void requiredDataMask(Object *UNUSED(ob), /* check individual weights for changes and cache values */ static void mesh_get_weights(MDeformVert *dvert, const int defgrp_index, - const unsigned int numVerts, + const uint numVerts, const bool use_invert_vgroup, float *smooth_weights) { - unsigned int i; + uint i; for (i = 0; i < numVerts; i++, dvert++) { const float w = defvert_find_weight(dvert, defgrp_index); @@ -140,11 +140,11 @@ static void mesh_get_boundaries(Mesh *mesh, float *smooth_weights) const MPoly *mpoly = mesh->mpoly; const MLoop *mloop = mesh->mloop; const MEdge *medge = mesh->medge; - unsigned int mpoly_num, medge_num, i; - unsigned short *boundaries; + uint mpoly_num, medge_num, i; + ushort *boundaries; - mpoly_num = (unsigned int)mesh->totpoly; - medge_num = (unsigned int)mesh->totedge; + mpoly_num = (uint)mesh->totpoly; + medge_num = (uint)mesh->totedge; boundaries = MEM_calloc_arrayN(medge_num, sizeof(*boundaries), __func__); @@ -176,14 +176,14 @@ static void mesh_get_boundaries(Mesh *mesh, float *smooth_weights) static void smooth_iter__simple(CorrectiveSmoothModifierData *csmd, Mesh *mesh, float (*vertexCos)[3], - unsigned int numVerts, + uint numVerts, const float *smooth_weights, - unsigned int iterations) + uint iterations) { const float lambda = csmd->lambda; - unsigned int i; + uint i; - const unsigned int numEdges = (unsigned int)mesh->totedge; + const uint numEdges = (uint)mesh->totedge; const MEdge *edges = mesh->medge; float *vertex_edge_count_div; @@ -252,18 +252,18 @@ static void smooth_iter__simple(CorrectiveSmoothModifierData *csmd, static void smooth_iter__length_weight(CorrectiveSmoothModifierData *csmd, Mesh *mesh, float (*vertexCos)[3], - unsigned int numVerts, + uint numVerts, const float *smooth_weights, - unsigned int iterations) + uint iterations) { const float eps = FLT_EPSILON * 10.0f; - const unsigned int numEdges = (unsigned int)mesh->totedge; + const uint numEdges = (uint)mesh->totedge; /* note: the way this smoothing method works, its approx half as strong as the simple-smooth, * and 2.0 rarely spikes, double the value for consistent behavior. */ const float lambda = csmd->lambda * 2.0f; const MEdge *edges = mesh->medge; float *vertex_edge_count; - unsigned int i; + uint i; struct SmoothingData_Weighted { float delta[3]; @@ -346,9 +346,9 @@ static void smooth_iter__length_weight(CorrectiveSmoothModifierData *csmd, static void smooth_iter(CorrectiveSmoothModifierData *csmd, Mesh *mesh, float (*vertexCos)[3], - unsigned int numVerts, + uint numVerts, const float *smooth_weights, - unsigned int iterations) + uint iterations) { switch (csmd->smooth_type) { case MOD_CORRECTIVESMOOTH_SMOOTH_LENGTH_WEIGHT: @@ -367,7 +367,7 @@ static void smooth_verts(CorrectiveSmoothModifierData *csmd, MDeformVert *dvert, const int defgrp_index, float (*vertexCos)[3], - unsigned int numVerts) + uint numVerts) { float *smooth_weights = NULL; @@ -391,7 +391,7 @@ static void smooth_verts(CorrectiveSmoothModifierData *csmd, } } - smooth_iter(csmd, mesh, vertexCos, numVerts, smooth_weights, (unsigned int)csmd->repeat); + smooth_iter(csmd, mesh, vertexCos, numVerts, smooth_weights, (uint)csmd->repeat); if (smooth_weights) { MEM_freeN(smooth_weights); @@ -454,13 +454,13 @@ static void calc_tangent_loop_accum(const float v_dir_prev[3], static void calc_tangent_spaces(Mesh *mesh, float (*vertexCos)[3], float (*r_tangent_spaces)[3][3]) { - const unsigned int mpoly_num = (unsigned int)mesh->totpoly; + const uint mpoly_num = (uint)mesh->totpoly; #ifndef USE_TANGENT_CALC_INLINE - const unsigned int mvert_num = (unsigned int)dm->getNumVerts(dm); + const uint mvert_num = (uint)dm->getNumVerts(dm); #endif const MPoly *mpoly = mesh->mpoly; const MLoop *mloop = mesh->mloop; - unsigned int i; + uint i; for (i = 0; i < mpoly_num; i++) { const MPoly *mp = &mpoly[i]; @@ -511,11 +511,11 @@ static void calc_deltas(CorrectiveSmoothModifierData *csmd, MDeformVert *dvert, const int defgrp_index, const float (*rest_coords)[3], - unsigned int numVerts) + uint numVerts) { float(*smooth_vertex_coords)[3] = MEM_dupallocN(rest_coords); float(*tangent_spaces)[3][3]; - unsigned int i; + uint i; tangent_spaces = MEM_calloc_arrayN(numVerts, sizeof(float[3][3]), __func__); @@ -556,7 +556,7 @@ static void correctivesmooth_modifier_do(ModifierData *md, Object *ob, Mesh *mesh, float (*vertexCos)[3], - unsigned int numVerts, + uint numVerts, struct BMEditMesh *em) { CorrectiveSmoothModifierData *csmd = (CorrectiveSmoothModifierData *)md; @@ -575,7 +575,7 @@ static void correctivesmooth_modifier_do(ModifierData *md, /* if rest bind_coords not are defined, set them (only run during bind) */ if ((csmd->rest_source == MOD_CORRECTIVESMOOTH_RESTSOURCE_BIND) && /* signal to recalculate, whoever sets MUST also free bind coords */ - (csmd->bind_coords_num == (unsigned int)-1)) { + (csmd->bind_coords_num == (uint)-1)) { if (DEG_is_active(depsgraph)) { BLI_assert(csmd->bind_coords == NULL); csmd->bind_coords = MEM_dupallocN(vertexCos); @@ -617,8 +617,7 @@ static void correctivesmooth_modifier_do(ModifierData *md, goto error; } else { - unsigned int me_numVerts = (unsigned int)((em) ? em->bm->totvert : - ((Mesh *)ob->data)->totvert); + uint me_numVerts = (uint)((em) ? em->bm->totvert : ((Mesh *)ob->data)->totvert); if (me_numVerts != numVerts) { modifier_setError(md, "Original vertex count mismatch: %u to %u", me_numVerts, numVerts); @@ -642,7 +641,7 @@ static void correctivesmooth_modifier_do(ModifierData *md, rest_coords = em ? BKE_editmesh_vert_coords_alloc_orco(em, &me_numVerts) : BKE_mesh_vert_coords_alloc(ob->data, &me_numVerts); - BLI_assert((unsigned int)me_numVerts == numVerts); + BLI_assert((uint)me_numVerts == numVerts); is_rest_coords_alloc = true; } @@ -673,7 +672,7 @@ static void correctivesmooth_modifier_do(ModifierData *md, smooth_verts(csmd, mesh, dvert, defgrp_index, vertexCos, numVerts); { - unsigned int i; + uint i; float(*tangent_spaces)[3][3]; @@ -717,7 +716,7 @@ static void deformVerts(ModifierData *md, Mesh *mesh_src = MOD_deform_mesh_eval_get(ctx->object, NULL, mesh, NULL, numVerts, false, false); correctivesmooth_modifier_do( - md, ctx->depsgraph, ctx->object, mesh_src, vertexCos, (unsigned int)numVerts, NULL); + md, ctx->depsgraph, ctx->object, mesh_src, vertexCos, (uint)numVerts, NULL); if (mesh_src != mesh) { BKE_id_free(NULL, mesh_src); @@ -735,7 +734,7 @@ static void deformVertsEM(ModifierData *md, ctx->object, editData, mesh, NULL, numVerts, false, false); correctivesmooth_modifier_do( - md, ctx->depsgraph, ctx->object, mesh_src, vertexCos, (unsigned int)numVerts, editData); + md, ctx->depsgraph, ctx->object, mesh_src, vertexCos, (uint)numVerts, editData); if (mesh_src != mesh) { BKE_id_free(NULL, mesh_src); diff --git a/source/blender/modifiers/intern/MOD_decimate.c b/source/blender/modifiers/intern/MOD_decimate.c index cff700e8d45..e0764241f18 100644 --- a/source/blender/modifiers/intern/MOD_decimate.c +++ b/source/blender/modifiers/intern/MOD_decimate.c @@ -140,8 +140,8 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes MOD_get_vgroup(ctx->object, mesh, dmd->defgrp_name, &dvert, &defgrp_index); if (dvert) { - const unsigned int vert_tot = mesh->totvert; - unsigned int i; + const uint vert_tot = mesh->totvert; + uint i; vweights = MEM_malloc_arrayN(vert_tot, sizeof(float), __func__); diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index 4ed787810a8..ed42a4bf8b1 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -201,7 +201,7 @@ static void createFacepa(ExplodeModifierData *emd, ParticleSystemModifierData *p BLI_rng_free(rng); } -static int edgecut_get(EdgeHash *edgehash, unsigned int v1, unsigned int v2) +static int edgecut_get(EdgeHash *edgehash, uint v1, uint v2) { return POINTER_AS_INT(BLI_edgehash_lookup(edgehash, v1, v2)); } @@ -649,7 +649,7 @@ static Mesh *cutEdges(ExplodeModifierData *emd, Mesh *mesh) int i, v1, v2, v3, v4, esplit, v[4] = {0, 0, 0, 0}, /* To quite gcc barking... */ uv[4] = {0, 0, 0, 0}; /* To quite gcc barking... */ int numlayer; - unsigned int ed_v1, ed_v2; + uint ed_v1, ed_v2; edgehash = BLI_edgehash_new(__func__); @@ -906,7 +906,7 @@ static Mesh *explodeMesh(ExplodeModifierData *emd, const int *facepa = emd->facepa; int totdup = 0, totvert = 0, totface = 0, totpart = 0, delface = 0; int i, v, u; - unsigned int ed_v1, ed_v2, mindex = 0; + uint ed_v1, ed_v2, mindex = 0; MTFace *mtface = NULL, *mtf; totface = mesh->totface; diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c index 2f902db9340..1a62010abe7 100644 --- a/source/blender/modifiers/intern/MOD_hook.c +++ b/source/blender/modifiers/intern/MOD_hook.c @@ -136,8 +136,8 @@ struct HookData_cb { float falloff_sq; float fac_orig; - unsigned int use_falloff : 1; - unsigned int use_uniform : 1; + uint use_falloff : 1; + uint use_uniform : 1; float cent[3]; diff --git a/source/blender/modifiers/intern/MOD_laplaciandeform.c b/source/blender/modifiers/intern/MOD_laplaciandeform.c index c9e0171c9f2..0fc2e0971da 100644 --- a/source/blender/modifiers/intern/MOD_laplaciandeform.c +++ b/source/blender/modifiers/intern/MOD_laplaciandeform.c @@ -66,7 +66,7 @@ typedef struct LaplacianSystem { float (*co)[3]; /* Original vertex coordinates */ float (*no)[3]; /* Original vertex normal */ float (*delta)[3]; /* Differential Coordinates */ - unsigned int (*tris)[3]; /* Copy of MLoopTri (tessellation triangle) v1-v3 */ + uint (*tris)[3]; /* Copy of MLoopTri (tessellation triangle) v1-v3 */ int *index_anchors; /* Static vertex index list */ int *unit_verts; /* Unit vectors of projected edges onto the plane orthogonal to n */ int *ringf_indices; /* Indices of faces per vertex */ @@ -153,7 +153,7 @@ static void createFaceRingMap(const int mvert_tot, for (i = 0, mlt = mlooptri; i < mtri_tot; i++, mlt++) { for (j = 0; j < 3; j++) { - const unsigned int v_index = mloop[mlt->tri[j]].v; + const uint v_index = mloop[mlt->tri[j]].v; map[v_index].count++; totalr++; } @@ -167,7 +167,7 @@ static void createFaceRingMap(const int mvert_tot, } for (i = 0, mlt = mlooptri; i < mtri_tot; i++, mlt++) { for (j = 0; j < 3; j++) { - const unsigned int v_index = mloop[mlt->tri[j]].v; + const uint v_index = mloop[mlt->tri[j]].v; map[v_index].indices[map[v_index].count] = i; map[v_index].count++; } @@ -253,7 +253,7 @@ static void initLaplacianMatrix(LaplacianSystem *sys) int idv[3]; for (ti = 0; ti < sys->total_tris; ti++) { - const unsigned int *vidt = sys->tris[ti]; + const uint *vidt = sys->tris[ti]; const float *co[3]; co[0] = sys->co[vidt[0]]; @@ -352,7 +352,7 @@ static void rotateDifferentialCoordinates(LaplacianSystem *sys) zero_v3(ni); num_fni = sys->ringf_map[i].count; for (fi = 0; fi < num_fni; fi++) { - const unsigned int *vin; + const uint *vin; fidn = sys->ringf_map[i].indices; vin = sys->tris[fidn[fi]]; for (j = 0; j < 3; j++) { diff --git a/source/blender/modifiers/intern/MOD_laplaciansmooth.c b/source/blender/modifiers/intern/MOD_laplaciansmooth.c index 4a86c26cdeb..86d4124e5db 100644 --- a/source/blender/modifiers/intern/MOD_laplaciansmooth.c +++ b/source/blender/modifiers/intern/MOD_laplaciansmooth.c @@ -199,7 +199,7 @@ static void init_laplacian_matrix(LaplacianSystem *sys) float w1, w2, w3; float areaf; int i; - unsigned int idv1, idv2; + uint idv1, idv2; for (i = 0; i < sys->numEdges; i++) { idv1 = sys->medges[i].v1; @@ -233,7 +233,7 @@ static void init_laplacian_matrix(LaplacianSystem *sys) const float *v_prev = sys->vertexCos[l_prev->v]; const float *v_curr = sys->vertexCos[l_curr->v]; const float *v_next = sys->vertexCos[l_next->v]; - const unsigned int l_curr_index = l_curr - sys->mloop; + const uint l_curr_index = l_curr - sys->mloop; sys->numNeFa[l_curr->v] += 1; @@ -274,7 +274,7 @@ static void init_laplacian_matrix(LaplacianSystem *sys) static void fill_laplacian_matrix(LaplacianSystem *sys) { int i; - unsigned int idv1, idv2; + uint idv1, idv2; for (i = 0; i < sys->numPolys; i++) { const MPoly *mp = &sys->mpoly[i]; @@ -284,7 +284,7 @@ static void fill_laplacian_matrix(LaplacianSystem *sys) const MLoop *l_curr = l_term - 1; for (; l_next != l_term; l_prev = l_curr, l_curr = l_next, l_next++) { - const unsigned int l_curr_index = l_curr - sys->mloop; + const uint l_curr_index = l_curr - sys->mloop; /* Is ring if number of faces == number of edges around vertice*/ if (sys->numNeEd[l_curr->v] == sys->numNeFa[l_curr->v] && sys->zerola[l_curr->v] == 0) { diff --git a/source/blender/modifiers/intern/MOD_mask.c b/source/blender/modifiers/intern/MOD_mask.c index df8f68862e6..cf7d227e898 100644 --- a/source/blender/modifiers/intern/MOD_mask.c +++ b/source/blender/modifiers/intern/MOD_mask.c @@ -160,7 +160,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes * (including selected matches only): * key = oldindex, value = newindex */ - vertHash = BLI_ghash_int_new_ex("mask vert gh", (unsigned int)maxVerts); + vertHash = BLI_ghash_int_new_ex("mask vert gh", (uint)maxVerts); /* add vertices which exist in vertexgroups into vertHash for filtering * - dv = for each vertex, what vertexgroups does it belong to @@ -204,7 +204,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes } /* hashes for quickly providing a mapping from old to new - use key=oldindex, value=newindex */ - vertHash = BLI_ghash_int_new_ex("mask vert2 bh", (unsigned int)maxVerts); + vertHash = BLI_ghash_int_new_ex("mask vert2 bh", (uint)maxVerts); /* add vertices which exist in vertexgroup into ghash for filtering */ for (i = 0, dv = dvert; i < maxVerts; i++, dv++) { @@ -220,8 +220,8 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes } /* hashes for quickly providing a mapping from old to new - use key=oldindex, value=newindex */ - edgeHash = BLI_ghash_int_new_ex("mask ed2 gh", (unsigned int)maxEdges); - polyHash = BLI_ghash_int_new_ex("mask fa2 gh", (unsigned int)maxPolys); + edgeHash = BLI_ghash_int_new_ex("mask ed2 gh", (uint)maxEdges); + polyHash = BLI_ghash_int_new_ex("mask fa2 gh", (uint)maxPolys); mvert_src = mesh->mvert; medge_src = mesh->medge; diff --git a/source/blender/modifiers/intern/MOD_meshcache_mdd.c b/source/blender/modifiers/intern/MOD_meshcache_mdd.c index 16a118522c5..a3ab0120ff9 100644 --- a/source/blender/modifiers/intern/MOD_meshcache_mdd.c +++ b/source/blender/modifiers/intern/MOD_meshcache_mdd.c @@ -168,7 +168,7 @@ bool MOD_meshcache_read_mdd_index(FILE *fp, if (factor >= 1.0f) { #if 1 float *vco = *vertexCos; - unsigned int i; + uint i; for (i = mdd_head.verts_tot; i != 0; i--, vco += 3) { fread(vco, sizeof(float) * 3, 1, fp); @@ -192,7 +192,7 @@ bool MOD_meshcache_read_mdd_index(FILE *fp, else { const float ifactor = 1.0f - factor; float *vco = *vertexCos; - unsigned int i; + uint i; for (i = mdd_head.verts_tot; i != 0; i--, vco += 3) { float tvec[3]; fread(tvec, sizeof(float) * 3, 1, fp); diff --git a/source/blender/modifiers/intern/MOD_meshcache_pc2.c b/source/blender/modifiers/intern/MOD_meshcache_pc2.c index 97a8635ac9e..7b8ad0bd705 100644 --- a/source/blender/modifiers/intern/MOD_meshcache_pc2.c +++ b/source/blender/modifiers/intern/MOD_meshcache_pc2.c @@ -153,7 +153,7 @@ bool MOD_meshcache_read_pc2_index(FILE *fp, if (factor >= 1.0f) { float *vco = *vertexCos; - unsigned int i; + uint i; for (i = pc2_head.verts_tot; i != 0; i--, vco += 3) { fread(vco, sizeof(float) * 3, 1, fp); @@ -167,7 +167,7 @@ bool MOD_meshcache_read_pc2_index(FILE *fp, else { const float ifactor = 1.0f - factor; float *vco = *vertexCos; - unsigned int i; + uint i; for (i = pc2_head.verts_tot; i != 0; i--, vco += 3) { float tvec[3]; fread(tvec, sizeof(float) * 3, 1, fp); diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c index ac47422fe2f..773cbf72d5b 100644 --- a/source/blender/modifiers/intern/MOD_screw.c +++ b/source/blender/modifiers/intern/MOD_screw.c @@ -46,18 +46,18 @@ /* used for gathering edge connectivity */ typedef struct ScrewVertConnect { - float dist; /* distance from the center axis */ - float co[3]; /* location relative to the transformed axis */ - float no[3]; /* calc normal of the vertex */ - unsigned int v[2]; /* 2 verts on either side of this one */ - MEdge *e[2]; /* edges on either side, a bit of a waste since each edge ref's 2 edges */ + float dist; /* distance from the center axis */ + float co[3]; /* location relative to the transformed axis */ + float no[3]; /* calc normal of the vertex */ + uint v[2]; /* 2 verts on either side of this one */ + MEdge *e[2]; /* edges on either side, a bit of a waste since each edge ref's 2 edges */ char flag; } ScrewVertConnect; typedef struct ScrewVertIter { ScrewVertConnect *v_array; ScrewVertConnect *v_poin; - unsigned int v, v_other; + uint v, v_other; MEdge *e; } ScrewVertIter; @@ -67,8 +67,8 @@ typedef struct ScrewVertIter { static void screwvert_iter_init(ScrewVertIter *iter, ScrewVertConnect *array, - unsigned int v_init, - unsigned int dir) + uint v_init, + uint dir) { iter->v_array = array; iter->v = v_init; @@ -187,10 +187,10 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes int *origindex; int mpoly_index = 0; - unsigned int step; - unsigned int i, j; - unsigned int i1, i2; - unsigned int step_tot = use_render_params ? ltmd->render_steps : ltmd->steps; + uint step; + uint i, j; + uint i1, i2; + uint step_tot = use_render_params ? ltmd->render_steps : ltmd->steps; const bool do_flip = (ltmd->flag & MOD_SCREW_NORMAL_FLIP) != 0; const int quad_ord[4] = { @@ -206,17 +206,16 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes 3, }; - unsigned int maxVerts = 0, maxEdges = 0, maxPolys = 0; - const unsigned int totvert = (unsigned int)mesh->totvert; - const unsigned int totedge = (unsigned int)mesh->totedge; - const unsigned int totpoly = (unsigned int)mesh->totpoly; + uint maxVerts = 0, maxEdges = 0, maxPolys = 0; + const uint totvert = (uint)mesh->totvert; + const uint totedge = (uint)mesh->totedge; + const uint totpoly = (uint)mesh->totpoly; - unsigned int *edge_poly_map = NULL; /* orig edge to orig poly */ - unsigned int *vert_loop_map = NULL; /* orig vert to orig loop */ + uint *edge_poly_map = NULL; /* orig edge to orig poly */ + uint *vert_loop_map = NULL; /* orig vert to orig loop */ /* UV Coords */ - const unsigned int mloopuv_layers_tot = (unsigned int)CustomData_number_of_layers(&mesh->ldata, - CD_MLOOPUV); + const uint mloopuv_layers_tot = (uint)CustomData_number_of_layers(&mesh->ldata, CD_MLOOPUV); MLoopUV **mloopuv_layers = BLI_array_alloca(mloopuv_layers, mloopuv_layers_tot); float uv_u_scale; float uv_v_minmax[2] = {FLT_MAX, -FLT_MAX}; @@ -235,11 +234,11 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes float mtx_tx_inv[4][4]; /* inverted */ float mtx_tmp_a[4][4]; - unsigned int vc_tot_linked = 0; + uint vc_tot_linked = 0; short other_axis_1, other_axis_2; const float *tmpf1, *tmpf2; - unsigned int edge_offset; + uint edge_offset; MPoly *mpoly_orig, *mpoly_new, *mp_new; MLoop *mloop_orig, *mloop_new, *ml_new; @@ -409,7 +408,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes } if (mloopuv_layers_tot) { - unsigned int uv_lay; + uint uv_lay; for (uv_lay = 0; uv_lay < mloopuv_layers_tot; uv_lay++) { mloopuv_layers[uv_lay] = CustomData_get_layer_n(&result->ldata, CD_MLOOPUV, (int)uv_lay); } @@ -460,18 +459,18 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes memset(vert_loop_map, 0xff, sizeof(*vert_loop_map) * totvert); for (i = 0, mp_orig = mpoly_orig; i < totpoly; i++, mp_orig++) { - unsigned int loopstart = (unsigned int)mp_orig->loopstart; - unsigned int loopend = loopstart + (unsigned int)mp_orig->totloop; + uint loopstart = (uint)mp_orig->loopstart; + uint loopend = loopstart + (uint)mp_orig->totloop; MLoop *ml_orig = &mloop_orig[loopstart]; - unsigned int k; + uint k; for (k = loopstart; k < loopend; k++, ml_orig++) { edge_poly_map[ml_orig->e] = i; vert_loop_map[ml_orig->v] = k; /* also order edges based on faces */ if (medge_new[ml_orig->e].v1 != ml_orig->v) { - SWAP(unsigned int, medge_new[ml_orig->e].v1, medge_new[ml_orig->e].v2); + SWAP(uint, medge_new[ml_orig->e].v1, medge_new[ml_orig->e].v2); } } } @@ -596,7 +595,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes * so resulting faces are flipped the right way */ vc_tot_linked = 0; /* count the number of linked verts for this loop */ if (vc->flag == 0) { - unsigned int v_best = SV_UNUSED, ed_loop_closed = 0; /* vert and vert new */ + uint v_best = SV_UNUSED, ed_loop_closed = 0; /* vert and vert new */ ScrewVertIter lt_iter; float fl = -1.0f; @@ -731,7 +730,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes if (lt_iter.v == lt_iter.e->v1) { if (ed_loop_flip == 0) { /*printf("\t\t\tFlipping 0\n");*/ - SWAP(unsigned int, lt_iter.e->v1, lt_iter.e->v2); + SWAP(uint, lt_iter.e->v1, lt_iter.e->v2); } #if 0 else { @@ -742,7 +741,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes else if (lt_iter.v == lt_iter.e->v2) { if (ed_loop_flip == 1) { /*printf("\t\t\tFlipping 1\n");*/ - SWAP(unsigned int, lt_iter.e->v1, lt_iter.e->v2); + SWAP(uint, lt_iter.e->v1, lt_iter.e->v2); } #if 0 else { @@ -851,7 +850,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes /* Add Faces */ for (step = 1; step < step_tot; step++) { - const unsigned int varray_stride = totvert * step; + const uint varray_stride = totvert * step; float step_angle; float nor_tx[3]; float mat[4][4]; @@ -921,7 +920,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes if (close) { /* last loop of edges, previous loop doesn't account for the last set of edges */ - const unsigned int varray_stride = (step_tot - 1) * totvert; + const uint varray_stride = (step_tot - 1) * totvert; for (i = 0; i < totvert; i++) { med_new->v1 = i; @@ -942,12 +941,12 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes edge_offset = totedge + (totvert * (step_tot - (close ? 0 : 1))); for (i = 0; i < totedge; i++, med_new_firstloop++) { - const unsigned int step_last = step_tot - (close ? 1 : 2); - const unsigned int mpoly_index_orig = totpoly ? edge_poly_map[i] : UINT_MAX; + const uint step_last = step_tot - (close ? 1 : 2); + const uint mpoly_index_orig = totpoly ? edge_poly_map[i] : UINT_MAX; const bool has_mpoly_orig = (mpoly_index_orig != UINT_MAX); float uv_v_offset_a, uv_v_offset_b; - const unsigned int mloop_index_orig[2] = { + const uint mloop_index_orig[2] = { vert_loop_map ? vert_loop_map[medge_new[i].v1] : UINT_MAX, vert_loop_map ? vert_loop_map[medge_new[i].v2] : UINT_MAX, }; @@ -1006,7 +1005,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes &mesh->ldata, &result->ldata, (int)mloop_index_orig[0], l_index + 3, 1); if (mloopuv_layers_tot) { - unsigned int uv_lay; + uint uv_lay; const float uv_u_offset_a = (float)(step)*uv_u_scale; const float uv_u_offset_b = (float)(step + 1) * uv_u_scale; for (uv_lay = 0; uv_lay < mloopuv_layers_tot; uv_lay++) { @@ -1023,7 +1022,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes if (mloopuv_layers_tot) { int l_index = (int)(ml_new - mloop_new); - unsigned int uv_lay; + uint uv_lay; const float uv_u_offset_a = (float)(step)*uv_u_scale; const float uv_u_offset_b = (float)(step + 1) * uv_u_scale; for (uv_lay = 0; uv_lay < mloopuv_layers_tot; uv_lay++) { @@ -1094,7 +1093,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes unsigned i = 0; printf("\n"); for (; i < maxPolys * 4; i += 4) { - unsigned int ii; + uint ii; ml_new = mloop_new + i; ii = findEd(medge_new, maxEdges, ml_new[0].v, ml_new[1].v); printf("%d %d -- ", ii, ml_new[0].e); diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c index f11e4e4d77a..6ba834c6934 100644 --- a/source/blender/modifiers/intern/MOD_skin.c +++ b/source/blender/modifiers/intern/MOD_skin.c @@ -103,7 +103,7 @@ typedef struct Frame { int corner; /* checked to avoid chaining. * (merging when we're already been referenced), see T39775 */ - unsigned int is_target : 1; + uint is_target : 1; } merge[4]; /* For hull frames, whether each vertex is detached or not */ diff --git a/source/blender/modifiers/intern/MOD_smooth.c b/source/blender/modifiers/intern/MOD_smooth.c index 59d5b2ccbd2..3542df24f49 100644 --- a/source/blender/modifiers/intern/MOD_smooth.c +++ b/source/blender/modifiers/intern/MOD_smooth.c @@ -85,14 +85,14 @@ static void smoothModifier_do( MEdge *medges = NULL; int i, j, numDMEdges, defgrp_index; - unsigned char *uctmp; + uchar *uctmp; float *ftmp, fac, facm; ftmp = (float *)MEM_calloc_arrayN(numVerts, 3 * sizeof(float), "smoothmodifier_f"); if (!ftmp) { return; } - uctmp = (unsigned char *)MEM_calloc_arrayN(numVerts, sizeof(unsigned char), "smoothmodifier_uc"); + uctmp = (uchar *)MEM_calloc_arrayN(numVerts, sizeof(uchar), "smoothmodifier_uc"); if (!uctmp) { if (ftmp) { MEM_freeN(ftmp); @@ -120,7 +120,7 @@ static void smoothModifier_do( for (i = 0; i < numDMEdges; i++) { float fvec[3]; float *v1, *v2; - unsigned int idx1, idx2; + uint idx1, idx2; idx1 = medges[i].v1; idx2 = medges[i].v2; @@ -204,7 +204,7 @@ static void smoothModifier_do( } memset(ftmp, 0, 3 * sizeof(float) * numVerts); - memset(uctmp, 0, sizeof(unsigned char) * numVerts); + memset(uctmp, 0, sizeof(uchar) * numVerts); } MEM_freeN(ftmp); diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c index 05bcc7f695d..292e659fe03 100644 --- a/source/blender/modifiers/intern/MOD_solidify.c +++ b/source/blender/modifiers/intern/MOD_solidify.c @@ -198,11 +198,11 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes MEdge *ed, *medge, *orig_medge; MLoop *ml, *mloop, *orig_mloop; MPoly *mp, *mpoly, *orig_mpoly; - const unsigned int numVerts = (unsigned int)mesh->totvert; - const unsigned int numEdges = (unsigned int)mesh->totedge; - const unsigned int numPolys = (unsigned int)mesh->totpoly; - const unsigned int numLoops = (unsigned int)mesh->totloop; - unsigned int newLoops = 0, newPolys = 0, newEdges = 0, newVerts = 0, rimVerts = 0; + const uint numVerts = (uint)mesh->totvert; + const uint numEdges = (uint)mesh->totedge; + const uint numPolys = (uint)mesh->totpoly; + const uint numLoops = (uint)mesh->totloop; + uint newLoops = 0, newPolys = 0, newEdges = 0, newVerts = 0, rimVerts = 0; /* only use material offsets if we have 2 or more materials */ const short mat_nr_max = ctx->object->totcol > 1 ? ctx->object->totcol - 1 : 0; @@ -211,16 +211,16 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes /* use for edges */ /* over-alloc new_vert_arr, old_vert_arr */ - unsigned int *new_vert_arr = NULL; + uint *new_vert_arr = NULL; STACK_DECLARE(new_vert_arr); - unsigned int *new_edge_arr = NULL; + uint *new_edge_arr = NULL; STACK_DECLARE(new_edge_arr); - unsigned int *old_vert_arr = MEM_calloc_arrayN( + uint *old_vert_arr = MEM_calloc_arrayN( numVerts, sizeof(*old_vert_arr), "old_vert_arr in solidify"); - unsigned int *edge_users = NULL; + uint *edge_users = NULL; char *edge_order = NULL; float(*vert_nors)[3] = NULL; @@ -244,7 +244,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes int defgrp_index; /* array size is doubled in case of using a shell */ - const unsigned int stride = do_shell ? 2 : 1; + const uint stride = do_shell ? 2 : 1; MOD_get_vgroup(ctx->object, mesh, smd->defgrp_name, &dvert, &defgrp_index); @@ -272,11 +272,11 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes if (smd->flag & MOD_SOLIDIFY_RIM) { BLI_bitmap *orig_mvert_tag = BLI_BITMAP_NEW(numVerts, __func__); - unsigned int eidx; - unsigned int i; + uint eidx; + uint i; -#define INVALID_UNUSED ((unsigned int)-1) -#define INVALID_PAIR ((unsigned int)-2) +#define INVALID_UNUSED ((uint)-1) +#define INVALID_PAIR ((uint)-2) new_vert_arr = MEM_malloc_arrayN(numVerts, 2 * sizeof(*new_vert_arr), __func__); new_edge_arr = MEM_malloc_arrayN(((numEdges * 2) + numVerts), sizeof(*new_edge_arr), __func__); @@ -442,13 +442,13 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes /* flip normals */ if (do_shell) { - unsigned int i; + uint i; mp = mpoly + numPolys; for (i = 0; i < mesh->totpoly; i++, mp++) { const int loop_end = mp->totloop - 1; MLoop *ml2; - unsigned int e; + uint e; int j; /* reverses the loop direction (MLoop.v as well as custom-data) @@ -512,7 +512,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes const float offset_sq = offset * offset; if (do_clamp) { - unsigned int i; + uint i; vert_lens = MEM_malloc_arrayN(numVerts, sizeof(float), "vert_lens"); copy_vn_fl(vert_lens, (int)numVerts, FLT_MAX); @@ -524,7 +524,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes } if (ofs_new != 0.0f) { - unsigned int i_orig, i_end; + uint i_orig, i_end; bool do_shell_align; scalar_short = scalar_short_vgroup = ofs_new / 32767.0f; @@ -532,7 +532,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes INIT_VERT_ARRAY_OFFSETS(false); for (i_orig = 0; i_orig < i_end; i_orig++, mv++) { - const unsigned int i = do_shell_align ? i_orig : new_vert_arr[i_orig]; + const uint i = do_shell_align ? i_orig : new_vert_arr[i_orig]; if (dvert) { MDeformVert *dv = &dvert[i]; if (defgrp_invert) { @@ -559,7 +559,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes } if (ofs_orig != 0.0f) { - unsigned int i_orig, i_end; + uint i_orig, i_end; bool do_shell_align; scalar_short = scalar_short_vgroup = ofs_orig / 32767.0f; @@ -568,7 +568,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes INIT_VERT_ARRAY_OFFSETS(true); for (i_orig = 0; i_orig < i_end; i_orig++, mv++) { - const unsigned int i = do_shell_align ? i_orig : new_vert_arr[i_orig]; + const uint i = do_shell_align ? i_orig : new_vert_arr[i_orig]; if (dvert) { MDeformVert *dv = &dvert[i]; if (defgrp_invert) { @@ -606,8 +606,8 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes float *vert_angles = MEM_calloc_arrayN( numVerts, 2 * sizeof(float), "mod_solid_pair"); /* 2 in 1 */ float *vert_accum = vert_angles + numVerts; - unsigned int vidx; - unsigned int i; + uint vidx; + uint i; if (vert_nors == NULL) { vert_nors = MEM_malloc_arrayN(numVerts, 3 * sizeof(float), "mod_solid_vno"); @@ -707,13 +707,13 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes } if (ofs_new != 0.0f) { - unsigned int i_orig, i_end; + uint i_orig, i_end; bool do_shell_align; INIT_VERT_ARRAY_OFFSETS(false); for (i_orig = 0; i_orig < i_end; i_orig++, mv++) { - const unsigned int i_other = do_shell_align ? i_orig : new_vert_arr[i_orig]; + const uint i_other = do_shell_align ? i_orig : new_vert_arr[i_orig]; if (vert_accum[i_other]) { /* zero if unselected */ madd_v3_v3fl( mv->co, vert_nors[i_other], ofs_new * (vert_angles[i_other] / vert_accum[i_other])); @@ -722,14 +722,14 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes } if (ofs_orig != 0.0f) { - unsigned int i_orig, i_end; + uint i_orig, i_end; bool do_shell_align; /* same as above but swapped, intentional use of 'ofs_new' */ INIT_VERT_ARRAY_OFFSETS(true); for (i_orig = 0; i_orig < i_end; i_orig++, mv++) { - const unsigned int i_other = do_shell_align ? i_orig : new_vert_arr[i_orig]; + const uint i_other = do_shell_align ? i_orig : new_vert_arr[i_orig]; if (vert_accum[i_other]) { /* zero if unselected */ madd_v3_v3fl( mv->co, vert_nors[i_other], ofs_orig * (vert_angles[i_other] / vert_accum[i_other])); @@ -749,7 +749,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes result->runtime.cd_dirty_vert |= CD_MASK_NORMAL; } else if (do_shell) { - unsigned int i; + uint i; /* flip vertex normals for copied verts */ mv = mvert + numVerts; for (i = 0; i < numVerts; i++, mv++) { @@ -758,7 +758,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes } if (smd->flag & MOD_SOLIDIFY_RIM) { - unsigned int i; + uint i; /* bugger, need to re-calculate the normals for the new edge faces. * This could be done in many ways, but probably the quickest way @@ -781,13 +781,13 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes NULL; float nor[3]; #endif - const unsigned char crease_rim = smd->crease_rim * 255.0f; - const unsigned char crease_outer = smd->crease_outer * 255.0f; - const unsigned char crease_inner = smd->crease_inner * 255.0f; + const uchar crease_rim = smd->crease_rim * 255.0f; + const uchar crease_outer = smd->crease_outer * 255.0f; + const uchar crease_inner = smd->crease_inner * 255.0f; int *origindex_edge; int *orig_ed; - unsigned int j; + uint j; if (crease_rim || crease_outer || crease_inner) { result->cd_flag |= ME_CDFLAG_EDGE_CREASE; @@ -817,8 +817,8 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes ml = mloop + (numLoops * stride); j = 0; for (i = 0; i < newPolys; i++, mp++) { - unsigned int eidx = new_edge_arr[i]; - unsigned int pidx = edge_users[eidx]; + uint eidx = new_edge_arr[i]; + uint pidx = edge_users[eidx]; int k1, k2; bool flip; diff --git a/source/blender/modifiers/intern/MOD_surface.c b/source/blender/modifiers/intern/MOD_surface.c index 840914aa313..97e6bb9e804 100644 --- a/source/blender/modifiers/intern/MOD_surface.c +++ b/source/blender/modifiers/intern/MOD_surface.c @@ -125,7 +125,7 @@ static void deformVerts(ModifierData *md, } if (surmd->mesh) { - unsigned int numverts = 0, i = 0; + uint numverts = 0, i = 0; int init = 0; float *vec; MVert *x, *v; diff --git a/source/blender/modifiers/intern/MOD_surfacedeform.c b/source/blender/modifiers/intern/MOD_surfacedeform.c index b34688d27d6..de32b90a5e3 100644 --- a/source/blender/modifiers/intern/MOD_surfacedeform.c +++ b/source/blender/modifiers/intern/MOD_surfacedeform.c @@ -45,16 +45,16 @@ typedef struct SDefAdjacency { struct SDefAdjacency *next; - unsigned int index; + uint index; } SDefAdjacency; typedef struct SDefAdjacencyArray { SDefAdjacency *first; - unsigned int num; /* Careful, this is twice the number of polygons (avoids an extra loop) */ + uint num; /* Careful, this is twice the number of polygons (avoids an extra loop) */ } SDefAdjacencyArray; typedef struct SDefEdgePolys { - unsigned int polys[2], num; + uint polys[2], num; } SDefEdgePolys; typedef struct SDefBindCalcData { @@ -90,20 +90,20 @@ typedef struct SDefBindPoly { float point_edgemid_angles[2]; float corner_edgemid_angles[2]; float dominant_angle_weight; - unsigned int index; - unsigned int numverts; - unsigned int loopstart; - unsigned int edge_inds[2]; - unsigned int edge_vert_inds[2]; - unsigned int corner_ind; - unsigned int dominant_edge; + uint index; + uint numverts; + uint loopstart; + uint edge_inds[2]; + uint edge_vert_inds[2]; + uint corner_ind; + uint dominant_edge; bool inside; } SDefBindPoly; typedef struct SDefBindWeightData { SDefBindPoly *bind_polys; - unsigned int numpoly; - unsigned int numbinds; + uint numpoly; + uint numbinds; } SDefBindWeightData; typedef struct SDefDeformData { @@ -217,8 +217,8 @@ static void freeAdjacencyMap(SDefAdjacencyArray *const vert_edges, static int buildAdjacencyMap(const MPoly *poly, const MEdge *edge, const MLoop *const mloop, - const unsigned int numpoly, - const unsigned int numedges, + const uint numpoly, + const uint numedges, SDefAdjacencyArray *const vert_edges, SDefAdjacency *adj, SDefEdgePolys *const edge_polys) @@ -263,10 +263,10 @@ static int buildAdjacencyMap(const MPoly *poly, return MOD_SDEF_BIND_RESULT_SUCCESS; } -BLI_INLINE void sortPolyVertsEdge(unsigned int *indices, +BLI_INLINE void sortPolyVertsEdge(uint *indices, const MLoop *const mloop, - const unsigned int edge, - const unsigned int num) + const uint edge, + const uint num) { bool found = false; @@ -287,10 +287,10 @@ BLI_INLINE void sortPolyVertsEdge(unsigned int *indices, } } -BLI_INLINE void sortPolyVertsTri(unsigned int *indices, +BLI_INLINE void sortPolyVertsTri(uint *indices, const MLoop *const mloop, - const unsigned int loopstart, - const unsigned int num) + const uint loopstart, + const uint num) { for (int i = loopstart; i < num; i++) { *indices = mloop[i].v; @@ -303,7 +303,7 @@ BLI_INLINE void sortPolyVertsTri(unsigned int *indices, } } -BLI_INLINE unsigned int nearestVert(SDefBindCalcData *const data, const float point_co[3]) +BLI_INLINE uint nearestVert(SDefBindCalcData *const data, const float point_co[3]) { BVHTreeNearest nearest = { .dist_sq = FLT_MAX, @@ -315,7 +315,7 @@ BLI_INLINE unsigned int nearestVert(SDefBindCalcData *const data, const float po float t_point[3]; float max_dist = FLT_MAX; float dist; - unsigned int index = 0; + uint index = 0; mul_v3_m4v3(t_point, data->imat, point_co); @@ -346,7 +346,7 @@ BLI_INLINE unsigned int nearestVert(SDefBindCalcData *const data, const float po } } -BLI_INLINE int isPolyValid(const float coords[][2], const unsigned int nr) +BLI_INLINE int isPolyValid(const float coords[][2], const uint nr) { float prev_co[2]; float curr_vec[2], prev_vec[2]; @@ -408,7 +408,7 @@ BLI_INLINE float computeAngularWeight(const float point_angle, const float edgem BLI_INLINE SDefBindWeightData *computeBindWeights(SDefBindCalcData *const data, const float point_co[3]) { - const unsigned int nearest = nearestVert(data, point_co); + const uint nearest = nearestVert(data, point_co); const SDefAdjacency *const vert_edges = data->vert_edges[nearest].first; const SDefEdgePolys *const edge_polys = data->edge_polys; @@ -444,7 +444,7 @@ BLI_INLINE SDefBindWeightData *computeBindWeights(SDefBindCalcData *const data, /* Loop over all adjacent edges, * and build the SDefBindPoly data for each poly adjacent to those. */ for (vedge = vert_edges; vedge; vedge = vedge->next) { - unsigned int edge_ind = vedge->index; + uint edge_ind = vedge->index; for (int i = 0; i < edge_polys[edge_ind].num; i++) { { @@ -603,8 +603,8 @@ BLI_INLINE SDefBindWeightData *computeBindWeights(SDefBindCalcData *const data, SDefBindPoly *bpolys[2]; const SDefEdgePolys *epolys; float ang_weights[2]; - unsigned int edge_ind = vedge->index; - unsigned int edge_on_poly[2]; + uint edge_ind = vedge->index; + uint edge_on_poly[2]; epolys = &edge_polys[edge_ind]; @@ -981,9 +981,9 @@ static void bindVert(void *__restrict userdata, static bool surfacedeformBind(SurfaceDeformModifierData *smd, float (*vertexCos)[3], - unsigned int numverts, - unsigned int tnumpoly, - unsigned int tnumverts, + uint numverts, + uint tnumpoly, + uint tnumverts, Mesh *target) { BVHTreeFromMesh treeData = {NULL}; @@ -991,7 +991,7 @@ static bool surfacedeformBind(SurfaceDeformModifierData *smd, const MPoly *mpoly = target->mpoly; const MEdge *medge = target->medge; const MLoop *mloop = target->mloop; - unsigned int tnumedges = target->totedge; + uint tnumedges = target->totedge; int adj_result; SDefAdjacencyArray *vert_edges; SDefAdjacency *adj_array; @@ -1173,12 +1173,12 @@ static void deformVert(void *__restrict userdata, static void surfacedeformModifier_do(ModifierData *md, const ModifierEvalContext *ctx, float (*vertexCos)[3], - unsigned int numverts, + uint numverts, Object *ob) { SurfaceDeformModifierData *smd = (SurfaceDeformModifierData *)md; Mesh *target; - unsigned int tnumverts, tnumpoly; + uint tnumverts, tnumpoly; /* Exit function if bind flag is not set (free bind data if any). */ if (!(smd->flags & MOD_SDEF_BIND)) { diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c index 98497a76668..36e712a1958 100644 --- a/source/blender/modifiers/intern/MOD_util.c +++ b/source/blender/modifiers/intern/MOD_util.c @@ -109,11 +109,11 @@ void MOD_get_texture_coords(MappingInfoModifierData *dmd, /* verts are given the UV from the first face that uses them */ for (i = 0, mp = mpoly; i < numPolys; i++, mp++) { - unsigned int fidx = mp->totloop - 1; + uint fidx = mp->totloop - 1; do { - unsigned int lidx = mp->loopstart + fidx; - unsigned int vidx = mloop[lidx].v; + uint lidx = mp->loopstart + fidx; + uint vidx = mloop[lidx].v; if (!BLI_BITMAP_TEST(done, vidx)) { /* remap UVs from [0, 1] to [-1, 1] */ diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c index b31e0832123..9698e150850 100644 --- a/source/blender/modifiers/intern/MOD_uvproject.c +++ b/source/blender/modifiers/intern/MOD_uvproject.c @@ -225,19 +225,19 @@ static Mesh *uvprojectModifier_do(UVProjectModifierData *umd, for (i = 0, mp = mpoly; i < numPolys; i++, mp++) { if (num_projectors == 1) { if (projectors[0].uci) { - unsigned int fidx = mp->totloop - 1; + uint fidx = mp->totloop - 1; do { - unsigned int lidx = mp->loopstart + fidx; - unsigned int vidx = mloop[lidx].v; + uint lidx = mp->loopstart + fidx; + uint vidx = mloop[lidx].v; BLI_uvproject_from_camera(mloop_uv[lidx].uv, coords[vidx], projectors[0].uci); } while (fidx--); } else { /* apply transformed coords as UVs */ - unsigned int fidx = mp->totloop - 1; + uint fidx = mp->totloop - 1; do { - unsigned int lidx = mp->loopstart + fidx; - unsigned int vidx = mloop[lidx].v; + uint lidx = mp->loopstart + fidx; + uint vidx = mloop[lidx].v; copy_v2_v2(mloop_uv[lidx].uv, coords[vidx]); } while (fidx--); } @@ -268,18 +268,18 @@ static Mesh *uvprojectModifier_do(UVProjectModifierData *umd, } if (best_projector->uci) { - unsigned int fidx = mp->totloop - 1; + uint fidx = mp->totloop - 1; do { - unsigned int lidx = mp->loopstart + fidx; - unsigned int vidx = mloop[lidx].v; + uint lidx = mp->loopstart + fidx; + uint vidx = mloop[lidx].v; BLI_uvproject_from_camera(mloop_uv[lidx].uv, coords[vidx], best_projector->uci); } while (fidx--); } else { - unsigned int fidx = mp->totloop - 1; + uint fidx = mp->totloop - 1; do { - unsigned int lidx = mp->loopstart + fidx; - unsigned int vidx = mloop[lidx].v; + uint lidx = mp->loopstart + fidx; + uint vidx = mloop[lidx].v; mul_v2_project_m4_v3(mloop_uv[lidx].uv, best_projector->projmat, coords[vidx]); } while (fidx--); } diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c index 95b15b4a924..7e23289433f 100644 --- a/source/blender/modifiers/intern/MOD_weightvgproximity.c +++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c @@ -215,7 +215,7 @@ static void get_vert2ob_distance( { /* Vertex and ref object coordinates. */ float v_wco[3]; - unsigned int i = numVerts; + uint i = numVerts; while (i-- > 0) { /* Get world-coordinates of the vertex (constraints and anim included). */ @@ -241,7 +241,7 @@ static void do_map( Object *ob, float *weights, const int nidx, const float min_d, const float max_d, short mode) { const float range_inv = 1.0f / (max_d - min_d); /* invert since multiplication is faster */ - unsigned int i = nidx; + uint i = nidx; if (max_d == min_d) { while (i-- > 0) { weights[i] = (weights[i] >= max_d) ? 1.0f : 0.0f; /* "Step" behavior... */ -- cgit v1.2.3