diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-26 03:56:05 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-26 04:33:22 +0300 |
commit | 3961d3493be9c666850e71abe6102f72d3db9332 (patch) | |
tree | 83b903f8040f6384cbd4f702546db52a02bcd3dc /source/blender/blenkernel | |
parent | 3a7dc572dc9bbad35bdff3a3aeca8eab0ccb3fb7 (diff) |
Cleanup: use 'u' prefixed integer types for brevity in C code
This also simplifies using function style casts when moving to C++.
Diffstat (limited to 'source/blender/blenkernel')
32 files changed, 195 insertions, 218 deletions
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 8c3098069c4..e85e19f04c9 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -1148,7 +1148,7 @@ static void cloth_update_springs(ClothModifierData *clmd) /* Update rest verts, for dynamically deformable cloth */ static void cloth_update_verts(Object *ob, ClothModifierData *clmd, Mesh *mesh) { - unsigned int i = 0; + uint i = 0; const MVert *mvert = BKE_mesh_verts(mesh); ClothVertex *verts = clmd->clothObject->verts; @@ -1180,9 +1180,9 @@ static void cloth_update_spring_lengths(ClothModifierData *clmd, Mesh *mesh) { Cloth *cloth = clmd->clothObject; LinkNode *search = cloth->springs; - unsigned int struct_springs = 0; - unsigned int i = 0; - unsigned int mvert_num = (unsigned int)mesh->totvert; + uint struct_springs = 0; + uint i = 0; + uint mvert_num = (uint)mesh->totvert; float shrink_factor; clmd->sim_parms->avg_spring_len = 0.0f; @@ -1373,12 +1373,12 @@ BLI_INLINE bool cloth_bend_set_poly_vert_array(int **poly, int len, const MLoop } static bool find_internal_spring_target_vertex(BVHTreeFromMesh *treedata, - unsigned int v_idx, + uint v_idx, RNG *rng, float max_length, float max_diversion, bool check_normal, - unsigned int *r_tar_v_idx) + uint *r_tar_v_idx) { float co[3], no[3], new_co[3]; float radius; @@ -1415,7 +1415,7 @@ static bool find_internal_spring_target_vertex(BVHTreeFromMesh *treedata, BLI_bvhtree_ray_cast( treedata->tree, new_co, no, radius, &rayhit, treedata->raycast_callback, treedata); - unsigned int vert_idx = -1; + uint vert_idx = -1; const MLoop *mloop = treedata->loop; const MLoopTri *lt = NULL; @@ -1429,7 +1429,7 @@ static bool find_internal_spring_target_vertex(BVHTreeFromMesh *treedata, lt = &treedata->looptri[rayhit.index]; for (int i = 0; i < 3; i++) { - unsigned int tmp_vert_idx = mloop[lt->tri[i]].v; + uint tmp_vert_idx = mloop[lt->tri[i]].v; if (tmp_vert_idx == v_idx) { /* We managed to hit ourselves. */ return false; @@ -1453,10 +1453,10 @@ static bool cloth_build_springs(ClothModifierData *clmd, Mesh *mesh) { Cloth *cloth = clmd->clothObject; ClothSpring *spring = NULL, *tspring = NULL, *tspring2 = NULL; - unsigned int struct_springs = 0, shear_springs = 0, bend_springs = 0, struct_springs_real = 0; - unsigned int mvert_num = (unsigned int)mesh->totvert; - unsigned int numedges = (unsigned int)mesh->totedge; - unsigned int numpolys = (unsigned int)mesh->totpoly; + uint struct_springs = 0, shear_springs = 0, bend_springs = 0, struct_springs_real = 0; + uint mvert_num = (uint)mesh->totvert; + uint numedges = (uint)mesh->totedge; + uint numpolys = (uint)mesh->totpoly; float shrink_factor; const MEdge *medge = BKE_mesh_edges(mesh); const MPoly *mpoly = BKE_mesh_polys(mesh); @@ -1499,7 +1499,7 @@ static bool cloth_build_springs(ClothModifierData *clmd, Mesh *mesh) if (use_internal_springs && numpolys > 0) { BVHTreeFromMesh treedata = {NULL}; - unsigned int tar_v_idx; + uint tar_v_idx; Mesh *tmp_mesh = NULL; RNG *rng; diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index dc7a4968f59..2acdc6543b5 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -1216,10 +1216,7 @@ static void hair_collision(void *__restrict userdata, } } -static void add_collision_object(ListBase *relations, - Object *ob, - int level, - unsigned int modifier_type) +static void add_collision_object(ListBase *relations, Object *ob, int level, uint modifier_type) { /* only get objects with collision modifier */ ModifierData *cmd = BKE_modifiers_findby_type(ob, modifier_type); @@ -1246,7 +1243,7 @@ static void add_collision_object(ListBase *relations, ListBase *BKE_collision_relations_create(Depsgraph *depsgraph, Collection *collection, - unsigned int modifier_type) + uint modifier_type) { const Scene *scene = DEG_get_input_scene(depsgraph); ViewLayer *view_layer = DEG_get_input_view_layer(depsgraph); @@ -1276,8 +1273,8 @@ void BKE_collision_relations_free(ListBase *relations) Object **BKE_collision_objects_create(Depsgraph *depsgraph, Object *self, Collection *collection, - unsigned int *numcollobj, - unsigned int modifier_type) + uint *numcollobj, + uint modifier_type) { ListBase *relations = DEG_get_collision_relations(depsgraph, collection, modifier_type); @@ -1549,7 +1546,7 @@ int cloth_bvh_collision( ClothVertex *verts = NULL; int ret = 0, ret2 = 0; Object **collobjs = NULL; - unsigned int numcollobj = 0; + uint numcollobj = 0; uint *coll_counts_obj = NULL; BVHTreeOverlap **overlap_obj = NULL; uint coll_count_self = 0; diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index e4c46703f8a..cc379ebb561 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -1098,8 +1098,8 @@ void BKE_curvemapping_evaluate_premulRGBF(const CurveMapping *cumap, } void BKE_curvemapping_evaluate_premulRGB(const CurveMapping *cumap, - unsigned char vecout_byte[3], - const unsigned char vecin_byte[3]) + uchar vecout_byte[3], + const uchar vecin_byte[3]) { float vecin[3], vecout[3]; @@ -1368,7 +1368,7 @@ void BKE_histogram_update_sample_line(Histogram *hist, { int i, x, y; const float *fp; - unsigned char *cp; + uchar *cp; int x1 = roundf(hist->co[0][0] * ibuf->x); int x2 = roundf(hist->co[1][0] * ibuf->x); @@ -1432,7 +1432,7 @@ void BKE_histogram_update_sample_line(Histogram *hist, hist->data_a[i] = rgba[3]; } else if (ibuf->rect) { - cp = (unsigned char *)(ibuf->rect + y * ibuf->x + x); + cp = (uchar *)(ibuf->rect + y * ibuf->x + x); hist->data_luma[i] = (float)IMB_colormanagement_get_luminance_byte(cp) / 255.0f; hist->data_r[i] = (float)cp[0] / 255.0f; hist->data_g[i] = (float)cp[1] / 255.0f; @@ -1452,16 +1452,16 @@ typedef struct ScopesUpdateData { Scopes *scopes; const ImBuf *ibuf; struct ColormanageProcessor *cm_processor; - const unsigned char *display_buffer; + const uchar *display_buffer; const int ycc_mode; } ScopesUpdateData; typedef struct ScopesUpdateDataChunk { - unsigned int bin_lum[256]; - unsigned int bin_r[256]; - unsigned int bin_g[256]; - unsigned int bin_b[256]; - unsigned int bin_a[256]; + uint bin_lum[256]; + uint bin_r[256]; + uint bin_g[256]; + uint bin_b[256]; + uint bin_a[256]; float min[3], max[3]; } ScopesUpdateDataChunk; @@ -1474,20 +1474,20 @@ static void scopes_update_cb(void *__restrict userdata, Scopes *scopes = data->scopes; const ImBuf *ibuf = data->ibuf; struct ColormanageProcessor *cm_processor = data->cm_processor; - const unsigned char *display_buffer = data->display_buffer; + const uchar *display_buffer = data->display_buffer; const int ycc_mode = data->ycc_mode; ScopesUpdateDataChunk *data_chunk = tls->userdata_chunk; - unsigned int *bin_lum = data_chunk->bin_lum; - unsigned int *bin_r = data_chunk->bin_r; - unsigned int *bin_g = data_chunk->bin_g; - unsigned int *bin_b = data_chunk->bin_b; - unsigned int *bin_a = data_chunk->bin_a; + uint *bin_lum = data_chunk->bin_lum; + uint *bin_r = data_chunk->bin_r; + uint *bin_g = data_chunk->bin_g; + uint *bin_b = data_chunk->bin_b; + uint *bin_a = data_chunk->bin_a; float *min = data_chunk->min; float *max = data_chunk->max; const float *rf = NULL; - const unsigned char *rc = NULL; + const uchar *rc = NULL; const int rows_per_sample_line = ibuf->y / scopes->sample_lines; const int savedlines = y / rows_per_sample_line; const bool do_sample_line = (savedlines < scopes->sample_lines) && @@ -1571,16 +1571,16 @@ static void scopes_update_reduce(const void *__restrict UNUSED(userdata), ScopesUpdateDataChunk *join_chunk = chunk_join; const ScopesUpdateDataChunk *data_chunk = chunk; - unsigned int *bin_lum = join_chunk->bin_lum; - unsigned int *bin_r = join_chunk->bin_r; - unsigned int *bin_g = join_chunk->bin_g; - unsigned int *bin_b = join_chunk->bin_b; - unsigned int *bin_a = join_chunk->bin_a; - const unsigned int *bin_lum_c = data_chunk->bin_lum; - const unsigned int *bin_r_c = data_chunk->bin_r; - const unsigned int *bin_g_c = data_chunk->bin_g; - const unsigned int *bin_b_c = data_chunk->bin_b; - const unsigned int *bin_a_c = data_chunk->bin_a; + uint *bin_lum = join_chunk->bin_lum; + uint *bin_r = join_chunk->bin_r; + uint *bin_g = join_chunk->bin_g; + uint *bin_b = join_chunk->bin_b; + uint *bin_a = join_chunk->bin_a; + const uint *bin_lum_c = data_chunk->bin_lum; + const uint *bin_r_c = data_chunk->bin_r; + const uint *bin_g_c = data_chunk->bin_g; + const uint *bin_b_c = data_chunk->bin_b; + const uint *bin_a_c = data_chunk->bin_a; const float *min = data_chunk->min; const float *max = data_chunk->max; @@ -1609,9 +1609,9 @@ void BKE_scopes_update(Scopes *scopes, const ColorManagedDisplaySettings *display_settings) { int a; - unsigned int nl, na, nr, ng, nb; + uint nl, na, nr, ng, nb; double divl, diva, divr, divg, divb; - const unsigned char *display_buffer = NULL; + const uchar *display_buffer = NULL; int ycc_mode = -1; void *cache_handle = NULL; struct ColormanageProcessor *cm_processor = NULL; @@ -1696,7 +1696,7 @@ void BKE_scopes_update(Scopes *scopes, cm_processor = IMB_colormanagement_display_processor_new(view_settings, display_settings); } else { - display_buffer = (const unsigned char *)IMB_display_buffer_acquire( + display_buffer = (const uchar *)IMB_display_buffer_acquire( ibuf, view_settings, display_settings, &cache_handle); } diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index cd381e15635..a6a6a1ca28f 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -2855,7 +2855,7 @@ static void actcon_get_tarmat(struct Depsgraph *depsgraph, axis = data->type - 20; } - BLI_assert((unsigned int)axis < 3); + BLI_assert((uint)axis < 3); /* Target defines the animation */ s = (vec[axis] - data->min) / (data->max - data->min); diff --git a/source/blender/blenkernel/intern/customdata_file.c b/source/blender/blenkernel/intern/customdata_file.c index cbfaf2831d1..85e88996c0a 100644 --- a/source/blender/blenkernel/intern/customdata_file.c +++ b/source/blender/blenkernel/intern/customdata_file.c @@ -310,7 +310,7 @@ bool cdf_read_layer(CDataFile *cdf, CDataFileLayer *blay) return (BLI_fseek(cdf->readf, offset, SEEK_SET) == 0); } -bool cdf_read_data(CDataFile *cdf, unsigned int size, void *data) +bool cdf_read_data(CDataFile *cdf, uint size, void *data) { /* read data */ if (!fread(data, size, 1, cdf->readf)) { @@ -384,7 +384,7 @@ bool cdf_write_layer(CDataFile *UNUSED(cdf), CDataFileLayer *UNUSED(blay)) return true; } -bool cdf_write_data(CDataFile *cdf, unsigned int size, void *data) +bool cdf_write_data(CDataFile *cdf, uint size, void *data) { /* write data */ if (!fwrite(data, size, 1, cdf->writef)) { diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c index a655e7e15c4..b5c3147b0f1 100644 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@ -865,7 +865,7 @@ int BKE_defvert_find_shared(const MDeformVert *dvert_a, const MDeformVert *dvert { if (dvert_a->totweight && dvert_b->totweight) { MDeformWeight *dw = dvert_a->dw; - unsigned int i; + uint i; for (i = dvert_a->totweight; i != 0; i--, dw++) { if (dw->weight > 0.0f && BKE_defvert_find_weight(dvert_b, dw->def_nr) > 0.0f) { diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index f0726048647..03358f50d40 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -2512,7 +2512,7 @@ static void dynamic_paint_find_island_border(const DynamicPaintCreateUVSurfaceDa const MLoopTri *mlooptri = data->mlooptri; const MLoopUV *mloopuv = data->mloopuv; - const unsigned int *loop_idx = mlooptri[tri_index].tri; + const uint *loop_idx = mlooptri[tri_index].tri; /* Enumerate all edges of the triangle, rotating the vertex list accordingly. */ for (int edge_idx = 0; edge_idx < 3; edge_idx++) { @@ -2566,7 +2566,7 @@ static void dynamic_paint_find_island_border(const DynamicPaintCreateUVSurfaceDa continue; } - const unsigned int *other_loop_idx = mlooptri[lt_index].tri; + const uint *other_loop_idx = mlooptri[lt_index].tri; /* Check edges for match, looping in the same order as the outer loop. */ for (int j = 0; j < 3; j++) { @@ -5339,12 +5339,12 @@ static void dynamic_paint_effect_drip_cb(void *__restrict userdata, float dir_factor, a_factor; const float speed_scale = eff_scale * force[index * 4 + 3] / bNeighs[n_idx].dist; - const unsigned int n_trgt = (unsigned int)n_target[n_idx]; + const uint n_trgt = (uint)n_target[n_idx]; /* Sort of spinlock, but only for given ePoint. * Since the odds a same ePoint is modified at the same time by several threads is very low, * this is much more efficient than a global spin lock. */ - const unsigned int epointlock_idx = n_trgt / 8; + const uint epointlock_idx = n_trgt / 8; const uint8_t epointlock_bitmask = 1 << (n_trgt & 7); /* 7 == 0b111 */ while (atomic_fetch_and_or_uint8(&point_locks[epointlock_idx], epointlock_bitmask) & epointlock_bitmask) { @@ -5391,7 +5391,7 @@ static void dynamic_paint_effect_drip_cb(void *__restrict userdata, } { - const unsigned int ppointlock_idx = index / 8; + const uint ppointlock_idx = index / 8; const uint8_t ppointlock_bitmask = 1 << (index & 7); /* 7 == 0b111 */ while (atomic_fetch_and_or_uint8(&point_locks[ppointlock_idx], ppointlock_bitmask) & ppointlock_bitmask) { @@ -6063,10 +6063,8 @@ static bool dynamicPaint_generateBakeData(DynamicPaintSurface *surface, /* Init bdata */ bData->bNormal = (struct PaintBakeNormal *)MEM_mallocN( sData->total_points * sizeof(struct PaintBakeNormal), "Dynamic Paint step data"); - bData->s_pos = MEM_mallocN(sData->total_points * sizeof(unsigned int), - "Dynamic Paint bData s_pos"); - bData->s_num = MEM_mallocN(sData->total_points * sizeof(unsigned int), - "Dynamic Paint bData s_num"); + bData->s_pos = MEM_mallocN(sData->total_points * sizeof(uint), "Dynamic Paint bData s_pos"); + bData->s_num = MEM_mallocN(sData->total_points * sizeof(uint), "Dynamic Paint bData s_num"); bData->realCoord = (struct Vec3f *)MEM_mallocN(surface_totalSamples(surface) * sizeof(Vec3f), "Dynamic Paint point coords"); bData->prev_verts = MEM_mallocN(canvasNumOfVerts * sizeof(MVert), @@ -6189,7 +6187,7 @@ static int dynamicPaint_doStep(Depsgraph *depsgraph, * Loop through surface's target paint objects and do painting */ { - unsigned int numobjects; + uint numobjects; Object **objects = BKE_collision_objects_create( depsgraph, NULL, surface->brush_group, &numobjects, eModifierType_DynamicPaint); diff --git a/source/blender/blenkernel/intern/editmesh_bvh.c b/source/blender/blenkernel/intern/editmesh_bvh.c index edf3539681c..5e58a049135 100644 --- a/source/blender/blenkernel/intern/editmesh_bvh.c +++ b/source/blender/blenkernel/intern/editmesh_bvh.c @@ -551,7 +551,7 @@ static bool bmbvh_overlap_cb(void *userdata, int index_a, int index_b, int UNUSE BVHTreeOverlap *BKE_bmbvh_overlap(const BMBVHTree *bmtree_a, const BMBVHTree *bmtree_b, - unsigned int *r_overlap_tot) + uint *r_overlap_tot) { struct BMBVHTree_OverlapData data; @@ -572,7 +572,7 @@ static bool bmbvh_overlap_self_cb(void *userdata, int index_a, int index_b, int return false; } -BVHTreeOverlap *BKE_bmbvh_overlap_self(const BMBVHTree *bmtree, unsigned int *r_overlap_tot) +BVHTreeOverlap *BKE_bmbvh_overlap_self(const BMBVHTree *bmtree, uint *r_overlap_tot) { struct BMBVHTree_OverlapData data; diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 58350b8cda5..4b91efff08d 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -1368,7 +1368,7 @@ void sort_time_fcurve(FCurve *fcu) bool test_time_fcurve(FCurve *fcu) { - unsigned int a; + uint a; /* Sanity checks. */ if (fcu == NULL) { @@ -1778,7 +1778,7 @@ static float fcurve_eval_keyframes_interpolate(FCurve *fcu, BezTriple *bezts, fl { const float eps = 1.e-8f; BezTriple *bezt, *prevbezt; - unsigned int a; + uint a; /* Evaltime occurs somewhere in the middle of the curve. */ bool exact = false; diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index f6082d886d9..8d6f8a06e8c 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -1953,9 +1953,7 @@ bool BKE_gpencil_material_index_used(bGPdata *gpd, int index) return false; } -void BKE_gpencil_material_remap(struct bGPdata *gpd, - const unsigned int *remap, - unsigned int remap_len) +void BKE_gpencil_material_remap(struct bGPdata *gpd, const uint *remap, uint remap_len) { const short remap_len_short = (short)remap_len; diff --git a/source/blender/blenkernel/intern/gpencil_curve.c b/source/blender/blenkernel/intern/gpencil_curve.c index bf224a9613e..a0a579e6d65 100644 --- a/source/blender/blenkernel/intern/gpencil_curve.c +++ b/source/blender/blenkernel/intern/gpencil_curve.c @@ -645,10 +645,10 @@ bGPDcurve *BKE_gpencil_stroke_editcurve_generate(bGPDstroke *gps, } float *r_cubic_array = NULL; - unsigned int r_cubic_array_len = 0; - unsigned int *r_cubic_orig_index = NULL; - unsigned int *r_corners_index_array = NULL; - unsigned int r_corners_index_len = 0; + uint r_cubic_array_len = 0; + uint *r_cubic_orig_index = NULL; + uint *r_corners_index_array = NULL; + uint r_corners_index_len = 0; int r = curve_fit_cubic_to_points_refit_fl(points, gps->totpoints, POINT_DIM, @@ -992,7 +992,7 @@ static float *gpencil_stroke_points_from_editcurve_fixed_resolu(bGPDcurve_point float(*r_points)[9] = MEM_callocN((stride * points_len * (is_cyclic ? 2 : 1)), __func__); float *points_offset = &r_points[0][0]; - for (unsigned int i = 0; i < array_last; i++) { + for (uint i = 0; i < array_last; i++) { bGPDcurve_point *cpt_curr = &curve_point_array[i]; bGPDcurve_point *cpt_next = &curve_point_array[i + 1]; diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c index a0474d1ae7c..aef64247346 100644 --- a/source/blender/blenkernel/intern/image_gen.c +++ b/source/blender/blenkernel/intern/image_gen.c @@ -410,7 +410,7 @@ static void checker_board_text( } static void checker_board_color_prepare_slice( - unsigned char *rect, float *rect_float, int width, int height, int offset, int total_height) + uchar *rect, float *rect_float, int width, int height, int offset, int total_height) { checker_board_color_fill(rect, rect_float, width, height, offset, total_height); checker_board_color_tint(rect, rect_float, width, height, 1, 0.03f, offset); @@ -421,7 +421,7 @@ static void checker_board_color_prepare_slice( } typedef struct FillCheckerColorThreadData { - unsigned char *rect; + uchar *rect; float *rect_float; int width, height; } FillCheckerColorThreadData; @@ -431,16 +431,13 @@ static void checker_board_color_prepare_thread_do(void *data_v, int scanline) FillCheckerColorThreadData *data = (FillCheckerColorThreadData *)data_v; const int num_scanlines = 1; size_t offset = ((size_t)data->width) * scanline * 4; - unsigned char *rect = (data->rect != NULL) ? (data->rect + offset) : NULL; + uchar *rect = (data->rect != NULL) ? (data->rect + offset) : NULL; float *rect_float = (data->rect_float != NULL) ? (data->rect_float + offset) : NULL; checker_board_color_prepare_slice( rect, rect_float, data->width, num_scanlines, scanline, data->height); } -void BKE_image_buf_fill_checker_color(unsigned char *rect, - float *rect_float, - int width, - int height) +void BKE_image_buf_fill_checker_color(uchar *rect, float *rect_float, int width, int height) { if (((size_t)width) * height < 64 * 64) { checker_board_color_prepare_slice(rect, rect_float, width, height, 0, height); diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 40a5c08a068..6a8edde9c49 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1492,7 +1492,7 @@ static void icu_to_fcurves(ID *id, * 3) filter the keyframes for the flag of interest */ for (b = 0; b < totbits; b++, abp++) { - unsigned int i = 0; + uint i = 0; /* make a copy of existing base-data if not the last curve */ if (b < (totbits - 1)) { @@ -1562,7 +1562,7 @@ static void icu_to_fcurves(ID *id, } } else { - unsigned int i = 0; + uint i = 0; /* get rna-path * - we will need to set the 'disabled' flag if no path is able to be made (for now) diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 220b28a32f1..12472cf9dc5 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -1686,7 +1686,7 @@ static void layer_collection_local_visibility_unset_recursive(LayerCollection *l static void layer_collection_local_sync(const Scene *scene, ViewLayer *view_layer, LayerCollection *layer_collection, - const unsigned short local_collections_uuid, + const ushort local_collections_uuid, bool visible) { if ((layer_collection->local_collections_bits & local_collections_uuid) == 0) { @@ -1718,7 +1718,7 @@ void BKE_layer_collection_local_sync(const Scene *scene, ViewLayer *view_layer, return; } - const unsigned short local_collections_uuid = v3d->local_collections_uuid; + const ushort local_collections_uuid = v3d->local_collections_uuid; /* Reset flags and set the bases visible by default. */ BKE_view_layer_synced_ensure(scene, view_layer); diff --git a/source/blender/blenkernel/intern/mask_evaluate.c b/source/blender/blenkernel/intern/mask_evaluate.c index 7ece6946e00..e76c7894f9f 100644 --- a/source/blender/blenkernel/intern/mask_evaluate.c +++ b/source/blender/blenkernel/intern/mask_evaluate.c @@ -565,9 +565,9 @@ static float ( /** only called from #BKE_mask_spline_feather_differentiated_points_with_resolution() ! */ static float (*mask_spline_feather_differentiated_points_with_resolution__double( MaskSpline *spline, - const unsigned int resol, + const uint resol, const bool do_feather_isect, - unsigned int *r_tot_feather_point))[2] + uint *r_tot_feather_point))[2] { MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline); @@ -704,11 +704,11 @@ static float (*mask_spline_feather_differentiated_points_with_resolution__double return feather; } -float (*BKE_mask_spline_feather_differentiated_points_with_resolution( - MaskSpline *spline, - const unsigned int resol, - const bool do_feather_isect, - unsigned int *r_tot_feather_point))[2] +float ( + *BKE_mask_spline_feather_differentiated_points_with_resolution(MaskSpline *spline, + const uint resol, + const bool do_feather_isect, + uint *r_tot_feather_point))[2] { switch (spline->offset_mode) { case MASK_SPLINE_OFFSET_EVEN: @@ -768,14 +768,11 @@ float (*BKE_mask_spline_feather_points(MaskSpline *spline, int *r_tot_feather_po return feather; } -float *BKE_mask_point_segment_feather_diff(MaskSpline *spline, - MaskSplinePoint *point, - int width, - int height, - unsigned int *r_tot_feather_point) +float *BKE_mask_point_segment_feather_diff( + MaskSpline *spline, MaskSplinePoint *point, int width, int height, uint *r_tot_feather_point) { float *feather, *fp; - unsigned int resol = BKE_mask_spline_feather_resolution(spline, width, height); + uint resol = BKE_mask_spline_feather_resolution(spline, width, height); feather = fp = MEM_callocN(2 * resol * sizeof(float), "mask point spline feather diff points"); @@ -796,11 +793,8 @@ float *BKE_mask_point_segment_feather_diff(MaskSpline *spline, return feather; } -float *BKE_mask_point_segment_diff(MaskSpline *spline, - MaskSplinePoint *point, - int width, - int height, - unsigned int *r_tot_diff_point) +float *BKE_mask_point_segment_diff( + MaskSpline *spline, MaskSplinePoint *point, int width, int height, uint *r_tot_diff_point) { MaskSplinePoint *points_array = BKE_mask_spline_point_array_from_point(spline, point); diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c index 2bbf9e8d891..b9ea3eaba69 100644 --- a/source/blender/blenkernel/intern/mask_rasterize.c +++ b/source/blender/blenkernel/intern/mask_rasterize.c @@ -93,7 +93,7 @@ // printf("%u %u %u %u\n", _t[0], _t[1], _t[2], _t[3]); # define FACE_ASSERT(face, vert_max) \ { \ - unsigned int *_t = face; \ + uint *_t = face; \ BLI_assert(_t[0] < vert_max); \ BLI_assert(_t[1] < vert_max); \ BLI_assert(_t[2] < vert_max); \ @@ -493,7 +493,7 @@ static void layer_bucket_init(MaskRasterLayer *layer, const float pixel_size) uint bucket_index = (layer->buckets_x * yi) + xi_min; for (xi = xi_min; xi <= xi_max; xi++, bucket_index++) { /* correct but do in outer loop */ - // unsigned int bucket_index = (layer->buckets_x * yi) + xi; + // uint bucket_index = (layer->buckets_x * yi) + xi; BLI_assert(xi < layer->buckets_x); BLI_assert(yi < layer->buckets_y); @@ -570,10 +570,10 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, const float zvec[3] = {0.0f, 0.0f, -1.0f}; MaskLayer *masklay; - unsigned int masklay_index; + uint masklay_index; MemArena *sf_arena; - mr_handle->layers_tot = (unsigned int)BLI_listbase_count(&mask->masklayers); + mr_handle->layers_tot = (uint)BLI_listbase_count(&mask->masklayers); mr_handle->layers = MEM_mallocN(sizeof(MaskRasterLayer) * mr_handle->layers_tot, "MaskRasterLayer"); BLI_rctf_init_minmax(&mr_handle->bounds); @@ -584,9 +584,9 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, masklay = masklay->next, masklay_index++) { /* we need to store vertex ranges for open splines for filling */ - unsigned int tot_splines; + uint tot_splines; MaskRasterSplineInfo *open_spline_ranges; - unsigned int open_spline_index = 0; + uint open_spline_index = 0; MaskSpline *spline; @@ -596,12 +596,12 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, ScanFillVert *sf_vert_next = NULL; ScanFillFace *sf_tri; - unsigned int sf_vert_tot = 0; - unsigned int tot_feather_quads = 0; + uint sf_vert_tot = 0; + uint tot_feather_quads = 0; #ifdef USE_SCANFILL_EDGE_WORKAROUND - unsigned int tot_boundary_used = 0; - unsigned int tot_boundary_found = 0; + uint tot_boundary_used = 0; + uint tot_boundary_found = 0; #endif if (masklay->visibility_flag & MASK_HIDE_RENDER) { @@ -611,7 +611,7 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, continue; } - tot_splines = (unsigned int)BLI_listbase_count(&masklay->splines); + tot_splines = (uint)BLI_listbase_count(&masklay->splines); open_spline_ranges = MEM_callocN(sizeof(*open_spline_ranges) * tot_splines, __func__); BLI_scanfill_begin_arena(&sf_ctx, sf_arena); @@ -621,15 +621,15 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, const bool is_fill = (spline->flag & MASK_SPLINE_NOFILL) == 0; float(*diff_points)[2]; - unsigned int tot_diff_point; + uint tot_diff_point; float(*diff_feather_points)[2]; float(*diff_feather_points_flip)[2]; - unsigned int tot_diff_feather_points; + uint tot_diff_feather_points; - const unsigned int resol_a = BKE_mask_spline_resolution(spline, width, height) / 4; - const unsigned int resol_b = BKE_mask_spline_feather_resolution(spline, width, height) / 4; - const unsigned int resol = CLAMPIS(MAX2(resol_a, resol_b), 4, 512); + const uint resol_a = BKE_mask_spline_resolution(spline, width, height) / 4; + const uint resol_b = BKE_mask_spline_feather_resolution(spline, width, height) / 4; + const uint resol = CLAMPIS(MAX2(resol_a, resol_b), 4, 512); diff_points = BKE_mask_spline_differentiate_with_resolution(spline, resol, &tot_diff_point); @@ -645,7 +645,7 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, if (tot_diff_point > 3) { ScanFillVert *sf_vert_prev; - unsigned int j; + uint j; sf_ctx.poly_nr++; @@ -828,19 +828,18 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, const float *fp_cent; const float *fp_turn; - unsigned int k; + uint k; fp_cent = diff_points[0]; fp_turn = diff_feather_points[0]; #define CALC_CAP_RESOL \ - clampis_uint( \ - (unsigned int)(len_v2v2(fp_cent, fp_turn) / (pixel_size * SPLINE_RESOL_CAP_PER_PIXEL)), \ - SPLINE_RESOL_CAP_MIN, \ - SPLINE_RESOL_CAP_MAX) + clampis_uint((uint)(len_v2v2(fp_cent, fp_turn) / (pixel_size * SPLINE_RESOL_CAP_PER_PIXEL)), \ + SPLINE_RESOL_CAP_MIN, \ + SPLINE_RESOL_CAP_MAX) { - const unsigned int vertex_total_cap = CALC_CAP_RESOL; + const uint vertex_total_cap = CALC_CAP_RESOL; for (k = 1; k < vertex_total_cap; k++) { const float angle = (float)k * (1.0f / (float)vertex_total_cap) * (float)M_PI; @@ -861,7 +860,7 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, fp_turn = diff_feather_points[tot_diff_point - 1]; { - const unsigned int vertex_total_cap = CALC_CAP_RESOL; + const uint vertex_total_cap = CALC_CAP_RESOL; for (k = 1; k < vertex_total_cap; k++) { const float angle = (float)k * (1.0f / (float)vertex_total_cap) * (float)M_PI; @@ -898,11 +897,11 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, } { - unsigned int(*face_array)[4], *face; /* access coords */ - float(*face_coords)[3], *cos; /* xy, z 0-1 (1.0 == filled) */ - unsigned int sf_tri_tot; + uint(*face_array)[4], *face; /* access coords */ + float(*face_coords)[3], *cos; /* xy, z 0-1 (1.0 == filled) */ + uint sf_tri_tot; rctf bounds; - unsigned int face_index; + uint face_index; int scanfill_flag = 0; bool is_isect = false; @@ -939,8 +938,8 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, if ((masklay->flag & MASK_LAYERFLAG_FILL_OVERLAP) && (is_isect = BLI_scanfill_calc_self_isect( &sf_ctx, &isect_remvertbase, &isect_remedgebase))) { - unsigned int sf_vert_tot_isect = (unsigned int)BLI_listbase_count(&sf_ctx.fillvertbase); - unsigned int i = sf_vert_tot; + uint sf_vert_tot_isect = (uint)BLI_listbase_count(&sf_ctx.fillvertbase); + uint i = sf_vert_tot; face_coords = MEM_reallocN(face_coords, sizeof(float[3]) * (sf_vert_tot + sf_vert_tot_isect)); @@ -965,7 +964,7 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, scanfill_flag |= BLI_SCANFILL_CALC_HOLES; } - sf_tri_tot = (unsigned int)BLI_scanfill_calc_ex(&sf_ctx, scanfill_flag, zvec); + sf_tri_tot = (uint)BLI_scanfill_calc_ex(&sf_ctx, scanfill_flag, zvec); if (is_isect) { /* add removed data back, we only need edges for feather, @@ -980,7 +979,7 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, face_index = 0; /* faces */ - face = (unsigned int *)face_array; + face = (uint *)face_array; for (sf_tri = sf_ctx.fillfacebase.first; sf_tri; sf_tri = sf_tri->next) { *(face++) = sf_tri->v3->tmp.u; *(face++) = sf_tri->v2->tmp.u; @@ -1022,13 +1021,11 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, /* feather only splines */ while (open_spline_index > 0) { - const unsigned int vertex_offset = open_spline_ranges[--open_spline_index].vertex_offset; - unsigned int vertex_total = open_spline_ranges[open_spline_index].vertex_total; - unsigned int vertex_total_cap_head = - open_spline_ranges[open_spline_index].vertex_total_cap_head; - unsigned int vertex_total_cap_tail = - open_spline_ranges[open_spline_index].vertex_total_cap_tail; - unsigned int k, j; + const uint vertex_offset = open_spline_ranges[--open_spline_index].vertex_offset; + uint vertex_total = open_spline_ranges[open_spline_index].vertex_total; + uint vertex_total_cap_head = open_spline_ranges[open_spline_index].vertex_total_cap_head; + uint vertex_total_cap_tail = open_spline_ranges[open_spline_index].vertex_total_cap_tail; + uint k, j; j = vertex_offset; @@ -1068,7 +1065,7 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, FACE_ASSERT(face - 4, sf_vert_tot); } else { - unsigned int midvidx = vertex_offset; + uint midvidx = vertex_offset; /*************** * cap end 'a' */ @@ -1222,7 +1219,7 @@ static float maskrasterize_layer_z_depth_quad( return w[2] + w[3]; /* we can make this assumption for small speedup */ } -static float maskrasterize_layer_isect(const unsigned int *face, +static float maskrasterize_layer_isect(const uint *face, float (*cos)[3], const float dist_orig, const float xy[2]) @@ -1281,22 +1278,21 @@ static float maskrasterize_layer_isect(const unsigned int *face, return 1.0f; } -BLI_INLINE unsigned int layer_bucket_index_from_xy(MaskRasterLayer *layer, const float xy[2]) +BLI_INLINE uint layer_bucket_index_from_xy(MaskRasterLayer *layer, const float xy[2]) { BLI_assert(BLI_rctf_isect_pt_v(&layer->bounds, xy)); - return ((unsigned int)((xy[0] - layer->bounds.xmin) * layer->buckets_xy_scalar[0])) + - (((unsigned int)((xy[1] - layer->bounds.ymin) * layer->buckets_xy_scalar[1])) * - layer->buckets_x); + return ((uint)((xy[0] - layer->bounds.xmin) * layer->buckets_xy_scalar[0])) + + (((uint)((xy[1] - layer->bounds.ymin) * layer->buckets_xy_scalar[1])) * layer->buckets_x); } static float layer_bucket_depth_from_xy(MaskRasterLayer *layer, const float xy[2]) { - unsigned int index = layer_bucket_index_from_xy(layer, xy); - unsigned int *face_index = layer->buckets_face[index]; + uint index = layer_bucket_index_from_xy(layer, xy); + uint *face_index = layer->buckets_face[index]; if (face_index) { - unsigned int(*face_array)[4] = layer->face_array; + uint(*face_array)[4] = layer->face_array; float(*cos)[3] = layer->face_coords; float best_dist = 1.0f; while (*face_index != TRI_TERMINATOR_ID) { @@ -1323,7 +1319,7 @@ float BKE_maskrasterize_handle_sample(MaskRasterHandle *mr_handle, const float x /* can't do this because some layers may invert */ /* if (BLI_rctf_isect_pt_v(&mr_handle->bounds, xy)) */ - const unsigned int layers_tot = mr_handle->layers_tot; + const uint layers_tot = mr_handle->layers_tot; MaskRasterLayer *layer = mr_handle->layers; /* return value */ @@ -1448,8 +1444,8 @@ static void maskrasterize_buffer_cb(void *__restrict userdata, } void BKE_maskrasterize_buffer(MaskRasterHandle *mr_handle, - const unsigned int width, - const unsigned int height, + const uint width, + const uint height, /* Cannot be const, because it is assigned to non-const variable. * NOLINTNEXTLINE: readability-non-const-parameter. */ float *buffer) diff --git a/source/blender/blenkernel/intern/mball_tessellate.c b/source/blender/blenkernel/intern/mball_tessellate.c index 809f58f1c4c..1bb50c2c97f 100644 --- a/source/blender/blenkernel/intern/mball_tessellate.c +++ b/source/blender/blenkernel/intern/mball_tessellate.c @@ -1076,7 +1076,7 @@ static void closest_latice(int r[3], const float pos[3], const float size) /** * Find at most 26 cubes to start polygonization from. */ -static void find_first_points(PROCESS *process, const unsigned int em) +static void find_first_points(PROCESS *process, const uint em) { const MetaElem *ml; int center[3], lbn[3], rtf[3], it[3], dir[3], add[3]; @@ -1164,7 +1164,7 @@ static void init_meta(Depsgraph *depsgraph, PROCESS *process, Scene *scene, Obje MetaBall *mb; const MetaElem *ml; float obinv[4][4], obmat[4][4]; - unsigned int i; + uint i; int obnr, zero_size = 0; char obname[MAX_ID_NAME]; SceneBaseIter iter; diff --git a/source/blender/blenkernel/intern/mesh_remap.c b/source/blender/blenkernel/intern/mesh_remap.c index d63d064eb3c..cb05d33bc2e 100644 --- a/source/blender/blenkernel/intern/mesh_remap.c +++ b/source/blender/blenkernel/intern/mesh_remap.c @@ -1050,7 +1050,7 @@ static void mesh_island_to_astar_graph_edge_process(MeshIslandStore *islands, const bool is_edge_innercut, const int *poly_island_index_map, float (*poly_centers)[3], - unsigned char *poly_status) + uchar *poly_status) { int *poly_island_indices = BLI_array_alloca(poly_island_indices, (size_t)edge_to_poly_map[edge_idx].count); @@ -1114,7 +1114,7 @@ static void mesh_island_to_astar_graph(MeshIslandStore *islands, BLI_bitmap *done_edges = BLI_BITMAP_NEW(numedges, __func__); const int node_num = islands ? island_poly_map->count : numpolys; - unsigned char *poly_status = MEM_callocN(sizeof(*poly_status) * (size_t)node_num, __func__); + uchar *poly_status = MEM_callocN(sizeof(*poly_status) * (size_t)node_num, __func__); float(*poly_centers)[3]; int pidx_isld; diff --git a/source/blender/blenkernel/intern/object_deform.c b/source/blender/blenkernel/intern/object_deform.c index a72d68710ed..c1fe10dca6b 100644 --- a/source/blender/blenkernel/intern/object_deform.c +++ b/source/blender/blenkernel/intern/object_deform.c @@ -613,7 +613,7 @@ bool *BKE_object_defgroup_selected_get(Object *ob, int defbase_tot, int *r_dg_fl { bool *dg_selection = MEM_mallocN(defbase_tot * sizeof(bool), __func__); bDeformGroup *defgroup; - unsigned int i; + uint i; Object *armob = BKE_object_pose_armature_get(ob); (*r_dg_flags_sel_tot) = 0; @@ -700,7 +700,7 @@ void BKE_object_defgroup_mirror_selection(struct Object *ob, const ListBase *defbase = BKE_object_defgroup_list(ob); bDeformGroup *defgroup; - unsigned int i; + uint i; int i_mirr; for (i = 0, defgroup = defbase->first; i < defbase_tot && defgroup; diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c index cd1f24fee37..c142f096395 100644 --- a/source/blender/blenkernel/intern/ocean.c +++ b/source/blender/blenkernel/intern/ocean.c @@ -915,7 +915,7 @@ bool BKE_ocean_init(struct Ocean *o, /* This ensures we get a value tied to the surface location, avoiding dramatic surface * change with changing resolution. * Explicitly cast to signed int first to ensure consistent behavior on all processors, - * since behavior of float to unsigned int cast is undefined in C. */ + * since behavior of `float` to `uint` cast is undefined in C. */ const int hash_x = o->_kx[i] * 360.0f; const int hash_z = o->_kz[j] * 360.0f; int new_seed = seed + BLI_hash_int_2d(hash_x, hash_z); diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 4acd65750bf..5ec69f9bc45 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -1951,9 +1951,9 @@ static PTCacheMem *ptcache_disk_frame_to_mem(PTCacheID *pid, int cfra) if (pf->flag & PTCACHE_TYPEFLAG_COMPRESS) { for (i = 0; i < BPHYS_TOT_DATA; i++) { - unsigned int out_len = pm->totpoint * ptcache_data_size[i]; + uint out_len = pm->totpoint * ptcache_data_size[i]; if (pf->data_types & (1 << i)) { - ptcache_file_compressed_read(pf, (unsigned char *)(pm->data[i]), out_len); + ptcache_file_compressed_read(pf, (uchar *)(pm->data[i]), out_len); } } } @@ -1974,22 +1974,21 @@ static PTCacheMem *ptcache_disk_frame_to_mem(PTCacheID *pid, int cfra) } if (!error && pf->flag & PTCACHE_TYPEFLAG_EXTRADATA) { - unsigned int extratype = 0; + uint extratype = 0; - while (ptcache_file_read(pf, &extratype, 1, sizeof(unsigned int))) { + while (ptcache_file_read(pf, &extratype, 1, sizeof(uint))) { PTCacheExtra *extra = MEM_callocN(sizeof(PTCacheExtra), "Pointcache extradata"); extra->type = extratype; - ptcache_file_read(pf, &extra->totdata, 1, sizeof(unsigned int)); + ptcache_file_read(pf, &extra->totdata, 1, sizeof(uint)); extra->data = MEM_callocN(extra->totdata * ptcache_extra_datasize[extra->type], "Pointcache extradata->data"); if (pf->flag & PTCACHE_TYPEFLAG_COMPRESS) { - ptcache_file_compressed_read(pf, - (unsigned char *)(extra->data), - extra->totdata * ptcache_extra_datasize[extra->type]); + ptcache_file_compressed_read( + pf, (uchar *)(extra->data), extra->totdata * ptcache_extra_datasize[extra->type]); } else { ptcache_file_read(pf, extra->data, extra->totdata, ptcache_extra_datasize[extra->type]); @@ -2016,7 +2015,7 @@ static PTCacheMem *ptcache_disk_frame_to_mem(PTCacheID *pid, int cfra) static int ptcache_mem_frame_to_disk(PTCacheID *pid, PTCacheMem *pm) { PTCacheFile *pf = NULL; - unsigned int i, error = 0; + uint i, error = 0; BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_FRAME, pm->frame); @@ -2050,11 +2049,10 @@ static int ptcache_mem_frame_to_disk(PTCacheID *pid, PTCacheMem *pm) if (pid->cache->compression) { for (i = 0; i < BPHYS_TOT_DATA; i++) { if (pm->data[i]) { - unsigned int in_len = pm->totpoint * ptcache_data_size[i]; - unsigned char *out = (unsigned char *)MEM_callocN(LZO_OUT_LEN(in_len) * 4, - "pointcache_lzo_buffer"); + uint in_len = pm->totpoint * ptcache_data_size[i]; + uchar *out = (uchar *)MEM_callocN(LZO_OUT_LEN(in_len) * 4, "pointcache_lzo_buffer"); ptcache_file_compressed_write( - pf, (unsigned char *)(pm->data[i]), in_len, out, pid->cache->compression); + pf, (uchar *)(pm->data[i]), in_len, out, pid->cache->compression); MEM_freeN(out); } } @@ -2083,15 +2081,14 @@ static int ptcache_mem_frame_to_disk(PTCacheID *pid, PTCacheMem *pm) continue; } - ptcache_file_write(pf, &extra->type, 1, sizeof(unsigned int)); - ptcache_file_write(pf, &extra->totdata, 1, sizeof(unsigned int)); + ptcache_file_write(pf, &extra->type, 1, sizeof(uint)); + ptcache_file_write(pf, &extra->totdata, 1, sizeof(uint)); if (pid->cache->compression) { - unsigned int in_len = extra->totdata * ptcache_extra_datasize[extra->type]; - unsigned char *out = (unsigned char *)MEM_callocN(LZO_OUT_LEN(in_len) * 4, - "pointcache_lzo_buffer"); + uint in_len = extra->totdata * ptcache_extra_datasize[extra->type]; + uchar *out = (uchar *)MEM_callocN(LZO_OUT_LEN(in_len) * 4, "pointcache_lzo_buffer"); ptcache_file_compressed_write( - pf, (unsigned char *)(extra->data), in_len, out, pid->cache->compression); + pf, (uchar *)(extra->data), in_len, out, pid->cache->compression); MEM_freeN(out); } else { @@ -2531,7 +2528,7 @@ static int ptcache_write_needed(PTCacheID *pid, int cfra, int *overwrite) return 0; } -int BKE_ptcache_write(PTCacheID *pid, unsigned int cfra) +int BKE_ptcache_write(PTCacheID *pid, uint cfra) { PointCache *cache = pid->cache; if (!pid->totpoint) { @@ -2583,10 +2580,10 @@ int BKE_ptcache_write(PTCacheID *pid, unsigned int cfra) /* Clears & resets. */ -void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra) +void BKE_ptcache_id_clear(PTCacheID *pid, int mode, uint cfra) { - unsigned int len; /* store the length of the string */ - unsigned int sta, end; + uint len; /* store the length of the string */ + uint sta, end; /* mode is same as fopen's modes */ DIR *dir; @@ -2808,8 +2805,8 @@ void BKE_ptcache_id_time( } if (cache->cached_frames == NULL && cache->endframe > cache->startframe) { - unsigned int sta = cache->startframe; - unsigned int end = cache->endframe; + uint sta = cache->startframe; + uint end = cache->endframe; cache->cached_frames_len = cache->endframe - cache->startframe + 1; cache->cached_frames = MEM_callocN(sizeof(char) * cache->cached_frames_len, @@ -2822,7 +2819,7 @@ void BKE_ptcache_id_time( char path[MAX_PTCACHE_PATH]; char filepath[MAX_PTCACHE_FILE]; char ext[MAX_PTCACHE_PATH]; - unsigned int len; /* store the length of the string */ + uint len; /* store the length of the string */ ptcache_path(pid, path); diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c index 2705241425b..6b4cddb05f2 100644 --- a/source/blender/blenkernel/intern/rigidbody.c +++ b/source/blender/blenkernel/intern/rigidbody.c @@ -2261,7 +2261,7 @@ void BKE_rigidbody_do_simulation(Depsgraph *depsgraph, Scene *scene, float ctime /* write cache for current frame */ BKE_ptcache_validate(cache, (int)ctime); - BKE_ptcache_write(&pid, (unsigned int)ctime); + BKE_ptcache_write(&pid, (uint)ctime); rbw->ltime = ctime; } diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 6e23ca0e89f..d08fba0e657 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -556,7 +556,7 @@ static void sound_load_audio(Main *bmain, bSound *sound, bool free_waveform) /* but we need a packed file then */ if (pf) { - sound->handle = AUD_Sound_bufferFile((unsigned char *)pf->data, pf->size); + sound->handle = AUD_Sound_bufferFile((uchar *)pf->data, pf->size); } else { /* or else load it from disk */ diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 97b9218ce52..c37f4b1ea2f 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -327,7 +327,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, int nverts = mp->totloop; int j, j_next; CCGFace *origf = ccgSubSurf_getFace(origss, POINTER_FROM_INT(i)); - /* unsigned int *fv = &mp->v1; */ + /* uint *fv = &mp->v1; */ MLoop *ml = mloop + mp->loopstart; #ifdef USE_DYNSIZE diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 98c401aacb0..c32ab64c478 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -1757,7 +1757,7 @@ void txt_duplicate_line(Text *text) void txt_delete_char(Text *text) { - unsigned int c = '\n'; + uint c = '\n'; if (!text->curl) { return; @@ -1805,7 +1805,7 @@ void txt_delete_word(Text *text) void txt_backspace_char(Text *text) { - unsigned int c = '\n'; + uint c = '\n'; if (!text->curl) { return; @@ -1873,7 +1873,7 @@ static void txt_convert_tab_to_spaces(Text *text) txt_insert_buf(text, sb, strlen(sb)); } -static bool txt_add_char_intern(Text *text, unsigned int add, bool replace_tabs) +static bool txt_add_char_intern(Text *text, uint add, bool replace_tabs) { char *tmp, ch[BLI_UTF8_MAX]; size_t add_len; @@ -1916,12 +1916,12 @@ static bool txt_add_char_intern(Text *text, unsigned int add, bool replace_tabs) return 1; } -bool txt_add_char(Text *text, unsigned int add) +bool txt_add_char(Text *text, uint add) { return txt_add_char_intern(text, add, (text->flags & TXT_TABSTOSPACES) != 0); } -bool txt_add_raw_char(Text *text, unsigned int add) +bool txt_add_raw_char(Text *text, uint add) { return txt_add_char_intern(text, add, 0); } @@ -1932,9 +1932,9 @@ void txt_delete_selected(Text *text) txt_make_dirty(text); } -bool txt_replace_char(Text *text, unsigned int add) +bool txt_replace_char(Text *text, uint add) { - unsigned int del; + uint del; size_t del_size = 0, add_size; char ch[BLI_UTF8_MAX]; @@ -2361,12 +2361,12 @@ bool text_check_identifier_nodigit(const char ch) } #ifndef WITH_PYTHON -int text_check_identifier_unicode(const unsigned int ch) +int text_check_identifier_unicode(const uint ch) { - return (ch < 255 && text_check_identifier((unsigned int)ch)); + return (ch < 255 && text_check_identifier((uint)ch)); } -int text_check_identifier_nodigit_unicode(const unsigned int ch) +int text_check_identifier_nodigit_unicode(const uint ch) { return (ch < 255 && text_check_identifier_nodigit((char)ch)); } diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index cd1af5a8de4..c6efe235172 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -2396,21 +2396,21 @@ ImBuf *BKE_tracking_distortion_exec(MovieDistortion *distortion, else { if (undistort) { libmv_cameraIntrinsicsUndistortByte(distortion->intrinsics, - (unsigned char *)ibuf->rect, + (uchar *)ibuf->rect, ibuf->x, ibuf->y, overscan, ibuf->channels, - (unsigned char *)resibuf->rect); + (uchar *)resibuf->rect); } else { libmv_cameraIntrinsicsDistortByte(distortion->intrinsics, - (unsigned char *)ibuf->rect, + (uchar *)ibuf->rect, ibuf->x, ibuf->y, overscan, ibuf->channels, - (unsigned char *)resibuf->rect); + (uchar *)resibuf->rect); } } @@ -2693,7 +2693,7 @@ ImBuf *BKE_tracking_sample_pattern(int frame_width, &warped_position_y); } else { - libmv_samplePlanarPatchByte((unsigned char *)search_ibuf->rect, + libmv_samplePlanarPatchByte((uchar *)search_ibuf->rect, search_ibuf->x, search_ibuf->y, 4, @@ -2702,7 +2702,7 @@ ImBuf *BKE_tracking_sample_pattern(int frame_width, num_samples_x, num_samples_y, mask, - (unsigned char *)pattern_ibuf->rect, + (uchar *)pattern_ibuf->rect, &warped_position_x, &warped_position_y); } @@ -2868,7 +2868,7 @@ ImBuf *BKE_tracking_get_plane_imbuf(const ImBuf *frame_ibuf, &warped_position_y); } else { - libmv_samplePlanarPatchByte((unsigned char *)frame_ibuf->rect, + libmv_samplePlanarPatchByte((uchar *)frame_ibuf->rect, frame_ibuf->x, frame_ibuf->y, 4, @@ -2877,7 +2877,7 @@ ImBuf *BKE_tracking_get_plane_imbuf(const ImBuf *frame_ibuf, num_samples_x, num_samples_y, NULL, - (unsigned char *)plane_ibuf->rect, + (uchar *)plane_ibuf->rect, &warped_position_x, &warped_position_y); } diff --git a/source/blender/blenkernel/intern/tracking_detect.c b/source/blender/blenkernel/intern/tracking_detect.c index 540f880905d..910d02ef50a 100644 --- a/source/blender/blenkernel/intern/tracking_detect.c +++ b/source/blender/blenkernel/intern/tracking_detect.c @@ -121,7 +121,7 @@ static void run_configured_detector(MovieTracking *tracking, features = libmv_detectFeaturesFloat(ibuf->rect_float, ibuf->x, ibuf->y, 4, options); } else if (ibuf->rect) { - features = libmv_detectFeaturesByte((unsigned char *)ibuf->rect, ibuf->x, ibuf->y, 4, options); + features = libmv_detectFeaturesByte((uchar *)ibuf->rect, ibuf->x, ibuf->y, 4, options); } if (features != NULL) { diff --git a/source/blender/blenkernel/intern/tracking_util.c b/source/blender/blenkernel/intern/tracking_util.c index e97aa49f4ca..aaf262d120b 100644 --- a/source/blender/blenkernel/intern/tracking_util.c +++ b/source/blender/blenkernel/intern/tracking_util.c @@ -723,7 +723,7 @@ static ImBuf *accessor_get_ibuf(TrackingImageAccessor *accessor, int dst_index = (dst_y * width + dst_x) * 4, src_index = (src_y * orig_ibuf->x + src_x) * 4; rgba_uchar_to_float(final_ibuf->rect_float + dst_index, - (unsigned char *)orig_ibuf->rect + src_index); + (uchar *)orig_ibuf->rect + src_index); } } } diff --git a/source/blender/blenkernel/intern/vfont.c b/source/blender/blenkernel/intern/vfont.c index 7e321a9d500..0e04da246fc 100644 --- a/source/blender/blenkernel/intern/vfont.c +++ b/source/blender/blenkernel/intern/vfont.c @@ -1505,7 +1505,7 @@ static bool vfont_to_curve(Object *ob, ct = chartransdata; for (i = 0; i < slen; i++) { - unsigned int cha = (unsigned int)mem[i]; + uint cha = (uint)mem[i]; info = &(custrinfo[i]); if ((cu->overflow == CU_OVERFLOW_TRUNCATE) && (ob && ob->mode != OB_MODE_EDIT) && diff --git a/source/blender/blenkernel/intern/vfontdata_freetype.c b/source/blender/blenkernel/intern/vfontdata_freetype.c index 79d9b64b0f6..30e5f29e6a8 100644 --- a/source/blender/blenkernel/intern/vfontdata_freetype.c +++ b/source/blender/blenkernel/intern/vfontdata_freetype.c @@ -418,7 +418,7 @@ VFontData *BKE_vfontdata_copy(const VFontData *vfont_src, const int UNUSED(flag) return vfont_dst; } -VChar *BKE_vfontdata_char_from_freetypefont(VFont *vfont, unsigned long character) +VChar *BKE_vfontdata_char_from_freetypefont(VFont *vfont, ulong character) { VChar *che = NULL; diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index f4de82824c1..dbdf8cc395d 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -237,7 +237,7 @@ static int append_avi(void *context_v, const char *UNUSED(suffix), ReportList *UNUSED(reports)) { - unsigned int *rt1, *rt2, *rectot; + uint *rt1, *rt2, *rectot; int x, y; char *cp, rt; AviMovie *avi = context_v; @@ -249,7 +249,7 @@ static int append_avi(void *context_v, /* note that libavi free's the buffer... stupid interface - zr */ rectot = MEM_mallocN(rectx * recty * sizeof(int), "rectot"); rt1 = rectot; - rt2 = (unsigned int *)pixels + (recty - 1) * rectx; + rt2 = (uint *)pixels + (recty - 1) * rectx; /* flip y and convert to abgr */ for (y = 0; y < recty; y++, rt1 += rectx, rt2 -= rectx) { memcpy(rt1, rt2, rectx * sizeof(int)); diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 5593625ed89..99df07b6105 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -1282,7 +1282,7 @@ int BKE_ffmpeg_append(void *context_v, PRINT("Writing frame %i, render width=%d, render height=%d\n", frame, rectx, recty); if (context->video_stream) { - avframe = generate_video_frame(context, (unsigned char *)pixels); + avframe = generate_video_frame(context, (uchar *)pixels); success = (avframe && write_video_frame(context, avframe, reports)); # ifdef WITH_AUDASPACE /* Add +1 frame because we want to encode audio up until the next video frame. */ |