From 600a627f6e326f4542a876e6e82f771cd3da218f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 3 Apr 2020 16:21:24 +1100 Subject: Cleanup: use abbreviated names for unsigned types in editors --- source/blender/editors/uvedit/uvedit_ops.c | 10 +++---- .../blender/editors/uvedit/uvedit_parametrizer.c | 26 ++++++++--------- .../blender/editors/uvedit/uvedit_smart_stitch.c | 34 +++++++++++----------- 3 files changed, 35 insertions(+), 35 deletions(-) (limited to 'source/blender/editors/uvedit') diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index b805681cfd3..33601de50da 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -695,7 +695,7 @@ void ED_uvedit_select_all(BMesh *bm) static bool ED_uvedit_median_multi( const Scene *scene, Image *ima, Object **objects_edit, uint objects_len, float co[2]) { - unsigned int sel = 0; + uint sel = 0; zero_v2(co); for (uint ob_index = 0; ob_index < objects_len; ob_index++) { @@ -1319,7 +1319,7 @@ static void uv_select_linked_multi(Scene *scene, UvVertMap *vmap; UvMapVert *vlist, *iterv, *startv; int i, stacksize = 0, *stack; - unsigned int a; + uint a; char *flag; BMEditMesh *em = BKE_editmesh_from_object(obedit); @@ -3261,7 +3261,7 @@ static void uv_select_tag_update_for_object(Depsgraph *depsgraph, static void uv_select_flush_from_tag_sticky_loc_internal(Scene *scene, BMEditMesh *em, UvVertMap *vmap, - const unsigned int efa_index, + const uint efa_index, BMLoop *l, const bool select, const int cd_loop_uv_offset) @@ -3361,7 +3361,7 @@ static void uv_select_flush_from_tag_face(SpaceImage *sima, else if ((ts->uv_flag & UV_SYNC_SELECTION) == 0 && sima->sticky == SI_STICKY_LOC) { struct UvVertMap *vmap; float limit[2]; - unsigned int efa_index; + uint efa_index; uvedit_pixel_to_float(sima, limit, 0.05); @@ -3448,7 +3448,7 @@ static void uv_select_flush_from_tag_loop(SpaceImage *sima, else if ((ts->uv_flag & UV_SYNC_SELECTION) == 0 && sima->sticky == SI_STICKY_LOC) { struct UvVertMap *vmap; float limit[2]; - unsigned int efa_index; + uint efa_index; uvedit_pixel_to_float(sima, limit, 0.05); diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index 936ba750266..da8e0efa522 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -107,7 +107,7 @@ typedef struct PVert { struct PEdge *edge; float co[3]; float uv[2]; - unsigned char flag; + uchar flag; } PVert; @@ -126,7 +126,7 @@ typedef struct PEdge { struct PEdge *next; struct PFace *face; float *orig_uv, old_uv[2]; - unsigned short flag; + ushort flag; } PEdge; @@ -141,7 +141,7 @@ typedef struct PFace { } u; struct PEdge *edge; - unsigned char flag; + uchar flag; } PFace; enum PVertFlag { @@ -197,7 +197,7 @@ typedef struct PChart { } pack; } u; - unsigned char flag; + uchar flag; struct PHandle *handle; } PChart; @@ -245,7 +245,7 @@ static int PHashSizes[] = { 1048583, 2097169, 4194319, 8388617, 16777259, 33554467, 67108879, 134217757, 268435459, }; -#define PHASH_hash(ph, item) (((uintptr_t)(item)) % ((unsigned int)(ph)->cursize)) +#define PHASH_hash(ph, item) (((uintptr_t)(item)) % ((uint)(ph)->cursize)) #define PHASH_edge(v1, v2) (((v1) < (v2)) ? ((v1)*39) ^ ((v2)*31) : ((v1)*31) ^ ((v2)*39)) static PHash *phash_new(PHashLink **list, int sizehint) @@ -511,7 +511,7 @@ static void p_chart_uv_transform(PChart *chart, float mat[2][2]) static void p_chart_uv_to_array(PChart *chart, float (*points)[2]) { PVert *v; - unsigned int i = 0; + uint i = 0; for (v = chart->verts; v; v = v->nextlink) { copy_v2_v2(points[i++], v->uv); @@ -521,7 +521,7 @@ static void p_chart_uv_to_array(PChart *chart, float (*points)[2]) static void UNUSED_FUNCTION(p_chart_uv_from_array)(PChart *chart, float (*points)[2]) { PVert *v; - unsigned int i = 0; + uint i = 0; for (v = chart->verts; v; v = v->nextlink) { copy_v2_v2(v->uv, points[i++]); @@ -4409,8 +4409,8 @@ static void p_add_ngon(ParamHandle *handle, PHandle *phandle = (PHandle *)handle; MemArena *arena = phandle->polyfill_arena; Heap *heap = phandle->polyfill_heap; - unsigned int nfilltri = nverts - 2; - unsigned int(*tris)[3] = BLI_memarena_alloc(arena, sizeof(*tris) * (size_t)nfilltri); + uint nfilltri = nverts - 2; + uint(*tris)[3] = BLI_memarena_alloc(arena, sizeof(*tris) * (size_t)nfilltri); float(*projverts)[2] = BLI_memarena_alloc(arena, sizeof(*projverts) * (size_t)nverts); /* Calc normal, flipped: to get a positive 2d cross product. */ @@ -4441,10 +4441,10 @@ static void p_add_ngon(ParamHandle *handle, /* Add triangles. */ for (int j = 0; j < nfilltri; j++) { - unsigned int *tri = tris[j]; - unsigned int v0 = tri[0]; - unsigned int v1 = tri[1]; - unsigned int v2 = tri[2]; + uint *tri = tris[j]; + uint v0 = tri[0]; + uint v1 = tri[1]; + uint v2 = tri[2]; ParamKey tri_vkeys[3] = {vkeys[v0], vkeys[v1], vkeys[v2]}; float *tri_co[3] = {co[v0], co[v1], co[v2]}; diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index cf23cac38a7..7f05eba7c72 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -75,20 +75,20 @@ typedef struct StitchPreviewer { /* here we'll store the preview triangle indices of the mesh */ float *preview_polys; /* uvs per polygon. */ - unsigned int *uvs_per_polygon; + uint *uvs_per_polygon; /*number of preview polygons */ - unsigned int num_polys; + uint num_polys; /* preview data. These will be either the previewed vertices or edges * depending on stitch mode settings */ float *preview_stitchable; float *preview_unstitchable; /* here we'll store the number of elements to be drawn */ - unsigned int num_stitchable; - unsigned int num_unstitchable; - unsigned int preview_uvs; + uint num_stitchable; + uint num_unstitchable; + uint preview_uvs; /* ...and here we'll store the static island triangles */ float *static_tris; - unsigned int num_static_tris; + uint num_static_tris; } StitchPreviewer; struct IslandStitchData; @@ -119,16 +119,16 @@ typedef struct IslandStitchData { /* just for averaging UVs */ typedef struct UVVertAverage { float uv[2]; - unsigned short count; + ushort count; } UVVertAverage; typedef struct UvEdge { /** index to uv buffer */ - unsigned int uv1; - unsigned int uv2; + uint uv1; + uint uv2; /** general use flag * (Used to check if edge is boundary here, and propagates to adjacency elements) */ - unsigned char flag; + uchar flag; /** element that guarantees element->face * has the edge on element->tfindex and element->tfindex+1 is the second uv */ UvElement *element; @@ -172,7 +172,7 @@ typedef struct StitchState { int selection_size; /* store number of primitives per face so that we can allocate the active island buffer later */ - unsigned int *tris_per_island; + uint *tris_per_island; /* preview data */ StitchPreviewer *stitch_preview; } StitchState; @@ -544,7 +544,7 @@ static void stitch_island_calculate_edge_rotation(UvEdge *edge, StitchStateContainer *ssc, StitchState *state, UVVertAverage *uv_average, - unsigned int *uvfinal_map, + uint *uvfinal_map, IslandStitchData *island_stitch_data) { BMesh *bm = state->em->bm; @@ -1032,7 +1032,7 @@ static int stitch_process_data(StitchStateContainer *ssc, char stitch_midpoints = ssc->midpoints; /* used to map uv indices to uvaverage indices for selection */ - unsigned int *uvfinal_map = NULL; + uint *uvfinal_map = NULL; /* per face preview position in preview buffer */ PreviewPosition *preview_position = NULL; @@ -1229,7 +1229,7 @@ static int stitch_process_data(StitchStateContainer *ssc, BMIter liter; BMLoop *l; MLoopUV *luv; - unsigned int buffer_index = 0; + uint buffer_index = 0; /* initialize the preview buffers */ preview->preview_polys = MEM_mallocN(preview->preview_uvs * sizeof(float) * 2, @@ -1575,7 +1575,7 @@ static int stitch_process_data_all(StitchStateContainer *ssc, Scene *scene, int } /* Stitch hash initialization functions */ -static unsigned int uv_edge_hash(const void *key) +static uint uv_edge_hash(const void *key) { const UvEdge *edge = key; return (BLI_ghashutil_uinthash(edge->uv2) + BLI_ghashutil_uinthash(edge->uv1)); @@ -1760,14 +1760,14 @@ static void stitch_draw(const bContext *UNUSED(C), ARegion *UNUSED(region), void for (uint ob_index = 0; ob_index < ssc->objects_len; ob_index++) { int j, index = 0; - unsigned int num_line = 0, num_tri, tri_idx = 0, line_idx = 0; + uint num_line = 0, num_tri, tri_idx = 0, line_idx = 0; StitchState *state = ssc->states[ob_index]; StitchPreviewer *stitch_preview = state->stitch_preview; GPUVertBuf *vbo, *vbo_line; float col[4]; static GPUVertFormat format = {0}; - static unsigned int pos_id; + static uint pos_id; if (format.attr_len == 0) { pos_id = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); } -- cgit v1.2.3