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 --- .../editors/animation/anim_channels_defines.c | 4 +- source/blender/editors/animation/anim_draw.c | 2 +- source/blender/editors/animation/anim_ipo_utils.c | 2 +- source/blender/editors/animation/anim_markers.c | 2 +- source/blender/editors/animation/fmodifier_ui.c | 4 +- source/blender/editors/animation/keyframes_draw.c | 16 +-- source/blender/editors/animation/keyframes_edit.c | 2 +- .../blender/editors/animation/keyframes_general.c | 2 +- source/blender/editors/animation/keyframing.c | 2 +- source/blender/editors/animation/time_scrub_ui.c | 2 +- source/blender/editors/armature/armature_select.c | 10 +- source/blender/editors/armature/armature_utils.c | 7 +- source/blender/editors/armature/pose_lib.c | 6 +- source/blender/editors/armature/pose_select.c | 2 +- source/blender/editors/curve/editcurve.c | 10 +- source/blender/editors/curve/editcurve_paint.c | 20 ++-- source/blender/editors/curve/editfont.c | 2 +- .../gizmo_library/geometry/geom_arrow_gizmo.c | 2 +- .../gizmo_library/geometry/geom_cube_gizmo.c | 2 +- .../gizmo_library/geometry/geom_dial_gizmo.c | 2 +- .../editors/gizmo_library/gizmo_draw_utils.c | 2 +- .../blender/editors/gizmo_library/gizmo_geometry.h | 4 +- source/blender/editors/interface/interface_icons.c | 14 +-- source/blender/editors/interface/resources.c | 2 +- source/blender/editors/mask/mask_draw.c | 50 ++++----- source/blender/editors/mask/mask_query.c | 4 +- source/blender/editors/mesh/editface.c | 6 +- source/blender/editors/mesh/editmesh_intersect.c | 6 +- source/blender/editors/mesh/editmesh_knife.c | 4 +- source/blender/editors/mesh/editmesh_rip.c | 6 +- source/blender/editors/mesh/editmesh_tools.c | 10 +- source/blender/editors/mesh/editmesh_utils.c | 8 +- source/blender/editors/mesh/mesh_mirror.c | 6 +- source/blender/editors/mesh/meshtools.c | 16 +-- source/blender/editors/metaball/mball_edit.c | 2 +- source/blender/editors/object/object_add.c | 8 +- source/blender/editors/object/object_bake_api.c | 6 +- source/blender/editors/object/object_modifier.c | 2 +- source/blender/editors/object/object_random.c | 4 +- source/blender/editors/object/object_relations.c | 2 +- source/blender/editors/object/object_remesh.c | 8 +- source/blender/editors/object/object_transform.c | 3 +- source/blender/editors/render/render_opengl.c | 13 +-- source/blender/editors/render/render_preview.c | 30 ++--- source/blender/editors/render/render_shading.c | 4 +- source/blender/editors/screen/glutil.c | 8 +- source/blender/editors/screen/screen_draw.c | 12 +- source/blender/editors/screen/screendump.c | 2 +- source/blender/editors/sculpt_paint/paint_cursor.c | 18 +-- .../blender/editors/sculpt_paint/paint_image_2d.c | 107 +++++++++--------- .../editors/sculpt_paint/paint_image_proj.c | 72 ++++++------ source/blender/editors/sculpt_paint/paint_utils.c | 27 ++--- .../editors/sculpt_paint/paint_vertex_color_ops.c | 2 +- source/blender/editors/sculpt_paint/sculpt_uv.c | 10 +- source/blender/editors/space_action/action_draw.c | 19 ++-- .../editors/space_clip/clip_dopesheet_draw.c | 4 +- source/blender/editors/space_clip/clip_draw.c | 15 ++- source/blender/editors/space_clip/clip_editor.c | 20 ++-- .../blender/editors/space_clip/clip_graph_draw.c | 6 +- source/blender/editors/space_clip/clip_ops.c | 12 +- source/blender/editors/space_file/file_draw.c | 8 +- source/blender/editors/space_file/file_ops.c | 4 +- source/blender/editors/space_file/filelist.c | 40 +++---- source/blender/editors/space_graph/graph_edit.c | 4 +- source/blender/editors/space_image/image_ops.c | 10 +- .../blender/editors/space_image/image_sequence.c | 4 +- source/blender/editors/space_nla/nla_draw.c | 2 +- source/blender/editors/space_node/node_select.c | 2 +- source/blender/editors/space_node/node_view.c | 10 +- .../editors/space_sequencer/sequencer_draw.c | 30 ++--- .../editors/space_sequencer/sequencer_scopes.c | 121 ++++++++++----------- .../editors/space_sequencer/sequencer_view.c | 8 +- source/blender/editors/space_text/text_format.c | 2 +- source/blender/editors/space_text/text_ops.c | 2 +- source/blender/editors/space_view3d/view3d_view.c | 6 +- source/blender/editors/transform/transform.c | 4 +- .../blender/editors/transform/transform_convert.c | 8 +- .../editors/transform/transform_draw_cursors.c | 2 +- .../blender/editors/transform/transform_generics.c | 4 +- .../editors/transform/transform_orientations.c | 12 +- source/blender/editors/transform/transform_snap.c | 2 +- .../editors/transform/transform_snap_object.c | 20 ++-- source/blender/editors/uvedit/uvedit_ops.c | 10 +- .../blender/editors/uvedit/uvedit_parametrizer.c | 26 ++--- .../blender/editors/uvedit/uvedit_smart_stitch.c | 34 +++--- 85 files changed, 491 insertions(+), 539 deletions(-) diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 67e899382bb..2c1b7f3fb76 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -856,7 +856,7 @@ static void acf_group_color(bAnimContext *ac, bAnimListElem *ale, float r_color[ bool showGroupColors = acf_show_channel_colors(ac); if (showGroupColors && agrp->customCol) { - unsigned char cp[3]; + uchar cp[3]; /* highlight only for active */ if (ale->flag & AGRP_ACTIVE) { @@ -4395,7 +4395,7 @@ void ANIM_channel_draw( if (acf->name && !achannel_is_being_renamed(ac, acf, channel_index)) { const uiFontStyle *fstyle = UI_FSTYLE_WIDGET; char name[ANIM_CHAN_NAME_SIZE]; /* hopefully this will be enough! */ - unsigned char col[4]; + uchar col[4]; /* set text color */ /* XXX: if active, highlight differently? */ diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 96fd2e94a5e..4203c2677b7 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -71,7 +71,7 @@ void ANIM_draw_cfra_number(const bContext *C, View2D *v2d, short flag) const bool show_time = (flag & DRAWCFRA_UNIT_SECONDS) != 0; const uiFontStyle *fstyle = UI_FSTYLE_WIDGET; - unsigned char col[4]; + uchar col[4]; float color[4]; float xscale, x, y; char numstr[32] = " t "; /* t is the character to start replacing from */ diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index f631d08f3e4..3613ca9eeda 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -203,7 +203,7 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu) #define HSV_BANDWIDTH 0.3f /* used to determine the color of F-Curves with FCURVE_COLOR_AUTO_RAINBOW set */ -// void fcurve_rainbow(unsigned int cur, unsigned int tot, float *out) +// void fcurve_rainbow(uint cur, uint tot, float *out) void getcolor_fcurve_rainbow(int cur, int tot, float out[3]) { float hsv[3], fac; diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 8b0e9b22ce8..27d38cf625a 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -528,7 +528,7 @@ static void draw_markers_background(rctf *rect) uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); - unsigned char shade[4]; + uchar shade[4]; UI_GetThemeColor4ubv(TH_TIME_SCRUB_BACKGROUND, shade); immUniformColor4ubv(shade); diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 9bdfd9cfe33..954daff560f 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -178,7 +178,7 @@ static void draw_modifier__generator(uiLayout *layout, const uiFontStyle *fstyle = UI_FSTYLE_WIDGET; float *cp = NULL; char xval[32]; - unsigned int i; + uint i; int maxXWidth; /* draw polynomial order selector */ @@ -317,7 +317,7 @@ static void draw_modifier__generator(uiLayout *layout, case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* Factorized polynomial expression */ { float *cp = NULL; - unsigned int i; + uint i; /* draw polynomial order selector */ row = uiLayoutRow(layout, false); diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index 4b3b730d0fe..37bfd7f396c 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -558,11 +558,11 @@ void draw_keyframe_shape(float x, short key_type, short mode, float alpha, - unsigned int pos_id, - unsigned int size_id, - unsigned int color_id, - unsigned int outline_color_id, - unsigned int flags_id, + uint pos_id, + uint size_id, + uint color_id, + uint outline_color_id, + uint flags_id, short handle_type, short extreme_type) { @@ -595,9 +595,9 @@ void draw_keyframe_shape(float x, size -= 0.8f * key_type; } - unsigned char fill_col[4]; - unsigned char outline_col[4]; - unsigned int flags = 0; + uchar fill_col[4]; + uchar outline_col[4]; + uint flags = 0; /* draw! */ if (draw_fill) { diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index 61488e7f63a..e22fddc6d67 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -79,7 +79,7 @@ short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, { BezTriple *bezt; short ok = 0; - unsigned int i; + uint i; /* sanity check */ if (ELEM(NULL, fcu, fcu->bezt)) { diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index c526c185383..fc9ec870496 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -1189,7 +1189,7 @@ short paste_animedit_keys(bAnimContext *ac, * one F-Curve has been pasted into. */ for (pass = 0; pass < 3; pass++) { - unsigned int totmatch = 0; + uint totmatch = 0; for (ale = anim_data->first; ale; ale = ale->next) { /* Find buffer item to paste from: diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index e66ebb1928c..c22f1e0642b 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -494,7 +494,7 @@ int insert_vert_fcurve( FCurve *fcu, float x, float y, eBezTriple_KeyframeType keyframe_type, eInsertKeyFlags flag) { BezTriple beztr = {{{0}}}; - unsigned int oldTot = fcu->totvert; + uint oldTot = fcu->totvert; int a; /* set all three points, for nicer start position diff --git a/source/blender/editors/animation/time_scrub_ui.c b/source/blender/editors/animation/time_scrub_ui.c index 25b8e78de92..7679995d9a4 100644 --- a/source/blender/editors/animation/time_scrub_ui.c +++ b/source/blender/editors/animation/time_scrub_ui.c @@ -95,7 +95,7 @@ static void draw_current_frame(const Scene *scene, int current_frame) { const uiFontStyle *fstyle = UI_FSTYLE_WIDGET; - const unsigned char color[] = {255, 255, 255, 255}; + const uchar color[] = {255, 255, 255, 255}; int frame_x = UI_view2d_view_to_region_x(v2d, current_frame); char frame_str[64]; diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c index a8560f89a1a..700fe14ade6 100644 --- a/source/blender/editors/armature/armature_select.c +++ b/source/blender/editors/armature/armature_select.c @@ -176,7 +176,7 @@ static void *ed_armature_pick_bone_from_selectbuffer_impl(const bool is_editmode EditBone *ebone; void *firstunSel = NULL, *firstSel = NULL, *data; Base *firstunSel_base = NULL, *firstSel_base = NULL; - unsigned int hitresult; + uint hitresult; short i; bool takeNext = false; int minsel = 0xffffffff, minunsel = 0xffffffff; @@ -334,7 +334,7 @@ static void *ed_armature_pick_bone_impl( Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); ViewContext vc; rcti rect; - unsigned int buffer[MAXPICKBUF]; + uint buffer[MAXPICKBUF]; short hits; ED_view3d_viewcontext_init(C, &vc, depsgraph); @@ -635,15 +635,15 @@ void ARMATURE_OT_select_linked_pick(wmOperatorType *ot) * \{ */ /* utility function for get_nearest_editbonepoint */ -static int selectbuffer_ret_hits_12(unsigned int *UNUSED(buffer), const int hits12) +static int selectbuffer_ret_hits_12(uint *UNUSED(buffer), const int hits12) { return hits12; } -static int selectbuffer_ret_hits_5(unsigned int *buffer, const int hits12, const int hits5) +static int selectbuffer_ret_hits_5(uint *buffer, const int hits12, const int hits5) { const int offs = 4 * hits12; - memcpy(buffer, buffer + offs, 4 * hits5 * sizeof(unsigned int)); + memcpy(buffer, buffer + offs, 4 * hits5 * sizeof(uint)); return hits5; } diff --git a/source/blender/editors/armature/armature_utils.c b/source/blender/editors/armature/armature_utils.c index 8f63f239abc..fe456324d9c 100644 --- a/source/blender/editors/armature/armature_utils.c +++ b/source/blender/editors/armature/armature_utils.c @@ -196,13 +196,12 @@ bool ED_armature_ebone_is_child_recursive(EditBone *ebone_parent, EditBone *ebon * \param ebone_child_tot: Size of the ebone_child array * \return The shared parent or NULL. */ -EditBone *ED_armature_ebone_find_shared_parent(EditBone *ebone_child[], - const unsigned int ebone_child_tot) +EditBone *ED_armature_ebone_find_shared_parent(EditBone *ebone_child[], const uint ebone_child_tot) { - unsigned int i; + uint i; EditBone *ebone_iter; -#define EBONE_TEMP_UINT(ebone) (*((unsigned int *)(&((ebone)->temp)))) +#define EBONE_TEMP_UINT(ebone) (*((uint *)(&((ebone)->temp)))) /* clear all */ for (i = 0; i < ebone_child_tot; i++) { diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c index f759808d08e..455e7cb2733 100644 --- a/source/blender/editors/armature/pose_lib.c +++ b/source/blender/editors/armature/pose_lib.c @@ -626,7 +626,7 @@ static int poselib_remove_exec(bContext *C, wmOperator *op) /* remove relevant keyframes */ for (fcu = act->curves.first; fcu; fcu = fcu->next) { BezTriple *bezt; - unsigned int i; + uint i; if (fcu->bezt) { for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) { @@ -1323,9 +1323,7 @@ static void poselib_preview_get_next(tPoseLib_PreviewData *pld, int step) } /* specially handle events for searching */ -static void poselib_preview_handle_search(tPoseLib_PreviewData *pld, - unsigned short event, - char ascii) +static void poselib_preview_handle_search(tPoseLib_PreviewData *pld, ushort event, char ascii) { /* try doing some form of string manipulation first */ switch (event) { diff --git a/source/blender/editors/armature/pose_select.c b/source/blender/editors/armature/pose_select.c index 824cb50d5f1..f29900b0760 100644 --- a/source/blender/editors/armature/pose_select.c +++ b/source/blender/editors/armature/pose_select.c @@ -141,7 +141,7 @@ void ED_pose_bone_select(Object *ob, bPoseChannel *pchan, bool select) bool ED_armature_pose_select_pick_with_buffer(ViewLayer *view_layer, View3D *v3d, Base *base, - const unsigned int *buffer, + const uint *buffer, short hits, bool extend, bool deselect, diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 681b03d691d..de2c3d44caf 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -6549,8 +6549,8 @@ static int curve_dissolve_exec(bContext *C, wmOperator *UNUSED(op)) for (nu = editnurb->first; nu; nu = nu->next) { if ((nu->type == CU_BEZIER) && (nu->pntsu > 2)) { - unsigned int span_step[2] = {nu->pntsu, nu->pntsu}; - unsigned int span_len; + uint span_step[2] = {nu->pntsu, nu->pntsu}; + uint span_len; while (BLI_array_iter_span(nu->bezt, nu->pntsu, @@ -6564,9 +6564,9 @@ static int curve_dissolve_exec(bContext *C, wmOperator *UNUSED(op)) BezTriple *bezt_next = &nu->bezt[mod_i(span_step[1] + 1, nu->pntsu)]; int i_span_edge_len = span_len + 1; - const unsigned int dims = 3; + const uint dims = 3; - const unsigned int points_len = ((cu->resolu - 1) * i_span_edge_len) + 1; + const uint points_len = ((cu->resolu - 1) * i_span_edge_len) + 1; float *points = MEM_mallocN(points_len * dims * sizeof(float), __func__); float *points_stride = points; const int points_stride_len = (cu->resolu - 1); @@ -6591,7 +6591,7 @@ static int curve_dissolve_exec(bContext *C, wmOperator *UNUSED(op)) BLI_assert(points_stride + dims == points + (points_len * dims)); float tan_l[3], tan_r[3], error_sq_dummy; - unsigned int error_index_dummy; + uint error_index_dummy; sub_v3_v3v3(tan_l, bezt_prev->vec[1], bezt_prev->vec[2]); normalize_v3(tan_l); diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c index d028a88e322..748bf040fbb 100644 --- a/source/blender/editors/curve/editcurve_paint.c +++ b/source/blender/editors/curve/editcurve_paint.c @@ -205,7 +205,7 @@ static bool stroke_elem_project(const struct CurveDrawData *cdd, } else { const ViewDepths *depths = rv3d->depths; - if (depths && ((unsigned int)mval_i[0] < depths->w) && ((unsigned int)mval_i[1] < depths->h)) { + if (depths && ((uint)mval_i[0] < depths->w) && ((uint)mval_i[1] < depths->h)) { const double depth = (double)ED_view3d_depth_read_cached(&cdd->vc, mval_i); if ((depth > depths->depth_range[0]) && (depth < depths->depth_range[1])) { if (ED_view3d_depth_unproject(region, mval_i, depth, r_location_world)) { @@ -798,7 +798,7 @@ static int curve_draw_exec(bContext *C, wmOperator *op) float *coords = MEM_mallocN(sizeof(*coords) * stroke_len * dims, __func__); float *cubic_spline = NULL; - unsigned int cubic_spline_len = 0; + uint cubic_spline_len = 0; /* error in object local space */ const int fit_method = RNA_enum_get(op->ptr, "fit_method"); @@ -827,14 +827,14 @@ static int curve_draw_exec(bContext *C, wmOperator *op) } } - unsigned int *corners = NULL; - unsigned int corners_len = 0; + uint *corners = NULL; + uint corners_len = 0; if ((fit_method == CURVE_PAINT_FIT_METHOD_SPLIT) && (corner_angle < (float)M_PI)) { /* this could be configurable... */ const float corner_radius_min = error_threshold / 8; const float corner_radius_max = error_threshold * 2; - const unsigned int samples_max = 16; + const uint samples_max = 16; curve_fit_corners_detect_fl(coords, stroke_len, @@ -847,9 +847,9 @@ static int curve_draw_exec(bContext *C, wmOperator *op) &corners_len); } - unsigned int *corners_index = NULL; - unsigned int corners_index_len = 0; - unsigned int calc_flag = CURVE_FIT_CALC_HIGH_QUALIY; + uint *corners_index = NULL; + uint corners_index_len = 0; + uint calc_flag = CURVE_FIT_CALC_HIGH_QUALIY; if ((stroke_len > 2) && use_cyclic) { calc_flag |= CURVE_FIT_CALC_CYCLIC; @@ -919,14 +919,14 @@ static int curve_draw_exec(bContext *C, wmOperator *op) if (corners_index) { /* ignore the first and last */ - unsigned int i_start = 0, i_end = corners_index_len; + uint i_start = 0, i_end = corners_index_len; if ((corners_index_len >= 2) && (calc_flag & CURVE_FIT_CALC_CYCLIC) == 0) { i_start += 1; i_end -= 1; } - for (unsigned int i = i_start; i < i_end; i++) { + for (uint i = i_start; i < i_end; i++) { bezt = &nu->bezt[corners_index[i]]; bezt->h1 = bezt->h2 = HD_FREE; } diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 297af4cb72d..dc5dc71106f 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -76,7 +76,7 @@ static int kill_selection(Object *obedit, int ins); /** \name Internal Utilities * \{ */ -static wchar_t findaccent(wchar_t char1, unsigned int code) +static wchar_t findaccent(wchar_t char1, uint code) { wchar_t new = 0; diff --git a/source/blender/editors/gizmo_library/geometry/geom_arrow_gizmo.c b/source/blender/editors/gizmo_library/geometry/geom_arrow_gizmo.c index 90196988d94..668b59ac191 100644 --- a/source/blender/editors/gizmo_library/geometry/geom_arrow_gizmo.c +++ b/source/blender/editors/gizmo_library/geometry/geom_arrow_gizmo.c @@ -55,7 +55,7 @@ static float normals[][3] = { {0.000000, 0.000000, 1.000000}, }; -static unsigned short indices[] = { +static ushort indices[] = { 1, 3, 2, 3, 5, 4, 5, 7, 6, 7, 9, 8, 9, 11, 10, 11, 13, 12, 5, 18, 19, 15, 1, 0, 13, 15, 14, 6, 10, 14, 11, 21, 22, 7, 19, 20, 13, 22, 23, 3, 17, 18, 9, 20, 21, 15, 23, 16, 1, 16, 17, 23, 22, 24, 21, 20, 24, 19, 18, 24, 17, 16, 24, 16, 23, 24, 22, 21, 24, diff --git a/source/blender/editors/gizmo_library/geometry/geom_cube_gizmo.c b/source/blender/editors/gizmo_library/geometry/geom_cube_gizmo.c index ea1a3147148..51618e353f4 100644 --- a/source/blender/editors/gizmo_library/geometry/geom_cube_gizmo.c +++ b/source/blender/editors/gizmo_library/geometry/geom_cube_gizmo.c @@ -45,7 +45,7 @@ static const float normals[][3] = { {-0.577349, 0.577349, 0.577349}, }; -static const unsigned short indices[] = { +static const ushort indices[] = { 1, 2, 3, 7, 6, 5, 4, 5, 1, 5, 6, 2, 2, 6, 7, 0, 3, 7, 0, 1, 3, 4, 7, 5, 0, 4, 1, 1, 5, 2, 3, 2, 7, 4, 0, 7, }; diff --git a/source/blender/editors/gizmo_library/geometry/geom_dial_gizmo.c b/source/blender/editors/gizmo_library/geometry/geom_dial_gizmo.c index 273f957e9b6..7e37c233c2a 100644 --- a/source/blender/editors/gizmo_library/geometry/geom_dial_gizmo.c +++ b/source/blender/editors/gizmo_library/geometry/geom_dial_gizmo.c @@ -221,7 +221,7 @@ static const float normals[][3] = { {-0.466689, 0.092807, -0.879513}, {0.512650, -0.101962, -0.852504}, }; -static const unsigned short indices[] = { +static const ushort indices[] = { 6, 7, 1, 7, 8, 2, 8, 9, 3, 9, 10, 4, 10, 11, 5, 5, 11, 6, 12, 13, 7, 13, 14, 8, 14, 15, 9, 15, 16, 10, 16, 17, 11, 11, 17, 12, 18, 19, 13, 13, 19, 20, 20, 21, 15, 15, 21, 22, 22, 23, 17, 17, 23, 18, 24, 25, 19, diff --git a/source/blender/editors/gizmo_library/gizmo_draw_utils.c b/source/blender/editors/gizmo_library/gizmo_draw_utils.c index cffafc56693..01e5a7eacfd 100644 --- a/source/blender/editors/gizmo_library/gizmo_draw_utils.c +++ b/source/blender/editors/gizmo_library/gizmo_draw_utils.c @@ -66,7 +66,7 @@ void wm_gizmo_geometryinfo_draw(const GizmoGeomInfo *info, /* Elements */ GPU_indexbuf_init(&elb, GPU_PRIM_TRIS, info->ntris, info->nverts); for (int i = 0; i < info->ntris; i++) { - const unsigned short *idx = &info->indices[i * 3]; + const ushort *idx = &info->indices[i * 3]; GPU_indexbuf_add_tri_verts(&elb, idx[0], idx[1], idx[2]); } el = GPU_indexbuf_build(&elb); diff --git a/source/blender/editors/gizmo_library/gizmo_geometry.h b/source/blender/editors/gizmo_library/gizmo_geometry.h index ae8ba3c411b..a5f61158f66 100644 --- a/source/blender/editors/gizmo_library/gizmo_geometry.h +++ b/source/blender/editors/gizmo_library/gizmo_geometry.h @@ -30,12 +30,14 @@ #ifndef __GIZMO_GEOMETRY_H__ #define __GIZMO_GEOMETRY_H__ +#include "BLI_sys_types.h" + typedef struct GizmoGeomInfo { int nverts; int ntris; const float (*verts)[3]; const float (*normals)[3]; - const unsigned short *indices; + const ushort *indices; } GizmoGeomInfo; /* arrow gizmo */ diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index edc5087c8dd..075bd8af906 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -759,11 +759,11 @@ static ImBuf *create_mono_icon_with_border(ImBuf *buf, // blur alpha channel const int write_offset = by * (ICON_GRID_W + 2 * ICON_MONO_BORDER_OUTSET) + bx; float alpha_accum = 0.0; - unsigned int alpha_samples = 0; + uint alpha_samples = 0; for (int ax = asx; ax < aex; ax++) { for (int ay = asy; ay < aey; ay++) { const int offset_read = (sy + ay) * buf->x + (sx + ax); - unsigned int color_read = buf->rect[offset_read]; + uint color_read = buf->rect[offset_read]; const float alpha_read = ((color_read & 0xff000000) >> 24) / 255.0; alpha_accum += alpha_read; alpha_samples += 1; @@ -782,8 +782,8 @@ static ImBuf *create_mono_icon_with_border(ImBuf *buf, const float border_srgb[4] = { 0, 0, 0, MIN2(1.0, blurred_alpha * border_sharpness) * border_intensity}; - const unsigned int color_read = buf->rect[offset_write]; - const unsigned char *orig_color = (unsigned char *)&color_read; + const uint color_read = buf->rect[offset_write]; + const uchar *orig_color = (uchar *)&color_read; float border_rgba[4]; float orig_rgba[4]; @@ -795,8 +795,8 @@ static ImBuf *create_mono_icon_with_border(ImBuf *buf, blend_color_interpolate_float(dest_rgba, orig_rgba, border_rgba, 1.0 - orig_rgba[3]); linearrgb_to_srgb_v4(dest_srgb, dest_rgba); - unsigned int alpha_mask = ((unsigned int)(dest_srgb[3] * 255)) << 24; - unsigned int cpack = rgb_to_cpack(dest_srgb[0], dest_srgb[1], dest_srgb[2]) | alpha_mask; + uint alpha_mask = ((uint)(dest_srgb[3] * 255)) << 24; + uint cpack = rgb_to_cpack(dest_srgb[0], dest_srgb[1], dest_srgb[2]) | alpha_mask; result->rect[offset_write] = cpack; } } @@ -1892,7 +1892,7 @@ static void icon_draw_size(float x, mul_v4_fl(color, alpha); float border_outset = 0.0; - unsigned int border_texel = 0; + uint border_texel = 0; #ifndef WITH_HEADLESS if (with_border) { const float scale = (float)ICON_GRID_W / (float)ICON_DEFAULT_WIDTH; diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index e5af8768e6e..01c9716ec86 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1198,7 +1198,7 @@ void UI_GetThemeColor4fv(int colorid, float col[4]) void UI_GetThemeColorType4fv(int colorid, int spacetype, float col[4]) { - const unsigned char *cp = UI_ThemeGetColorPtr(theme_active, spacetype, colorid); + const uchar *cp = UI_ThemeGetColorPtr(theme_active, spacetype, colorid); col[0] = ((float)cp[0]) / 255.0f; col[1] = ((float)cp[1]) / 255.0f; col[2] = ((float)cp[2]) / 255.0f; diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c index 2fda383ebb7..91c02408f95 100644 --- a/source/blender/editors/mask/mask_draw.c +++ b/source/blender/editors/mask/mask_draw.c @@ -57,7 +57,7 @@ static void mask_spline_color_get(MaskLayer *mask_layer, MaskSpline *spline, const bool is_sel, - unsigned char r_rgb[4]) + uchar r_rgb[4]) { if (is_sel) { if (mask_layer->act_spline == spline) { @@ -79,7 +79,7 @@ static void mask_spline_color_get(MaskLayer *mask_layer, static void mask_spline_feather_color_get(MaskLayer *UNUSED(mask_layer), MaskSpline *UNUSED(spline), const bool is_sel, - unsigned char r_rgb[4]) + uchar r_rgb[4]) { if (is_sel) { r_rgb[1] = 255; @@ -124,7 +124,7 @@ static void draw_single_handle(const MaskLayer *mask_layer, GPUVertFormat *format = immVertexFormat(); uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); - const unsigned char rgb_gray[4] = {0x60, 0x60, 0x60, 0xff}; + const uchar rgb_gray[4] = {0x60, 0x60, 0x60, 0xff}; immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3ubv(rgb_gray); @@ -194,7 +194,7 @@ static void draw_spline_points(const bContext *C, (mask_layer->restrictflag & MASK_RESTRICT_SELECT) == 0; const bool is_smooth = (draw_flag & MASK_DRAWFLAG_SMOOTH) != 0; - unsigned char rgb_spline[4]; + uchar rgb_spline[4]; MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline); SpaceClip *sc = CTX_wm_space_clip(C); bool undistort = false; @@ -368,28 +368,26 @@ static void draw_spline_points(const bContext *C, } } -static void mask_color_active_tint(unsigned char r_rgb[4], - const unsigned char rgb[4], - const bool is_active) +static void mask_color_active_tint(uchar r_rgb[4], const uchar rgb[4], const bool is_active) { if (!is_active) { - r_rgb[0] = (unsigned char)((((int)(rgb[0])) + 128) / 2); - r_rgb[1] = (unsigned char)((((int)(rgb[1])) + 128) / 2); - r_rgb[2] = (unsigned char)((((int)(rgb[2])) + 128) / 2); + r_rgb[0] = (uchar)((((int)(rgb[0])) + 128) / 2); + r_rgb[1] = (uchar)((((int)(rgb[1])) + 128) / 2); + r_rgb[2] = (uchar)((((int)(rgb[2])) + 128) / 2); r_rgb[3] = rgb[3]; } else { - *(unsigned int *)r_rgb = *(const unsigned int *)rgb; + *(uint *)r_rgb = *(const uint *)rgb; } } -static void mask_draw_array(unsigned int pos, +static void mask_draw_array(uint pos, GPUPrimType prim_type, const float (*points)[2], - unsigned int vertex_len) + uint vertex_len) { immBegin(prim_type, vertex_len); - for (unsigned int i = 0; i < vertex_len; i++) { + for (uint i = 0; i < vertex_len; i++) { immVertex2fv(pos, points[i]); } immEnd(); @@ -401,13 +399,13 @@ static void mask_draw_curve_type(const bContext *C, int tot_point, const bool is_feather, const bool is_active, - const unsigned char rgb_spline[4], + const uchar rgb_spline[4], const char draw_type) { const GPUPrimType draw_method = (spline->flag & MASK_SPLINE_CYCLIC) ? GPU_PRIM_LINE_LOOP : GPU_PRIM_LINE_STRIP; - const unsigned char rgb_black[4] = {0x00, 0x00, 0x00, 0xff}; - unsigned char rgb_tmp[4]; + const uchar rgb_black[4] = {0x00, 0x00, 0x00, 0xff}; + uchar rgb_tmp[4]; SpaceClip *sc = CTX_wm_space_clip(C); float(*points)[2] = orig_points; @@ -469,9 +467,9 @@ static void mask_draw_curve_type(const bContext *C, } if (is_feather) { - rgb_tmp[0] = (unsigned char)(((short)rgb_tmp[0] + (short)rgb_spline[0]) / 2); - rgb_tmp[1] = (unsigned char)(((short)rgb_tmp[1] + (short)rgb_spline[1]) / 2); - rgb_tmp[2] = (unsigned char)(((short)rgb_tmp[2] + (short)rgb_spline[2]) / 2); + rgb_tmp[0] = (uchar)(((short)rgb_tmp[0] + (short)rgb_spline[0]) / 2); + rgb_tmp[1] = (uchar)(((short)rgb_tmp[1] + (short)rgb_spline[1]) / 2); + rgb_tmp[2] = (uchar)(((short)rgb_tmp[2] + (short)rgb_spline[2]) / 2); } mask_color_active_tint(rgb_tmp, rgb_tmp, is_active); @@ -525,20 +523,20 @@ static void draw_spline_curve(const bContext *C, const int width, const int height) { - const unsigned int resol = max_ii(BKE_mask_spline_feather_resolution(spline, width, height), - BKE_mask_spline_resolution(spline, width, height)); + const uint resol = max_ii(BKE_mask_spline_feather_resolution(spline, width, height), + BKE_mask_spline_resolution(spline, width, height)); - unsigned char rgb_tmp[4]; + uchar rgb_tmp[4]; const bool is_spline_sel = (spline->flag & SELECT) && (mask_layer->restrictflag & MASK_RESTRICT_SELECT) == 0; const bool is_smooth = (draw_flag & MASK_DRAWFLAG_SMOOTH) != 0; const bool is_fill = (spline->flag & MASK_SPLINE_NOFILL) == 0; - unsigned int tot_diff_point; + uint tot_diff_point; float(*diff_points)[2]; - unsigned int tot_feather_point; + uint tot_feather_point; float(*feather_points)[2]; diff_points = BKE_mask_spline_differentiate_with_resolution(spline, &tot_diff_point, resol); @@ -801,7 +799,7 @@ void ED_mask_draw_frames( return; } - unsigned int num_lines = BLI_listbase_count(&mask_layer->splines_shapes); + uint num_lines = BLI_listbase_count(&mask_layer->splines_shapes); if (num_lines == 0) { return; } diff --git a/source/blender/editors/mask/mask_query.c b/source/blender/editors/mask/mask_query.c index 8caf5f2ed7b..6b1bb0a08e2 100644 --- a/source/blender/editors/mask/mask_query.c +++ b/source/blender/editors/mask/mask_query.c @@ -99,13 +99,13 @@ bool ED_mask_find_nearest_diff_point(const bContext *C, for (i = 0, cur_point_eval = use_deform ? spline_eval->points_deform : spline_eval->points; i < spline_eval->tot_point; i++, cur_point_eval++) { - unsigned int tot_diff_point; + uint tot_diff_point; float *diff_points = BKE_mask_point_segment_diff( spline_eval, cur_point_eval, width, height, &tot_diff_point); if (diff_points) { int j, tot_point; - unsigned int tot_feather_point; + uint tot_feather_point; float *feather_points = NULL, *points; if (feather) { diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c index 3d20b58b905..b303c4c7e4e 100644 --- a/source/blender/editors/mesh/editface.c +++ b/source/blender/editors/mesh/editface.c @@ -190,7 +190,7 @@ void paintface_reveal(bContext *C, Object *ob, const bool select) /* Set tface seams based on edge data, uses hash table to find seam edges. */ -static void select_linked_tfaces_with_seams(Mesh *me, const unsigned int index, const bool select) +static void select_linked_tfaces_with_seams(Mesh *me, const uint index, const bool select) { MPoly *mp; MLoop *ml; @@ -201,7 +201,7 @@ static void select_linked_tfaces_with_seams(Mesh *me, const unsigned int index, BLI_bitmap *edge_tag = BLI_BITMAP_NEW(me->totedge, __func__); BLI_bitmap *poly_tag = BLI_BITMAP_NEW(me->totpoly, __func__); - if (index != (unsigned int)-1) { + if (index != (uint)-1) { /* only put face under cursor in array */ mp = &me->mpoly[index]; BKE_mesh_poly_edgebitmap_insert(edge_tag, mp, me->mloop + mp->loopstart); @@ -267,7 +267,7 @@ static void select_linked_tfaces_with_seams(Mesh *me, const unsigned int index, void paintface_select_linked(bContext *C, Object *ob, const int mval[2], const bool select) { Mesh *me; - unsigned int index = (unsigned int)-1; + uint index = (uint)-1; me = BKE_mesh_from_object(ob); if (me == NULL || me->totpoly == 0) { diff --git a/source/blender/editors/mesh/editmesh_intersect.c b/source/blender/editors/mesh/editmesh_intersect.c index 7718a07a55e..0c37a2604d9 100644 --- a/source/blender/editors/mesh/editmesh_intersect.c +++ b/source/blender/editors/mesh/editmesh_intersect.c @@ -479,7 +479,7 @@ static bool bm_vert_in_faces_radial(BMVert *v, BMEdge *e_radial, BMFace *f_ignor struct LinkBase { LinkNode *list; - unsigned int list_len; + uint list_len; }; static void ghash_insert_face_edge_link(GHash *gh, @@ -535,7 +535,7 @@ static void bm_face_split_by_edges_island_connect( } { - unsigned int edge_arr_holes_len; + uint edge_arr_holes_len; BMEdge **edge_arr_holes; if (BM_face_split_edgenet_connect_islands(bm, f, @@ -765,7 +765,7 @@ static int edbm_face_split_by_edges_exec(bContext *C, wmOperator *UNUSED(op)) BMIter liter; BMLoop *l; - unsigned int loop_stack_len; + uint loop_stack_len; BMLoop *l_best = NULL; BLI_assert(BLI_SMALLSTACK_IS_EMPTY(loop_stack)); diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 373dfc811ec..fd92d864a28 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -1579,7 +1579,7 @@ static void knife_find_line_hits(KnifeTool_OpData *kcd) float line_tol, line_tol_sq; float face_tol, face_tol_sq; int isect_kind; - unsigned int tot; + uint tot; int i; const bool use_hit_prev = true; const bool use_hit_curr = (kcd->is_drag_hold == false); @@ -2419,7 +2419,7 @@ static void knife_make_face_cuts(KnifeTool_OpData *kcd, BMFace *f, ListBase *kfe edge_array_len = i; #ifdef USE_NET_ISLAND_CONNECT - unsigned int edge_array_holes_len; + uint edge_array_holes_len; BMEdge **edge_array_holes; if (BM_face_split_edgenet_connect_islands(bm, f, diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c index a1ea6074044..5d9923c6a7d 100644 --- a/source/blender/editors/mesh/editmesh_rip.c +++ b/source/blender/editors/mesh/editmesh_rip.c @@ -402,7 +402,7 @@ static UnorderedLoopPair *edbm_tagged_loop_pairs_to_fill(BMesh *bm) BMIter iter; BMEdge *e; - unsigned int total_tag = 0; + uint total_tag = 0; /* count tags, could be pre-calculated */ BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { if (BM_elem_flag_test(e, BM_ELEM_TAG)) { @@ -441,8 +441,8 @@ static UnorderedLoopPair *edbm_tagged_loop_pairs_to_fill(BMesh *bm) static void edbm_tagged_loop_pairs_do_fill_faces(BMesh *bm, UnorderedLoopPair *uloop_pairs) { UnorderedLoopPair *ulp; - unsigned int total_tag = MEM_allocN_len(uloop_pairs) / sizeof(UnorderedLoopPair); - unsigned int i; + uint total_tag = MEM_allocN_len(uloop_pairs) / sizeof(UnorderedLoopPair); + uint i; for (i = 0, ulp = uloop_pairs; i < total_tag; i++, ulp++) { if ((ulp->l_pair[0] && ulp->l_pair[1]) && (ulp->l_pair[0]->e != ulp->l_pair[1]->e)) { diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 58e10764145..b9ac24e1d03 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -756,7 +756,7 @@ static bool edbm_add_edge_face__smooth_get(BMesh *bm) BMEdge *e; BMIter iter; - unsigned int vote_on_smooth[2] = {0, 0}; + uint vote_on_smooth[2] = {0, 0}; BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { if (BM_elem_flag_test(e, BM_ELEM_SELECT) && e->l) { @@ -6122,7 +6122,7 @@ static void sort_bmelem_flag(bContext *C, const int flag, const int action, const int reverse, - const unsigned int seed) + const uint seed) { BMEditMesh *em = BKE_editmesh_from_object(ob); @@ -6135,7 +6135,7 @@ static void sort_bmelem_flag(bContext *C, /* Just to mark protected elements. */ char *pblock[3] = {NULL, NULL, NULL}, *pb; BMElemSort *sblock[3] = {NULL, NULL, NULL}, *sb; - unsigned int *map[3] = {NULL, NULL, NULL}, *mp; + uint *map[3] = {NULL, NULL, NULL}, *mp; int totelem[3] = {0, 0, 0}; int affected[3] = {0, 0, 0}; int i, j; @@ -6312,7 +6312,7 @@ static void sort_bmelem_flag(bContext *C, } else if (action == SRT_SELECTED) { - unsigned int *tbuf[3] = {NULL, NULL, NULL}, *tb; + uint *tbuf[3] = {NULL, NULL, NULL}, *tb; if (totelem[0]) { tb = tbuf[0] = MEM_callocN(sizeof(int) * totelem[0], "sort_bmelem vert tbuf"); @@ -6576,7 +6576,7 @@ static int edbm_sort_elements_exec(bContext *C, wmOperator *op) const int action = RNA_enum_get(op->ptr, "type"); PropertyRNA *prop_elem_types = RNA_struct_find_property(op->ptr, "elements"); const bool use_reverse = RNA_boolean_get(op->ptr, "reverse"); - unsigned int seed = RNA_int_get(op->ptr, "seed"); + uint seed = RNA_int_get(op->ptr, "seed"); int elem_types = 0; if (ELEM(action, SRT_VIEW_ZAXIS, SRT_VIEW_XAXIS)) { diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index f44a94a63f8..0bdc9e4e6ea 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -539,7 +539,7 @@ UvVertMap *BM_uv_vert_map_create(BMesh *bm, UvVertMap *vmap; UvMapVert *buf; MLoopUV *luv; - unsigned int a; + uint a; int totverts, i, totuv, totfaces; const int cd_loop_uv_offset = CustomData_get_offset(&bm->ldata, CD_MLOOPUV); bool *winding = NULL; @@ -669,7 +669,7 @@ UvVertMap *BM_uv_vert_map_create(BMesh *bm, return vmap; } -UvMapVert *BM_uv_vert_map_at_index(UvVertMap *vmap, unsigned int v) +UvMapVert *BM_uv_vert_map_at_index(UvVertMap *vmap, uint v) { return vmap->vert[v]; } @@ -832,7 +832,7 @@ UvElementMap *BM_uv_element_map_create(BMesh *bm, } if (do_islands) { - unsigned int *map; + uint *map; BMFace **stack; int stacksize = 0; UvElement *islandbuf; @@ -1224,7 +1224,7 @@ BMFace *EDBM_verts_mirror_get_face(BMEditMesh *em, BMFace *f) BMVert **v_mirr_arr = BLI_array_alloca(v_mirr_arr, f->len); BMLoop *l_iter, *l_first; - unsigned int i = 0; + uint i = 0; l_iter = l_first = BM_FACE_FIRST_LOOP(f); do { diff --git a/source/blender/editors/mesh/mesh_mirror.c b/source/blender/editors/mesh/mesh_mirror.c index 9b599d8df7f..a4243c13940 100644 --- a/source/blender/editors/mesh/mesh_mirror.c +++ b/source/blender/editors/mesh/mesh_mirror.c @@ -119,7 +119,7 @@ int ED_mesh_mirror_spatial_table( /** \name Mesh Topology Mirror API * \{ */ -typedef unsigned int MirrTopoHash_t; +typedef uint MirrTopoHash_t; typedef struct MirrTopoVert_t { MirrTopoHash_t hash; @@ -231,7 +231,7 @@ void ED_mesh_mirrtopo_init(BMEditMesh *em, medge = me->medge; for (a = 0, med = medge; a < totedge; a++, med++) { - const unsigned int i1 = med->v1, i2 = med->v2; + const uint i1 = med->v1, i2 = med->v2; topo_hash[i1]++; topo_hash[i2]++; } @@ -257,7 +257,7 @@ void ED_mesh_mirrtopo_init(BMEditMesh *em, } else { for (a = 0, med = medge; a < totedge; a++, med++) { - const unsigned int i1 = med->v1, i2 = med->v2; + const uint i1 = med->v1, i2 = med->v2; topo_hash[i1] += topo_hash_prev[i2] * topo_pass; topo_hash[i2] += topo_hash_prev[i1] * topo_pass; tot_unique_edges += (topo_hash[i1] != topo_hash[i2]); diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 6c5106d3eec..62237b46481 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -1023,10 +1023,10 @@ static float *editmesh_get_mirror_uv( #endif -static unsigned int mirror_facehash(const void *ptr) +static uint mirror_facehash(const void *ptr) { const MFace *mf = ptr; - unsigned int v0, v1; + uint v0, v1; if (mf->v4) { v0 = MIN4(mf->v1, mf->v2, mf->v3, mf->v4); @@ -1119,8 +1119,8 @@ int *mesh_get_x_mirror_faces(Object *ob, BMEditMesh *em, Mesh *me_eval) /* make sure v4 is not 0 if a quad */ if (mf->v4 && mirrormf.v4 == 0) { - SWAP(unsigned int, mirrormf.v1, mirrormf.v3); - SWAP(unsigned int, mirrormf.v2, mirrormf.v4); + SWAP(uint, mirrormf.v1, mirrormf.v3); + SWAP(uint, mirrormf.v2, mirrormf.v4); } hashmf = BLI_ghash_lookup(fhash, &mirrormf); @@ -1174,7 +1174,7 @@ bool ED_mesh_pick_face(bContext *C, Object *ob, const int mval[2], uint dist_px, *r_index = DRW_select_buffer_sample_point(vc.depsgraph, vc.region, vc.v3d, mval); } - if ((*r_index) == 0 || (*r_index) > (unsigned int)me->totpoly) { + if ((*r_index) == 0 || (*r_index) > (uint)me->totpoly) { return false; } @@ -1218,7 +1218,7 @@ bool ED_mesh_pick_face_vert( bContext *C, Object *ob, const int mval[2], uint dist_px, uint *r_index) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); - unsigned int poly_index; + uint poly_index; Mesh *me = ob->data; BLI_assert(me && GS(me->id.name) == ID_ME); @@ -1241,7 +1241,7 @@ bool ED_mesh_pick_face_vert( MPoly *me_eval_mpoly; MLoop *me_eval_mloop; MVert *me_eval_mvert; - unsigned int me_eval_mpoly_len; + uint me_eval_mpoly_len; const int *index_mp_to_orig; me_eval_mpoly = me_eval->mpoly; @@ -1254,7 +1254,7 @@ bool ED_mesh_pick_face_vert( /* tag all verts using this face */ if (index_mp_to_orig) { - unsigned int i; + uint i; for (i = 0; i < me_eval_mpoly_len; i++) { if (index_mp_to_orig[i] == poly_index) { diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c index a64674deda4..b96f225f660 100644 --- a/source/blender/editors/metaball/mball_edit.c +++ b/source/blender/editors/metaball/mball_edit.c @@ -697,7 +697,7 @@ bool ED_mball_select_pick(bContext *C, const int mval[2], bool extend, bool dese static MetaElem *startelem = NULL; ViewContext vc; int a, hits; - unsigned int buffer[MAXPICKBUF]; + uint buffer[MAXPICKBUF]; rcti rect; ED_view3d_viewcontext_init(C, &vc, depsgraph); diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index ac2958282c1..65d3196d8c3 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1738,10 +1738,10 @@ static void copy_object_set_idnew(bContext *C) * In other words, we consider each group of objects from a same item as being * the 'local group' where to check for parents. */ -static unsigned int dupliobject_hash(const void *ptr) +static uint dupliobject_hash(const void *ptr) { const DupliObject *dob = ptr; - unsigned int hash = BLI_ghashutil_ptrhash(dob->ob); + uint hash = BLI_ghashutil_ptrhash(dob->ob); if (dob->type == OB_DUPLICOLLECTION) { for (int i = 1; (i < MAX_DUPLI_RECUR) && dob->persistent_id[i] != INT_MAX; i++) { @@ -1760,10 +1760,10 @@ static unsigned int dupliobject_hash(const void *ptr) * since its a unique index and we only want to know if the group objects are from the same * dupli-group instance. */ -static unsigned int dupliobject_instancer_hash(const void *ptr) +static uint dupliobject_instancer_hash(const void *ptr) { const DupliObject *dob = ptr; - unsigned int hash = BLI_ghashutil_inthash(dob->persistent_id[0]); + uint hash = BLI_ghashutil_inthash(dob->persistent_id[0]); for (int i = 1; (i < MAX_DUPLI_RECUR) && dob->persistent_id[i] != INT_MAX; i++) { hash ^= (dob->persistent_id[i] ^ i); } diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c index 7d39d2546b6..481d5dfb9a5 100644 --- a/source/blender/editors/object/object_bake_api.c +++ b/source/blender/editors/object/object_bake_api.c @@ -234,7 +234,7 @@ static bool write_internal_bake_pixels(Image *image, ibuf->x); } else { - IMB_buffer_byte_from_float((unsigned char *)ibuf->rect, + IMB_buffer_byte_from_float((uchar *)ibuf->rect, buffer, ibuf->channels, ibuf->dither, @@ -259,7 +259,7 @@ static bool write_internal_bake_pixels(Image *image, mask_buffer); } else { - IMB_buffer_byte_from_float_mask((unsigned char *)ibuf->rect, + IMB_buffer_byte_from_float_mask((uchar *)ibuf->rect, buffer, ibuf->channels, ibuf->dither, @@ -359,7 +359,7 @@ static bool write_external_bake_pixels(const char *filepath, buffer, ibuf->x, ibuf->y, ibuf->channels, from_colorspace, to_colorspace, false); } - IMB_buffer_byte_from_float((unsigned char *)ibuf->rect, + IMB_buffer_byte_from_float((uchar *)ibuf->rect, buffer, ibuf->channels, ibuf->dither, diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 0de2f114b94..2babf27eb61 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -2148,7 +2148,7 @@ static int correctivesmooth_bind_exec(bContext *C, wmOperator *op) /* Signal to modifier to recalculate. */ CorrectiveSmoothModifierData *csmd_eval = (CorrectiveSmoothModifierData *) modifier_get_evaluated(depsgraph, ob, &csmd->modifier); - csmd_eval->bind_coords_num = (unsigned int)-1; + csmd_eval->bind_coords_num = (uint)-1; /* Force modifier to run, it will call binding routine * (this has to happen outside of depsgraph evaluation). */ diff --git a/source/blender/editors/object/object_random.c b/source/blender/editors/object/object_random.c index 43aaecb887b..a6958c798f1 100644 --- a/source/blender/editors/object/object_random.c +++ b/source/blender/editors/object/object_random.c @@ -50,7 +50,7 @@ static bool object_rand_transverts(TransVertStore *tvs, const float offset, const float uniform, const float normal_factor, - const unsigned int seed) + const uint seed) { bool use_normal = (normal_factor != 0.0f); struct RNG *rng; @@ -100,7 +100,7 @@ static int object_rand_verts_exec(bContext *C, wmOperator *op) const float offset = RNA_float_get(op->ptr, "offset"); const float uniform = RNA_float_get(op->ptr, "uniform"); const float normal_factor = RNA_float_get(op->ptr, "normal"); - const unsigned int seed = RNA_int_get(op->ptr, "seed"); + const uint seed = RNA_int_get(op->ptr, "seed"); bool changed_multi = false; uint objects_len = 0; diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 3166c9ddea1..5d821308759 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1424,7 +1424,7 @@ void OBJECT_OT_track_set(wmOperatorType *ot) * \{ */ #if 0 -static void link_to_scene(Main *UNUSED(bmain), unsigned short UNUSED(nr)) +static void link_to_scene(Main *UNUSED(bmain), ushort UNUSED(nr)) { Scene *sce = (Scene *)BLI_findlink(&bmain->scene, G.curscreen->scenenr - 1); Base *base, *nbase; diff --git a/source/blender/editors/object/object_remesh.c b/source/blender/editors/object/object_remesh.c index 8a803821fe4..b2b372df055 100644 --- a/source/blender/editors/object/object_remesh.c +++ b/source/blender/editors/object/object_remesh.c @@ -653,13 +653,13 @@ static bool mesh_is_manifold_consistent(Mesh *mesh) const MLoop *mloop = mesh->mloop; char *edge_faces = (char *)MEM_callocN(mesh->totedge * sizeof(char), "remesh_manifold_check"); int *edge_vert = (int *)MEM_malloc_arrayN( - mesh->totedge, sizeof(unsigned int), "remesh_consistent_check"); + mesh->totedge, sizeof(uint), "remesh_consistent_check"); - for (unsigned int i = 0; i < mesh->totedge; i++) { + for (uint i = 0; i < mesh->totedge; i++) { edge_vert[i] = -1; } - for (unsigned int loop_idx = 0; loop_idx < mesh->totloop; loop_idx++) { + for (uint loop_idx = 0; loop_idx < mesh->totloop; loop_idx++) { const MLoop *loop = &mloop[loop_idx]; edge_faces[loop->e] += 1; if (edge_faces[loop->e] > 2) { @@ -679,7 +679,7 @@ static bool mesh_is_manifold_consistent(Mesh *mesh) if (is_manifold_consistent) { /* check for wire edges */ - for (unsigned int i = 0; i < mesh->totedge; i++) { + for (uint i = 0; i < mesh->totedge; i++) { if (edge_faces[i] == 0) { is_manifold_consistent = false; break; diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 28bb28a0298..46245d21d5b 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -1860,8 +1860,7 @@ static int object_transform_axis_target_modal(bContext *C, wmOperator *op, const if (event->type == MOUSEMOVE || is_translate_init) { const ViewDepths *depths = xfd->vc.rv3d->depths; - if (depths && ((unsigned int)event->mval[0] < depths->w) && - ((unsigned int)event->mval[1] < depths->h)) { + if (depths && ((uint)event->mval[0] < depths->w) && ((uint)event->mval[1] < depths->h)) { double depth = (double)ED_view3d_depth_read_cached(&xfd->vc, event->mval); float location_world[3]; if (depth == 1.0f) { diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index 442f700ad6f..5a701ef8aa8 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -151,7 +151,7 @@ typedef struct OGLRender { eImageFormatDepth color_depth; SpinLock reports_lock; - unsigned int num_scheduled_frames; + uint num_scheduled_frames; ThreadMutex task_mutex; ThreadCondition task_condition; @@ -296,7 +296,7 @@ static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, R const short view_context = (v3d != NULL); bool draw_sky = (scene->r.alphamode == R_ADDSKY); float *rectf = NULL; - unsigned char *rect = NULL; + uchar *rect = NULL; const char *viewname = RE_GetActiveRenderView(oglrender->re); ImBuf *ibuf_result = NULL; @@ -334,9 +334,8 @@ static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, R if (gpd) { int i; - unsigned char *gp_rect; - unsigned char *render_rect = - (unsigned char *)RE_RenderViewGetById(rr, oglrender->view_id)->rect32; + uchar *gp_rect; + uchar *render_rect = (uchar *)RE_RenderViewGetById(rr, oglrender->view_id)->rect32; DRW_opengl_context_enable(); GPU_offscreen_bind(oglrender->ofs, true); @@ -352,7 +351,7 @@ static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, R ED_annotation_draw_ex(scene, gpd, sizex, sizey, scene->r.cfra, SPACE_SEQ); G.f &= ~G_FLAG_RENDER_VIEWPORT; - gp_rect = MEM_mallocN(sizex * sizey * sizeof(unsigned char) * 4, "offscreen rect"); + gp_rect = MEM_mallocN(sizex * sizey * sizeof(uchar) * 4, "offscreen rect"); GPU_offscreen_read_pixels(oglrender->ofs, GL_UNSIGNED_BYTE, gp_rect); for (i = 0; i < sizex * sizey * 4; i += 4) { @@ -414,7 +413,7 @@ static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, R rectf = ibuf_view->rect_float; } else { - rect = (unsigned char *)ibuf_view->rect; + rect = (uchar *)ibuf_view->rect; } } else { diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 1427c6ed500..fc22e3cd3e0 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -167,7 +167,7 @@ typedef struct ShaderPreview { float color[4]; int sizex, sizey; - unsigned int *pr_rect; + uint *pr_rect; int pr_method; bool own_id_copy; @@ -178,7 +178,7 @@ typedef struct ShaderPreview { typedef struct IconPreviewSize { struct IconPreviewSize *next, *prev; int sizex, sizey; - unsigned int *rect; + uint *rect; } IconPreviewSize; typedef struct IconPreview { @@ -621,14 +621,14 @@ static bool ed_preview_draw_rect(ScrArea *sa, int split, int first, rcti *rect, newrect->ymax = max_ii(newrect->ymax, rect->ymin + rres.recty); if (rres.rectx && rres.recty) { - unsigned char *rect_byte = MEM_mallocN(rres.rectx * rres.recty * sizeof(int), - "ed_preview_draw_rect"); + uchar *rect_byte = MEM_mallocN(rres.rectx * rres.recty * sizeof(int), + "ed_preview_draw_rect"); float fx = rect->xmin + offx; float fy = rect->ymin; /* material preview only needs monoscopy (view 0) */ if (re) { - RE_AcquiredResultGet32(re, &rres, (unsigned int *)rect_byte, 0); + RE_AcquiredResultGet32(re, &rres, (uint *)rect_byte, 0); } IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_COLOR); @@ -1014,10 +1014,10 @@ static void shader_preview_free(void *customdata) /* ************************* icon preview ********************** */ -static void icon_copy_rect(ImBuf *ibuf, unsigned int w, unsigned int h, unsigned int *rect) +static void icon_copy_rect(ImBuf *ibuf, uint w, uint h, uint *rect) { struct ImBuf *ima; - unsigned int *drect, *srect; + uint *drect, *srect; float scaledx, scaledy; short ex, ey, dx, dy; @@ -1144,7 +1144,7 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat br->icon_imbuf = get_brush_icon(br); - memset(sp->pr_rect, 0x88, sp->sizex * sp->sizey * sizeof(unsigned int)); + memset(sp->pr_rect, 0x88, sp->sizex * sp->sizey * sizeof(uint)); if (!(br->icon_imbuf) || !(br->icon_imbuf->rect)) { return; @@ -1193,7 +1193,7 @@ static void common_preview_startjob(void *customdata, /* exported functions */ -static void icon_preview_add_size(IconPreview *ip, unsigned int *rect, int sizex, int sizey) +static void icon_preview_add_size(IconPreview *ip, uint *rect, int sizex, int sizey) { IconPreviewSize *cur_size = ip->sizes.first, *new_size; @@ -1324,8 +1324,7 @@ static void icon_preview_free(void *customdata) MEM_freeN(ip); } -void ED_preview_icon_render( - Main *bmain, Scene *scene, ID *id, unsigned int *rect, int sizex, int sizey) +void ED_preview_icon_render(Main *bmain, Scene *scene, ID *id, uint *rect, int sizex, int sizey) { IconPreview ip = {NULL}; short stop = false, update = false; @@ -1348,13 +1347,8 @@ void ED_preview_icon_render( BLI_freelistN(&ip.sizes); } -void ED_preview_icon_job(const bContext *C, - void *owner, - ID *id, - unsigned int *rect, - int sizex, - int sizey, - const bool delay) +void ED_preview_icon_job( + const bContext *C, void *owner, ID *id, uint *rect, int sizex, int sizey, const bool delay) { wmJob *wm_job; IconPreview *ip, *old_ip; diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index e1fa4caafbd..a0dfa54f8f5 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -506,7 +506,7 @@ static int material_slot_move_exec(bContext *C, wmOperator *op) { Object *ob = ED_object_context(C); - unsigned int *slot_remap; + uint *slot_remap; int index_pair[2]; int dir = RNA_enum_get(op->ptr, "direction"); @@ -531,7 +531,7 @@ static int material_slot_move_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - slot_remap = MEM_mallocN(sizeof(unsigned int) * ob->totcol, __func__); + slot_remap = MEM_mallocN(sizeof(uint) * ob->totcol, __func__); range_vn_u(slot_remap, ob->totcol, 0); diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index f757b856dcf..ddb345ab65e 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -132,7 +132,7 @@ void immDrawPixelsTexScaled_clipping(IMMDrawPixelsTexState *state, float yzoom, float color[4]) { - unsigned char *uc_rect = (unsigned char *)rect; + uchar *uc_rect = (uchar *)rect; const float *f_rect = (float *)rect; int subpart_x, subpart_y, tex_w, tex_h; int seamless, offset_x, offset_y, nsubparts_x, nsubparts_y; @@ -185,7 +185,7 @@ void immDrawPixelsTexScaled_clipping(IMMDrawPixelsTexState *state, glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, tex_w, tex_h, 0, format, GL_UNSIGNED_BYTE, NULL); } - unsigned int pos = state->pos, texco = state->texco; + uint pos = state->pos, texco = state->texco; /* optional */ /* NOTE: Shader could be null for GLSL OCIO drawing, it is fine, since @@ -650,7 +650,7 @@ void ED_draw_imbuf_clipping(ImBuf *ibuf, /* In case GLSL failed or not usable, fallback to glaDrawPixelsAuto */ if (need_fallback) { - unsigned char *display_buffer; + uchar *display_buffer; void *cache_handle; display_buffer = IMB_display_buffer_acquire( @@ -758,7 +758,7 @@ int ED_draw_imbuf_method(ImBuf *ibuf) /* don't move to GPU_immediate_util.h because this uses user-prefs * and isn't very low level */ -void immDrawBorderCorners(unsigned int pos, const rcti *border, float zoomx, float zoomy) +void immDrawBorderCorners(uint pos, const rcti *border, float zoomx, float zoomy) { float delta_x = 4.0f * UI_DPI_FAC / zoomx; float delta_y = 4.0f * UI_DPI_FAC / zoomy; diff --git a/source/blender/editors/screen/screen_draw.c b/source/blender/editors/screen/screen_draw.c index 3331f4db11b..dbc7609722c 100644 --- a/source/blender/editors/screen/screen_draw.c +++ b/source/blender/editors/screen/screen_draw.c @@ -41,7 +41,7 @@ * Draw horizontal shape visualizing future joining * (left as well right direction of future joining). */ -static void draw_horizontal_join_shape(ScrArea *sa, char dir, unsigned int pos) +static void draw_horizontal_join_shape(ScrArea *sa, char dir, uint pos) { const float width = screen_geom_area_width(sa) - 1; const float height = screen_geom_area_height(sa) - 1; @@ -122,7 +122,7 @@ static void draw_horizontal_join_shape(ScrArea *sa, char dir, unsigned int pos) /** * Draw vertical shape visualizing future joining (up/down direction). */ -static void draw_vertical_join_shape(ScrArea *sa, char dir, unsigned int pos) +static void draw_vertical_join_shape(ScrArea *sa, char dir, uint pos) { const float width = screen_geom_area_width(sa) - 1; const float height = screen_geom_area_height(sa) - 1; @@ -203,7 +203,7 @@ static void draw_vertical_join_shape(ScrArea *sa, char dir, unsigned int pos) /** * Draw join shape due to direction of joining. */ -static void draw_join_shape(ScrArea *sa, char dir, unsigned int pos) +static void draw_join_shape(ScrArea *sa, char dir, uint pos) { if (dir == 'u' || dir == 'd') { draw_vertical_join_shape(sa, dir, pos); @@ -294,7 +294,7 @@ static GPUBatch *batch_screen_edges_get(int *corner_len) /** * Draw screen area darker with arrow (visualization of future joining). */ -static void scrarea_draw_shape_dark(ScrArea *sa, char dir, unsigned int pos) +static void scrarea_draw_shape_dark(ScrArea *sa, char dir, uint pos) { GPU_blend_set_func_separate( GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); @@ -306,7 +306,7 @@ static void scrarea_draw_shape_dark(ScrArea *sa, char dir, unsigned int pos) /** * Draw screen area lighter with arrow shape ("eraser" of previous dark shape). */ -static void scrarea_draw_shape_light(ScrArea *sa, char UNUSED(dir), unsigned int pos) +static void scrarea_draw_shape_light(ScrArea *sa, char UNUSED(dir), uint pos) { GPU_blend_set_func(GPU_DST_COLOR, GPU_SRC_ALPHA); /* value 181 was hardly computed: 181~105 */ @@ -608,7 +608,7 @@ static void screen_preview_draw(const bScreen *screen, int size_x, int size_y) /** * Render the preview for a screen layout in \a screen. */ -void ED_screen_preview_render(const bScreen *screen, int size_x, int size_y, unsigned int *r_rect) +void ED_screen_preview_render(const bScreen *screen, int size_x, int size_y, uint *r_rect) { char err_out[256] = "unknown"; GPUOffScreen *offscreen = GPU_offscreen_create(size_x, size_y, 0, true, false, err_out); diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index d52dc262c3f..89b83b3518a 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -54,7 +54,7 @@ #include "screen_intern.h" typedef struct ScreenshotData { - unsigned int *dumprect; + uint *dumprect; int dumpsx, dumpsy; rcti crop; diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index c035863203b..04ca5770a97 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -876,12 +876,8 @@ static bool paint_draw_alpha_overlay(UnifiedPaintSettings *ups, return alpha_overlay_active; } -BLI_INLINE void draw_tri_point(unsigned int pos, - const float sel_col[4], - float pivot_col[4], - float *co, - float width, - bool selected) +BLI_INLINE void draw_tri_point( + uint pos, const float sel_col[4], float pivot_col[4], float *co, float width, bool selected) { immUniformColor4fv(selected ? sel_col : pivot_col); @@ -910,12 +906,8 @@ BLI_INLINE void draw_tri_point(unsigned int pos, immEnd(); } -BLI_INLINE void draw_rect_point(unsigned int pos, - const float sel_col[4], - float handle_col[4], - float *co, - float width, - bool selected) +BLI_INLINE void draw_rect_point( + uint pos, const float sel_col[4], float handle_col[4], float *co, float width, bool selected) { immUniformColor4fv(selected ? sel_col : handle_col); @@ -935,7 +927,7 @@ BLI_INLINE void draw_rect_point(unsigned int pos, imm_draw_box_wire_2d(pos, minx, miny, maxx, maxy); } -BLI_INLINE void draw_bezier_handle_lines(unsigned int pos, float sel_col[4], BezTriple *bez) +BLI_INLINE void draw_bezier_handle_lines(uint pos, float sel_col[4], BezTriple *bez) { immUniformColor4f(0.0f, 0.0f, 0.0f, 0.5f); GPU_line_width(3.0f); diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c index 73c099c9407..3485941d3df 100644 --- a/source/blender/editors/sculpt_paint/paint_image_2d.c +++ b/source/blender/editors/sculpt_paint/paint_image_2d.c @@ -80,11 +80,11 @@ typedef struct BrushPainterCache { ImBuf *ibuf; ImBuf *texibuf; - unsigned short *curve_mask; - unsigned short *tex_mask; - unsigned short *tex_mask_old; - unsigned int tex_mask_old_w; - unsigned int tex_mask_old_h; + ushort *curve_mask; + ushort *tex_mask; + ushort *tex_mask_old; + uint tex_mask_old_w; + uint tex_mask_old_h; int image_size[2]; } BrushPainterCache; @@ -228,7 +228,7 @@ static void brush_imbuf_tex_co(rctf *mapping, int x, int y, float texco[3]) } /* create a mask with the mask texture */ -static unsigned short *brush_painter_mask_ibuf_new(BrushPainter *painter, const int size) +static ushort *brush_painter_mask_ibuf_new(BrushPainter *painter, const int size) { Scene *scene = painter->scene; Brush *brush = painter->brush; @@ -236,10 +236,10 @@ static unsigned short *brush_painter_mask_ibuf_new(BrushPainter *painter, const struct ImagePool *pool = painter->pool; float texco[3]; - unsigned short *mask, *m; + ushort *mask, *m; int x, y, thread = 0; - mask = MEM_mallocN(sizeof(unsigned short) * size * size, "brush_painter_mask"); + mask = MEM_mallocN(sizeof(ushort) * size * size, "brush_painter_mask"); m = mask; for (y = 0; y < size; y++) { @@ -247,7 +247,7 @@ static unsigned short *brush_painter_mask_ibuf_new(BrushPainter *painter, const float res; brush_imbuf_tex_co(&mask_mapping, x, y, texco); res = BKE_brush_sample_masktex(scene, brush, texco, thread, pool); - *m = (unsigned short)(65535.0f * res); + *m = (ushort)(65535.0f * res); } } @@ -257,7 +257,7 @@ static unsigned short *brush_painter_mask_ibuf_new(BrushPainter *painter, const /* update rectangular section of the brush image */ static void brush_painter_mask_imbuf_update(BrushPainter *painter, ImagePaintTile *tile, - unsigned short *tex_mask_old, + ushort *tex_mask_old, int origx, int origy, int w, @@ -271,14 +271,14 @@ static void brush_painter_mask_imbuf_update(BrushPainter *painter, BrushPainterCache *cache = &tile->cache; rctf tex_mapping = painter->mask_mapping; struct ImagePool *pool = painter->pool; - unsigned short res; + ushort res; bool use_texture_old = (tex_mask_old != NULL); int x, y, thread = 0; - unsigned short *tex_mask = cache->tex_mask; - unsigned short *tex_mask_cur = cache->tex_mask_old; + ushort *tex_mask = cache->tex_mask; + ushort *tex_mask_cur = cache->tex_mask_old; /* fill pixels */ for (y = origy; y < h; y++) { @@ -287,13 +287,12 @@ static void brush_painter_mask_imbuf_update(BrushPainter *painter, float texco[3]; /* handle byte pixel */ - unsigned short *b = tex_mask + (y * diameter + x); - unsigned short *t = tex_mask_cur + (y * diameter + x); + ushort *b = tex_mask + (y * diameter + x); + ushort *t = tex_mask_cur + (y * diameter + x); if (!use_texture_old) { brush_imbuf_tex_co(&tex_mapping, x, y, texco); - res = (unsigned short)(65535.0f * - BKE_brush_sample_masktex(scene, brush, texco, thread, pool)); + res = (ushort)(65535.0f * BKE_brush_sample_masktex(scene, brush, texco, thread, pool)); } /* read from old texture buffer */ @@ -320,19 +319,17 @@ static void brush_painter_mask_imbuf_partial_update(BrushPainter *painter, const int diameter) { BrushPainterCache *cache = &tile->cache; - unsigned short *tex_mask_old; + ushort *tex_mask_old; int destx, desty, srcx, srcy, w, h, x1, y1, x2, y2; /* create brush image buffer if it didn't exist yet */ if (!cache->tex_mask) { - cache->tex_mask = MEM_mallocN(sizeof(unsigned short) * diameter * diameter, - "brush_painter_mask"); + cache->tex_mask = MEM_mallocN(sizeof(ushort) * diameter * diameter, "brush_painter_mask"); } /* create new texture image buffer with coordinates relative to old */ tex_mask_old = cache->tex_mask_old; - cache->tex_mask_old = MEM_mallocN(sizeof(unsigned short) * diameter * diameter, - "brush_painter_mask"); + cache->tex_mask_old = MEM_mallocN(sizeof(ushort) * diameter * diameter, "brush_painter_mask"); if (tex_mask_old) { ImBuf maskibuf; @@ -393,18 +390,18 @@ static void brush_painter_mask_imbuf_partial_update(BrushPainter *painter, } /* create a mask with the falloff strength */ -static unsigned short *brush_painter_curve_mask_new(BrushPainter *painter, - int diameter, - float radius, - const float pos[2]) +static ushort *brush_painter_curve_mask_new(BrushPainter *painter, + int diameter, + float radius, + const float pos[2]) { Brush *brush = painter->brush; int offset = (int)floorf(diameter / 2.0f); - unsigned short *mask, *m; + ushort *mask, *m; - mask = MEM_mallocN(sizeof(unsigned short) * diameter * diameter, "brush_painter_mask"); + mask = MEM_mallocN(sizeof(ushort) * diameter * diameter, "brush_painter_mask"); m = mask; int aa_samples = 1.0f / (radius * 0.20f); @@ -458,7 +455,7 @@ static unsigned short *brush_painter_curve_mask_new(BrushPainter *painter, total_samples += curve * hardness_factor; } } - *m = (unsigned short)(total_samples * norm_factor); + *m = (ushort)(total_samples * norm_factor); } } @@ -528,7 +525,7 @@ static ImBuf *brush_painter_imbuf_new( } else { /* write to byte pixel */ - unsigned char *dst = (unsigned char *)ibuf->rect + (y * size + x) * 4; + uchar *dst = (uchar *)ibuf->rect + (y * size + x) * 4; rgb_float_to_uchar(dst, rgba); dst[3] = unit_float_to_uchar_clamp(rgba[3]); @@ -624,16 +621,16 @@ static void brush_painter_imbuf_update(BrushPainter *painter, bf[3] = rgba[3]; } else { - unsigned char crgba[4]; + uchar crgba[4]; /* handle byte pixel */ - unsigned char *b = (unsigned char *)ibuf->rect + (y * ibuf->x + x) * 4; - unsigned char *t = (unsigned char *)texibuf->rect + (y * texibuf->x + x) * 4; + uchar *b = (uchar *)ibuf->rect + (y * ibuf->x + x) * 4; + uchar *t = (uchar *)texibuf->rect + (y * texibuf->x + x) * 4; /* read from old texture buffer */ if (use_texture_old) { - unsigned char *ot = (unsigned char *)oldtexibuf->rect + - ((y - origy + yt) * oldtexibuf->x + (x - origx + xt)) * 4; + uchar *ot = (uchar *)oldtexibuf->rect + + ((y - origy + yt) * oldtexibuf->x + (x - origx + xt)) * 4; crgba[0] = ot[0]; crgba[1] = ot[1]; crgba[2] = ot[2]; @@ -975,7 +972,7 @@ static void paint_2d_ibuf_rgb_get(ImBuf *ibuf, int x, int y, float r_rgb[4]) copy_v4_v4(r_rgb, rrgbf); } else { - unsigned char *rrgb = (unsigned char *)ibuf->rect + (ibuf->x * y + x) * 4; + uchar *rrgb = (uchar *)ibuf->rect + (ibuf->x * y + x) * 4; straight_uchar_to_premul_float(r_rgb, rrgb); } } @@ -1001,8 +998,8 @@ static void paint_2d_ibuf_rgb_set( rrgbf[3] = rgb[3]; } else { - unsigned char straight[4]; - unsigned char *rrgb = (unsigned char *)ibuf->rect + (ibuf->x * y + x) * 4; + uchar straight[4]; + uchar *rrgb = (uchar *)ibuf->rect + (ibuf->x * y + x) * 4; premul_float_to_straight_uchar(straight, rgb); rrgb[0] = straight[0]; @@ -1329,7 +1326,7 @@ static void paint_2d_do_making_brush(ImagePaintState *s, for (int ty = tiley; ty <= tileh; ty++) { for (int tx = tilex; tx <= tilew; tx++) { /* retrieve original pixels + mask from undo buffer */ - unsigned short *mask; + ushort *mask; int origx = region->destx - tx * ED_IMAGE_UNDO_TILE_SIZE; int origy = region->desty - ty * ED_IMAGE_UNDO_TILE_SIZE; @@ -1829,7 +1826,7 @@ static void paint_2d_fill_add_pixel_byte(const int x_px, if (!BLI_BITMAP_TEST(touched, coordinate)) { float color_f[4]; - unsigned char *color_b = (unsigned char *)(ibuf->rect + coordinate); + uchar *color_b = (uchar *)(ibuf->rect + coordinate); rgba_uchar_to_float(color_f, color_b); straight_to_premul_v4(color_f); @@ -1895,7 +1892,7 @@ void paint_2d_bucket_fill(const bContext *C, ImBuf *ibuf; int x_px, y_px; - unsigned int color_b; + uint color_b; float color_f[4]; float strength = br ? BKE_brush_alpha_get(s->scene, br) : 1.0f; @@ -1935,7 +1932,7 @@ void paint_2d_bucket_fill(const bContext *C, * be in gamma space. strictly speaking this is not correct, but blender does not paint * byte images in linear space */ if (!do_float) { - linearrgb_to_srgb_uchar3((unsigned char *)&color_b, color); + linearrgb_to_srgb_uchar3((uchar *)&color_b, color); *(((char *)&color_b) + 3) = strength * 255; } else { @@ -1959,9 +1956,9 @@ void paint_2d_bucket_fill(const bContext *C, else { for (x_px = 0; x_px < ibuf->x; x_px++) { for (y_px = 0; y_px < ibuf->y; y_px++) { - blend_color_mix_byte((unsigned char *)(ibuf->rect + ((size_t)y_px) * ibuf->x + x_px), - (unsigned char *)(ibuf->rect + ((size_t)y_px) * ibuf->x + x_px), - (unsigned char *)&color_b); + blend_color_mix_byte((uchar *)(ibuf->rect + ((size_t)y_px) * ibuf->x + x_px), + (uchar *)(ibuf->rect + ((size_t)y_px) * ibuf->x + x_px), + (uchar *)&color_b); } } } @@ -2000,7 +1997,7 @@ void paint_2d_bucket_fill(const bContext *C, } else { int pixel_color_b = *(ibuf->rect + coordinate); - rgba_uchar_to_float(pixel_color, (unsigned char *)&pixel_color_b); + rgba_uchar_to_float(pixel_color, (uchar *)&pixel_color_b); straight_to_premul_v4(pixel_color); } @@ -2055,9 +2052,9 @@ void paint_2d_bucket_fill(const bContext *C, while (!BLI_stack_is_empty(stack)) { BLI_stack_pop(stack, &coordinate); - IMB_blend_color_byte((unsigned char *)(ibuf->rect + coordinate), - (unsigned char *)(ibuf->rect + coordinate), - (unsigned char *)&color_b, + IMB_blend_color_byte((uchar *)(ibuf->rect + coordinate), + (uchar *)(ibuf->rect + coordinate), + (uchar *)&color_b, br->blend); /* reconstruct the coordinates here */ @@ -2117,7 +2114,7 @@ void paint_2d_gradient_fill( ImBuf *ibuf; int x_px, y_px; - unsigned int color_b; + uint color_b; float color_f[4]; float image_init[2], image_final[2]; float tangent[2]; @@ -2212,11 +2209,11 @@ void paint_2d_gradient_fill( BKE_colorband_evaluate(br->gradient, f, color_f); linearrgb_to_srgb_v3_v3(color_f, color_f); - rgba_float_to_uchar((unsigned char *)&color_b, color_f); - ((unsigned char *)&color_b)[3] *= brush_alpha; - IMB_blend_color_byte((unsigned char *)(ibuf->rect + ((size_t)y_px) * ibuf->x + x_px), - (unsigned char *)(ibuf->rect + ((size_t)y_px) * ibuf->x + x_px), - (unsigned char *)&color_b, + rgba_float_to_uchar((uchar *)&color_b, color_f); + ((uchar *)&color_b)[3] *= brush_alpha; + IMB_blend_color_byte((uchar *)(ibuf->rect + ((size_t)y_px) * ibuf->x + x_px), + (uchar *)(ibuf->rect + ((size_t)y_px) * ibuf->x + x_px), + (uchar *)&color_b, br->blend); } } diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index c56ce8fd183..6494e53e182 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -112,7 +112,7 @@ static void partial_redraw_array_init(ImagePaintPartialRedraw *pr); /* Defines and Structs */ /* unit_float_to_uchar_clamp as inline function */ -BLI_INLINE unsigned char f_to_char(const float val) +BLI_INLINE uchar f_to_char(const float val) { return unit_float_to_uchar_clamp(val); } @@ -206,7 +206,7 @@ typedef struct ProjPaintImage { volatile void **undoRect; /** The mask accumulation must happen on canvas, not on space screen bucket. * Here we store the mask rectangle. */ - unsigned short **maskRect; + ushort **maskRect; /** Store flag to enforce validation of undo rectangle. */ bool **valid; bool touch; @@ -279,7 +279,7 @@ typedef struct ProjPaintState { /** bucketRect aligned array linkList of faces overlapping each bucket. */ LinkNode **bucketFaces; /** store if the bucks have been initialized. */ - unsigned char *bucketFlags; + uchar *bucketFlags; /** store options per vert, now only store if the vert is pointing away from the view. */ char *vertFlags; @@ -443,13 +443,13 @@ typedef union pixelPointer { /** float buffer. */ float *f_pt; /** 2 ways to access a char buffer. */ - unsigned int *uint_pt; - unsigned char *ch_pt; + uint *uint_pt; + uchar *ch_pt; } PixelPointer; typedef union pixelStore { - unsigned char ch[4]; - unsigned int uint; + uchar ch[4]; + uint uint; float f[4]; } PixelStore; @@ -461,17 +461,17 @@ typedef struct ProjPixel { short x_px, y_px; /** if anyone wants to paint onto more than 65535 images they can bite me. */ - unsigned short image_index; - unsigned char bb_cell_index; + ushort image_index; + uchar bb_cell_index; /* for various reasons we may want to mask out painting onto this pixel */ - unsigned short mask; + ushort mask; /* Only used when the airbrush is disabled. * Store the max mask value to avoid painting over an area with a lower opacity * with an advantage that we can avoid touching the pixel at all, if the * new mask value is lower then mask_accum */ - unsigned short *mask_accum; + ushort *mask_accum; /* horrible hack, store tile valid flag pointer here to re-validate tiles * used for anchored and drag-dot strokes */ @@ -491,7 +491,7 @@ typedef struct ProjPixelClone { typedef struct { SpinLock *lock; bool masked; - unsigned short tile_width; + ushort tile_width; ImBuf **tmpibuf; ProjPaintImage *pjima; } TileInfo; @@ -717,11 +717,8 @@ static void uvco_to_wrapped_pxco(const float uv[2], int ibuf_x, int ibuf_y, floa /* Set the top-most face color that the screen space coord 'pt' touches * (or return 0 if none touch) */ -static bool project_paint_PickColor(const ProjPaintState *ps, - const float pt[2], - float *rgba_fp, - unsigned char *rgba, - const bool interp) +static bool project_paint_PickColor( + const ProjPaintState *ps, const float pt[2], float *rgba_fp, uchar *rgba, const bool interp) { const MLoopTri *lt; const float *lt_tri_uv[3]; @@ -774,7 +771,7 @@ static bool project_paint_PickColor(const ProjPaintState *ps, bilinear_interpolation_color_wrap(ibuf, rgba, NULL, x, y); } else { - unsigned char rgba_tmp[4]; + uchar rgba_tmp[4]; bilinear_interpolation_color_wrap(ibuf, rgba_tmp, NULL, x, y); straight_uchar_to_premul_float(rgba_fp, rgba_tmp); } @@ -795,8 +792,7 @@ static bool project_paint_PickColor(const ProjPaintState *ps, premul_float_to_straight_uchar(rgba, rgba_tmp_fp); } else { - *((unsigned int *)rgba) = *(unsigned int *)(((char *)ibuf->rect) + - ((xi + yi * ibuf->x) * 4)); + *((uint *)rgba) = *(uint *)(((char *)ibuf->rect) + ((xi + yi * ibuf->x) * 4)); } } @@ -805,7 +801,7 @@ static bool project_paint_PickColor(const ProjPaintState *ps, copy_v4_v4(rgba_fp, (ibuf->rect_float + ((xi + yi * ibuf->x) * 4))); } else { - unsigned char *tmp_ch = ((unsigned char *)ibuf->rect) + ((xi + yi * ibuf->x) * 4); + uchar *tmp_ch = ((uchar *)ibuf->rect) + ((xi + yi * ibuf->x) * 4); straight_uchar_to_premul_float(rgba_fp, tmp_ch); } } @@ -1150,8 +1146,8 @@ static bool check_seam(const ProjPaintState *ps, const MLoopTri *orig_lt = &ps->mlooptri_eval[orig_face]; const float *orig_lt_tri_uv[3] = {PS_LOOPTRI_AS_UV_3(ps->poly_to_loop_uv, orig_lt)}; /* vert indices from face vert order indices */ - const unsigned int i1 = ps->mloop_eval[orig_lt->tri[orig_i1_fidx]].v; - const unsigned int i2 = ps->mloop_eval[orig_lt->tri[orig_i2_fidx]].v; + const uint i1 = ps->mloop_eval[orig_lt->tri[orig_i1_fidx]].v; + const uint i2 = ps->mloop_eval[orig_lt->tri[orig_i2_fidx]].v; LinkNode *node; /* index in face */ int i1_fidx = -1, i2_fidx = -1; @@ -1641,7 +1637,7 @@ static float screen_px_line_point_factor_v2_persp(const ProjPaintState *ps, static void project_face_pixel(const float *lt_tri_uv[3], ImBuf *ibuf_other, const float w[3], - unsigned char rgba_ub[4], + uchar rgba_ub[4], float rgba_f[4]) { float uv_other[2], x, y; @@ -1677,7 +1673,7 @@ static float project_paint_uvpixel_mask(const ProjPaintState *ps, const float *lt_other_tri_uv[3] = {PS_LOOPTRI_AS_UV_3(ps->poly_to_loop_uv, lt_other)}; /* BKE_image_acquire_ibuf - TODO - this may be slow */ - unsigned char rgba_ub[4]; + uchar rgba_ub[4]; float rgba_f[4]; project_face_pixel(lt_other_tri_uv, ibuf_other, w, rgba_ub, rgba_f); @@ -1937,8 +1933,8 @@ static ProjPixel *project_paint_uvpixel_init(const ProjPaintState *ps, zero_v4(projPixel->newColor.f); } else { - projPixel->pixel.ch_pt = (unsigned char *)(ibuf->rect + (x_px + y_px * ibuf->x)); - projPixel->origColor.uint_pt = (unsigned int *)projima->undoRect[tile_index] + tile_offset; + projPixel->pixel.ch_pt = (uchar *)(ibuf->rect + (x_px + y_px * ibuf->x)); + projPixel->origColor.uint_pt = (uint *)projima->undoRect[tile_index] + tile_offset; projPixel->newColor.uint = 0; } @@ -1952,7 +1948,7 @@ static ProjPixel *project_paint_uvpixel_init(const ProjPaintState *ps, projPixel->x_px = x_px; projPixel->y_px = y_px; - projPixel->mask = (unsigned short)(mask * 65535); + projPixel->mask = (ushort)(mask * 65535); if (ps->do_masking) { projPixel->mask_accum = projima->maskRect[tile_index] + tile_offset; } @@ -1984,7 +1980,7 @@ static ProjPixel *project_paint_uvpixel_init(const ProjPaintState *ps, lt_other_tri_uv, ibuf_other, w, NULL, ((ProjPixelClone *)projPixel)->clonepx.f); } else { /* from char to float */ - unsigned char rgba_ub[4]; + uchar rgba_ub[4]; float rgba[4]; project_face_pixel(lt_other_tri_uv, ibuf_other, w, rgba_ub, NULL); if (ps->use_colormanagement) { @@ -4844,15 +4840,15 @@ typedef struct ProjectHandle { static void do_projectpaint_clone(ProjPaintState *ps, ProjPixel *projPixel, float mask) { - const unsigned char *clone_pt = ((ProjPixelClone *)projPixel)->clonepx.ch; + const uchar *clone_pt = ((ProjPixelClone *)projPixel)->clonepx.ch; if (clone_pt[3]) { - unsigned char clone_rgba[4]; + uchar clone_rgba[4]; clone_rgba[0] = clone_pt[0]; clone_rgba[1] = clone_pt[1]; clone_rgba[2] = clone_pt[2]; - clone_rgba[3] = (unsigned char)(clone_pt[3] * mask); + clone_rgba[3] = (uchar)(clone_pt[3] * mask); if (ps->do_masking) { IMB_blend_color_byte( @@ -4895,7 +4891,7 @@ static void do_projectpaint_smear(ProjPaintState *ps, LinkNode **smearPixels, const float co[2]) { - unsigned char rgba_ub[4]; + uchar rgba_ub[4]; if (project_paint_PickColor(ps, co, NULL, rgba_ub, 1) == 0) { return; @@ -5016,7 +5012,7 @@ static void do_projectpaint_soften(ProjPaintState *ps, } if (LIKELY(accum_tot != 0)) { - unsigned char *rgba_ub = projPixel->newColor.ch; + uchar *rgba_ub = projPixel->newColor.ch; mul_v4_fl(rgba, 1.0f / (float)accum_tot); @@ -5061,7 +5057,7 @@ static void do_projectpaint_draw(ProjPaintState *ps, float v) { float rgb[3]; - unsigned char rgba_ub[4]; + uchar rgba_ub[4]; if (ps->is_texbrush) { mul_v3_v3v3(rgb, texrgb, ps->paint_color_linear); @@ -5119,7 +5115,7 @@ static void do_projectpaint_draw_f(ProjPaintState *ps, static void do_projectpaint_mask(ProjPaintState *ps, ProjPixel *projPixel, float mask) { - unsigned char rgba_ub[4]; + uchar rgba_ub[4]; rgba_ub[0] = rgba_ub[1] = rgba_ub[2] = ps->stencil_value * 255.0f; rgba_ub[3] = f_to_char(mask); @@ -5204,7 +5200,7 @@ static void do_projectpaint_thread(TaskPool *__restrict UNUSED(pool), /* for smear only */ float pos_ofs[2] = {0}; float co[2]; - unsigned short mask_short; + ushort mask_short; const float brush_alpha = BKE_brush_alpha_get(ps->scene, brush); const float brush_radius = ps->brush_size; /* avoid a square root with every dist comparison */ @@ -5468,7 +5464,7 @@ static void do_projectpaint_thread(TaskPool *__restrict UNUSED(pool), } mask = min_ff(mask, 65535.0f); - mask_short = (unsigned short)mask; + mask_short = (ushort)mask; if (mask_short > *projPixel->mask_accum) { *projPixel->mask_accum = mask_short; diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index e67d43d4571..60b4a2f8e0c 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -294,12 +294,8 @@ static void imapaint_tri_weights(float matrix[4][4], } /* compute uv coordinates of mouse in face */ -static void imapaint_pick_uv(Mesh *me_eval, - Scene *scene, - Object *ob_eval, - unsigned int faceindex, - const int xy[2], - float uv[2]) +static void imapaint_pick_uv( + Mesh *me_eval, Scene *scene, Object *ob_eval, uint faceindex, const int xy[2], float uv[2]) { int i, findex; float p[2], w[3], absw, minabsw; @@ -376,10 +372,7 @@ static void imapaint_pick_uv(Mesh *me_eval, } /* returns 0 if not found, otherwise 1 */ -static int imapaint_pick_face(ViewContext *vc, - const int mval[2], - unsigned int *r_index, - unsigned int totpoly) +static int imapaint_pick_face(ViewContext *vc, const int mval[2], uint *r_index, uint totpoly) { if (totpoly == 0) { return 0; @@ -389,7 +382,7 @@ static int imapaint_pick_face(ViewContext *vc, ED_view3d_select_id_validate(vc); *r_index = DRW_select_buffer_sample_point(vc->depsgraph, vc->region, vc->v3d, mval); - if ((*r_index) == 0 || (*r_index) > (unsigned int)totpoly) { + if ((*r_index) == 0 || (*r_index) > (uint)totpoly) { return 0; } @@ -464,8 +457,8 @@ void paint_sample_color( Palette *palette = BKE_paint_palette(paint); PaletteColor *color = NULL; Brush *br = BKE_paint_brush(BKE_paint_get_active_from_context(C)); - unsigned int col; - const unsigned char *cp; + uint col; + const uchar *cp; CLAMP(x, 0, region->winx); CLAMP(y, 0, region->winy); @@ -497,8 +490,8 @@ void paint_sample_color( ViewContext vc; const int mval[2] = {x, y}; - unsigned int faceindex; - unsigned int totpoly = me->totpoly; + uint faceindex; + uint totpoly = me->totpoly; if (CustomData_has_layer(&me_eval->ldata, CD_MLOOPUV)) { ED_view3d_viewcontext_init(C, &vc, depsgraph); @@ -563,7 +556,7 @@ void paint_sample_color( } } else { - unsigned char rgba[4]; + uchar rgba[4]; bilinear_interpolation_color_wrap(ibuf, rgba, NULL, u, v); if (use_palette) { rgb_uchar_to_float(color->rgb, rgba); @@ -598,7 +591,7 @@ void paint_sample_color( x + region->winrct.xmin, y + region->winrct.ymin, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &col); glReadBuffer(GL_BACK); } - cp = (unsigned char *)&col; + cp = (uchar *)&col; if (use_palette) { rgb_uchar_to_float(color->rgb, cp); diff --git a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c index 6e706c907dd..addf7e9f868 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c +++ b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c @@ -109,7 +109,7 @@ static int vertex_color_set_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); Object *obact = CTX_data_active_object(C); - unsigned int paintcol = vpaint_get_current_col(scene, scene->toolsettings->vpaint, false); + uint paintcol = vpaint_get_current_col(scene, scene->toolsettings->vpaint, false); if (vertex_color_set(obact, paintcol)) { WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, obact); diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c index f364c174f0f..0a5814be626 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.c +++ b/source/blender/editors/sculpt_paint/sculpt_uv.c @@ -70,8 +70,8 @@ typedef struct UvAdjacencyElement { } UvAdjacencyElement; typedef struct UvEdge { - 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) */ char flag; @@ -315,7 +315,7 @@ static void uv_sculpt_stroke_apply(bContext *C, Scene *scene = CTX_data_scene(C); ARegion *region = CTX_wm_region(C); BMEditMesh *em = BKE_editmesh_from_object(obedit); - unsigned int tool; + uint tool; UvSculptData *sculptdata = (UvSculptData *)op->customdata; SpaceImage *sima; int invert; @@ -386,7 +386,7 @@ static void uv_sculpt_stroke_apply(bContext *C, * Smooth Tool */ else if (tool == UV_SCULPT_TOOL_RELAX) { - unsigned int method = toolsettings->uv_relax_method; + uint method = toolsettings->uv_relax_method; if (method == UV_SCULPT_TOOL_RELAX_HC) { HC_relaxation_iteration_uv(em, sculptdata, co, alpha, radius, aspectRatio); } @@ -464,7 +464,7 @@ static int uv_element_offset_from_face_get( return element - map->buf; } -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)); diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 75eeb125609..7abbd2966a3 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -141,9 +141,9 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region bDopeSheet *ads = &saction->ads; AnimData *adt = NULL; - unsigned char col1[4], col2[4]; - unsigned char col1a[4], col2a[4]; - unsigned char col1b[4], col2b[4]; + uchar col1[4], col2[4]; + uchar col1a[4], col2a[4]; + uchar col1b[4], col2b[4]; const bool show_group_colors = !(saction->flag & SACTION_NODRAWGCOLORS); @@ -212,10 +212,10 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region bActionGroup *agrp = ale->data; if (show_group_colors && agrp->customCol) { if (sel) { - immUniformColor3ubvAlpha((unsigned char *)agrp->cs.select, col1a[3]); + immUniformColor3ubvAlpha((uchar *)agrp->cs.select, col1a[3]); } else { - immUniformColor3ubvAlpha((unsigned char *)agrp->cs.solid, col2a[3]); + immUniformColor3ubvAlpha((uchar *)agrp->cs.solid, col2a[3]); } } else { @@ -226,8 +226,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region case ANIMTYPE_FCURVE: { FCurve *fcu = ale->data; if (show_group_colors && fcu->grp && fcu->grp->customCol) { - immUniformColor3ubvAlpha((unsigned char *)fcu->grp->cs.active, - sel ? col1[3] : col2[3]); + immUniformColor3ubvAlpha((uchar *)fcu->grp->cs.active, sel ? col1[3] : col2[3]); } else { immUniformColor4ubv(sel ? col1 : col2); @@ -243,8 +242,8 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region immRectf(pos, v2d->cur.xmin, ymin, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymax); } else if (ac->datatype == ANIMCONT_GPENCIL) { - unsigned char *color; - unsigned char gpl_col[4]; + uchar *color; + uchar gpl_col[4]; if ((show_group_colors) && (ale->type == ANIMTYPE_GPLAYER)) { bGPDlayer *gpl = (bGPDlayer *)ale->data; rgb_float_to_uchar(gpl_col, gpl->color); @@ -266,7 +265,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region else if (ac->datatype == ANIMCONT_MASK) { /* TODO --- this is a copy of gpencil */ /* frames less than one get less saturated background */ - unsigned char *color = sel ? col1 : col2; + uchar *color = sel ? col1 : col2; immUniformColor4ubv(color); immRectf(pos, 0.0f, ymin, v2d->cur.xmin, ymax); diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.c b/source/blender/editors/space_clip/clip_dopesheet_draw.c index eba0f33d6cc..aef6781ec47 100644 --- a/source/blender/editors/space_clip/clip_dopesheet_draw.c +++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c @@ -68,7 +68,7 @@ static void track_channel_color(MovieTrackingTrack *track, float default_color[3 } static void draw_keyframe_shape( - float x, float y, bool sel, float alpha, unsigned int pos_id, unsigned int color_id) + float x, float y, bool sel, float alpha, uint pos_id, uint color_id) { float color[4] = {0.91f, 0.91f, 0.91f, alpha}; if (sel) { @@ -79,7 +79,7 @@ static void draw_keyframe_shape( immVertex2f(pos_id, x, y); } -static void clip_draw_dopesheet_background(ARegion *region, MovieClip *clip, unsigned int pos_id) +static void clip_draw_dopesheet_background(ARegion *region, MovieClip *clip, uint pos_id) { View2D *v2d = ®ion->v2d; MovieTracking *tracking = &clip->tracking; diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 2a6cf4d5a55..a1652ca0e88 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -66,8 +66,7 @@ /*********************** main area drawing *************************/ -static void draw_keyframe( - int frame, int cfra, int sfra, float framelen, int width, unsigned int pos) +static void draw_keyframe(int frame, int cfra, int sfra, float framelen, int width, uint pos) { int height = (frame == cfra) ? 22 : 10; int x = (frame - sfra) * framelen; @@ -592,7 +591,7 @@ static void draw_marker_outline(SpaceClip *sc, const float marker_pos[2], int width, int height, - unsigned int position) + uint position) { int tiny = sc->flag & SC_SHOW_TINY_MARKER; bool show_search = false; @@ -895,7 +894,7 @@ static float get_shortest_pattern_side(MovieTrackingMarker *marker) } static void draw_marker_slide_square( - float x, float y, float dx, float dy, int outline, const float px[2], unsigned int pos) + float x, float y, float dx, float dy, int outline, const float px[2], uint pos) { float tdx, tdy; @@ -911,7 +910,7 @@ static void draw_marker_slide_square( } static void draw_marker_slide_triangle( - float x, float y, float dx, float dy, int outline, const float px[2], unsigned int pos) + float x, float y, float dx, float dy, int outline, const float px[2], uint pos) { float tdx, tdy; @@ -939,7 +938,7 @@ static void draw_marker_slide_zones(SpaceClip *sc, int act, int width, int height, - unsigned int pos) + uint pos) { float dx, dy, patdx, patdy, searchdx, searchdy; int tiny = sc->flag & SC_SHOW_TINY_MARKER; @@ -1056,7 +1055,7 @@ static void draw_marker_texts(SpaceClip *sc, UI_FontThemeColor(fontid, TH_ACT_MARKER); } else { - unsigned char color[4]; + uchar color[4]; UI_GetThemeColorShade4ubv(TH_DIS_MARKER, 128, color); BLF_color4ubv(fontid, color); } @@ -1191,7 +1190,7 @@ static void draw_plane_marker_image(Scene *scene, ibuf = BKE_image_acquire_ibuf(image, NULL, &lock); if (ibuf) { - unsigned char *display_buffer; + uchar *display_buffer; void *cache_handle; if (image->flag & IMA_VIEW_AS_RENDER) { diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index 6336f1bff3a..62d4a6ae4f0 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -282,7 +282,7 @@ bool ED_space_clip_color_sample(SpaceClip *sc, ARegion *region, int mval[2], flo if (fx >= 0.0f && fy >= 0.0f && fx < 1.0f && fy < 1.0f) { const float *fp; - unsigned char *cp; + uchar *cp; int x = (int)(fx * ibuf->x), y = (int)(fy * ibuf->y); CLAMP(x, 0, ibuf->x - 1); @@ -294,7 +294,7 @@ bool ED_space_clip_color_sample(SpaceClip *sc, ARegion *region, int mval[2], flo ret = true; } else if (ibuf->rect) { - cp = (unsigned char *)(ibuf->rect + y * ibuf->x + x); + cp = (uchar *)(ibuf->rect + y * ibuf->x + x); rgb_uchar_to_float(r_col, cp); IMB_colormanagement_colorspace_to_scene_linear_v3(r_col, ibuf->rect_colorspace); ret = true; @@ -744,7 +744,7 @@ static bool check_prefetch_break(void) } /* read file for specified frame number to the memory */ -static unsigned char *prefetch_read_file_to_memory( +static uchar *prefetch_read_file_to_memory( MovieClip *clip, int current_frame, short render_size, short render_flag, size_t *r_size) { MovieClipUser user = {0}; @@ -766,7 +766,7 @@ static unsigned char *prefetch_read_file_to_memory( return NULL; } - unsigned char *mem = MEM_mallocN(size, "movieclip prefetch memory file"); + uchar *mem = MEM_mallocN(size, "movieclip prefetch memory file"); if (mem == NULL) { close(file); return NULL; @@ -822,12 +822,12 @@ static int prefetch_find_uncached_frame(MovieClip *clip, } /* get memory buffer for first uncached frame within prefetch frame range */ -static unsigned char *prefetch_thread_next_frame(PrefetchQueue *queue, - MovieClip *clip, - size_t *r_size, - int *r_current_frame) +static uchar *prefetch_thread_next_frame(PrefetchQueue *queue, + MovieClip *clip, + size_t *r_size, + int *r_current_frame) { - unsigned char *mem = NULL; + uchar *mem = NULL; BLI_spin_lock(&queue->spin); if (!*queue->stop && !check_prefetch_break() && @@ -888,7 +888,7 @@ static void prefetch_task_func(TaskPool *__restrict pool, void *task_data, int U { PrefetchQueue *queue = (PrefetchQueue *)BLI_task_pool_userdata(pool); MovieClip *clip = (MovieClip *)task_data; - unsigned char *mem; + uchar *mem; size_t size; int current_frame; diff --git a/source/blender/editors/space_clip/clip_graph_draw.c b/source/blender/editors/space_clip/clip_graph_draw.c index 7f3d3f3d651..dc212741e6b 100644 --- a/source/blender/editors/space_clip/clip_graph_draw.c +++ b/source/blender/editors/space_clip/clip_graph_draw.c @@ -52,7 +52,7 @@ typedef struct TrackMotionCurveUserData { MovieTrackingTrack *act_track; bool sel; float xscale, yscale, hsize; - unsigned int pos; + uint pos; } TrackMotionCurveUserData; static void tracking_segment_point_cb(void *userdata, @@ -159,7 +159,7 @@ static void tracking_segment_knot_cb(void *userdata, } } -static void draw_tracks_motion_and_error_curves(View2D *v2d, SpaceClip *sc, unsigned int pos) +static void draw_tracks_motion_and_error_curves(View2D *v2d, SpaceClip *sc, uint pos) { MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; @@ -215,7 +215,7 @@ static void draw_tracks_motion_and_error_curves(View2D *v2d, SpaceClip *sc, unsi } } -static void draw_frame_curves(SpaceClip *sc, unsigned int pos) +static void draw_frame_curves(SpaceClip *sc, uint pos) { MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 4e5c6513695..79050fb4797 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -1313,12 +1313,12 @@ typedef struct ProxyThread { int *build_undistort_sizes, build_undistort_count; } ProxyThread; -static unsigned char *proxy_thread_next_frame(ProxyQueue *queue, - MovieClip *clip, - size_t *r_size, - int *r_cfra) +static uchar *proxy_thread_next_frame(ProxyQueue *queue, + MovieClip *clip, + size_t *r_size, + int *r_cfra) { - unsigned char *mem = NULL; + uchar *mem = NULL; BLI_spin_lock(&queue->spin); if (!*queue->stop && queue->cfra <= queue->efra) { @@ -1371,7 +1371,7 @@ static void proxy_task_func(TaskPool *__restrict pool, void *task_data, int UNUS { ProxyThread *data = (ProxyThread *)task_data; ProxyQueue *queue = (ProxyQueue *)BLI_task_pool_userdata(pool); - unsigned char *mem; + uchar *mem; size_t size; int cfra; diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 5f5aced292d..226e7ae6b22 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -448,7 +448,7 @@ static void draw_dividers(FileLayout *layout, View2D *v2d) const int step = (layout->tile_w + 2 * layout->tile_border_x); - unsigned int vertex_len = 0; + uint vertex_len = 0; int sx = (int)v2d->tot.xmin; while (sx < v2d->cur.xmax) { sx += step; @@ -457,7 +457,7 @@ static void draw_dividers(FileLayout *layout, View2D *v2d) if (vertex_len > 0) { int v1[2], v2[2]; - unsigned char col_hi[3], col_lo[3]; + uchar col_hi[3], col_lo[3]; UI_GetThemeColorShade3ubv(TH_BACK, 30, col_hi); UI_GetThemeColorShade3ubv(TH_BACK, -30, col_lo); @@ -685,7 +685,7 @@ void file_draw_list(const bContext *C, ARegion *region) bool is_icon; eFontStyle_Align align; bool do_drag; - unsigned char text_col[4]; + uchar text_col[4]; const bool draw_columnheader = (params->display == FILE_VERTICALDISPLAY); const float thumb_icon_aspect = MIN2(64.0f / (float)(params->thumbnail_size), 1.0f); @@ -753,7 +753,7 @@ void file_draw_list(const bContext *C, ARegion *region) UI_GetThemeColor4ubv(TH_TEXT, text_col); for (i = offset; (i < numfiles) && (i < offset + numfiles_layout); i++) { - unsigned int file_selflag; + uint file_selflag; char path[FILE_MAX_LIBEXTRA]; int padx = 0.1f * UI_UNIT_X; int icon_ofs = 0; diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 5258892d55d..cb574e35422 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -103,7 +103,7 @@ static FileSelection find_file_mouse_rect(SpaceFile *sfile, return sel; } -static void file_deselect_all(SpaceFile *sfile, unsigned int flag) +static void file_deselect_all(SpaceFile *sfile, uint flag) { FileSelection sel; sel.first = 0; @@ -2494,7 +2494,7 @@ static void filenum_newname(char *name, size_t name_size, int add) char head[FILE_MAXFILE], tail[FILE_MAXFILE]; char name_temp[FILE_MAXFILE]; int pic; - unsigned short digits; + ushort digits; pic = BLI_stringdec(name, head, tail, &digits); diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 1396c0a2f69..126430986a5 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -264,7 +264,7 @@ enum { typedef struct FileListEntryPreview { char path[FILE_MAX]; - unsigned int flags; + uint flags; int index; ImBuf *img; } FileListEntryPreview; @@ -2325,16 +2325,16 @@ int filelist_empty(struct FileList *filelist) return (filelist->filelist.nbr_entries == 0); } -unsigned int filelist_entry_select_set(const FileList *filelist, - const FileDirEntry *entry, - FileSelType select, - unsigned int flag, - FileCheckType check) +uint filelist_entry_select_set(const FileList *filelist, + const FileDirEntry *entry, + FileSelType select, + uint flag, + FileCheckType check) { /* Default NULL pointer if not found is fine here! */ void **es_p = BLI_ghash_lookup_p(filelist->selection_state, entry->uuid); - unsigned int entry_flag = es_p ? POINTER_AS_UINT(*es_p) : 0; - const unsigned int org_entry_flag = entry_flag; + uint entry_flag = es_p ? POINTER_AS_UINT(*es_p) : 0; + const uint org_entry_flag = entry_flag; BLI_assert(entry); BLI_assert(ELEM(check, CHECK_DIRS, CHECK_FILES, CHECK_ALL)); @@ -2373,11 +2373,8 @@ unsigned int filelist_entry_select_set(const FileList *filelist, return entry_flag; } -void filelist_entry_select_index_set(FileList *filelist, - const int index, - FileSelType select, - unsigned int flag, - FileCheckType check) +void filelist_entry_select_index_set( + FileList *filelist, const int index, FileSelType select, uint flag, FileCheckType check) { FileDirEntry *entry = filelist_file(filelist, index); @@ -2386,11 +2383,8 @@ void filelist_entry_select_index_set(FileList *filelist, } } -void filelist_entries_select_index_range_set(FileList *filelist, - FileSelection *sel, - FileSelType select, - unsigned int flag, - FileCheckType check) +void filelist_entries_select_index_range_set( + FileList *filelist, FileSelection *sel, FileSelType select, uint flag, FileCheckType check) { /* select all valid files between first and last indicated */ if ((sel->first >= 0) && (sel->first < filelist->filelist.nbr_entries_filtered) && @@ -2402,9 +2396,7 @@ void filelist_entries_select_index_range_set(FileList *filelist, } } -unsigned int filelist_entry_select_get(FileList *filelist, - FileDirEntry *entry, - FileCheckType check) +uint filelist_entry_select_get(FileList *filelist, FileDirEntry *entry, FileCheckType check) { BLI_assert(entry); BLI_assert(ELEM(check, CHECK_DIRS, CHECK_FILES, CHECK_ALL)); @@ -2418,9 +2410,7 @@ unsigned int filelist_entry_select_get(FileList *filelist, return 0; } -unsigned int filelist_entry_select_index_get(FileList *filelist, - const int index, - FileCheckType check) +uint filelist_entry_select_index_get(FileList *filelist, const int index, FileCheckType check) { FileDirEntry *entry = filelist_file(filelist, index); @@ -2436,7 +2426,7 @@ unsigned int filelist_entry_select_index_get(FileList *filelist, */ void filelist_entry_parent_select_set(FileList *filelist, FileSelType select, - unsigned int flag, + uint flag, FileCheckType check) { if ((filelist->filter_data.flags & FLF_HIDE_PARENT) == 0) { diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 8c64fb5bb40..6096c27fc8c 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -2647,7 +2647,7 @@ static int graphkeys_euler_filter_exec(bContext *C, wmOperator *op) for (f = 0; f < 3; f++) { FCurve *fcu = euf->fcurves[f]; BezTriple *bezt, *prev; - unsigned int i; + uint i; /* skip if not enough vets to do a decent analysis of... */ if (fcu->totvert <= 2) { @@ -3569,7 +3569,7 @@ static int graph_driver_delete_invalid_exec(bContext *C, wmOperator *op) bAnimListElem *ale; int filter; bool ok = false; - unsigned int deleted = 0; + uint deleted = 0; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) { diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 7bd1b8e8291..c0b1efe0b73 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -3107,13 +3107,13 @@ typedef struct ImageSampleInfo { int width, height; int sample_size; - unsigned char col[4]; + uchar col[4]; float colf[4]; float linearcol[4]; int z; float zf; - unsigned char *colp; + uchar *colp; const float *colfp; int *zp; float *zfp; @@ -3198,7 +3198,7 @@ bool ED_space_image_color_sample(SpaceImage *sima, ARegion *region, int mval[2], if (uv[0] >= 0.0f && uv[1] >= 0.0f && uv[0] < 1.0f && uv[1] < 1.0f) { const float *fp; - unsigned char *cp; + uchar *cp; int x = (int)(uv[0] * ibuf->x), y = (int)(uv[1] * ibuf->y); CLAMP(x, 0, ibuf->x - 1); @@ -3210,7 +3210,7 @@ bool ED_space_image_color_sample(SpaceImage *sima, ARegion *region, int mval[2], ret = true; } else if (ibuf->rect) { - cp = (unsigned char *)(ibuf->rect + y * ibuf->x + x); + cp = (uchar *)(ibuf->rect + y * ibuf->x + x); rgb_uchar_to_float(r_col, cp); IMB_colormanagement_colorspace_to_scene_linear_v3(r_col, ibuf->rect_colorspace); ret = true; @@ -3230,7 +3230,7 @@ static void image_sample_pixel_color_ubyte(const ImBuf *ibuf, uchar r_col[4], float r_col_linear[4]) { - const uchar *cp = (unsigned char *)(ibuf->rect + coord[1] * ibuf->x + coord[0]); + const uchar *cp = (uchar *)(ibuf->rect + coord[1] * ibuf->x + coord[0]); copy_v4_v4_uchar(r_col, cp); rgba_uchar_to_float(r_col_linear, r_col); IMB_colormanagement_colorspace_to_scene_linear_v4(r_col_linear, false, ibuf->rect_colorspace); diff --git a/source/blender/editors/space_image/image_sequence.c b/source/blender/editors/space_image/image_sequence.c index cc6fe38866d..245495bd179 100644 --- a/source/blender/editors/space_image/image_sequence.c +++ b/source/blender/editors/space_image/image_sequence.c @@ -69,7 +69,7 @@ static void image_sequence_get_frame_ranges(wmOperator *op, ListBase *ranges) RNA_BEGIN (op->ptr, itemptr, "files") { char base_head[FILE_MAX], base_tail[FILE_MAX]; char head[FILE_MAX], tail[FILE_MAX]; - unsigned short digits; + ushort digits; char *filename = RNA_string_get_alloc(&itemptr, "name", NULL, 0); ImageFrame *frame = MEM_callocN(sizeof(ImageFrame), "image_frame"); @@ -125,7 +125,7 @@ static int image_get_udim(char *filepath, ListBase *udim_tiles) char filename[FILE_MAX], dirname[FILE_MAXDIR]; BLI_split_dirfile(filepath, dirname, filename, sizeof(dirname), sizeof(filename)); - unsigned short digits; + ushort digits; char base_head[FILE_MAX], base_tail[FILE_MAX]; int id = BLI_stringdec(filename, base_head, base_tail, &digits); diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 4ccf752a916..d3c93f6a5b6 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -313,7 +313,7 @@ static void nla_strip_get_color_inside(AnimData *adt, NlaStrip *strip, float col } /* helper call for drawing influence/time control curves for a given NLA-strip */ -static void nla_draw_strip_curves(NlaStrip *strip, float yminc, float ymaxc, unsigned int pos) +static void nla_draw_strip_curves(NlaStrip *strip, float yminc, float ymaxc, uint pos) { const float yheight = ymaxc - yminc; diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index 98fcf862290..051719fee3a 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -284,7 +284,7 @@ static bool node_select_grouped_name(SpaceNode *snode, bNode *node_act, const bo { bNode *node; bool changed = false; - const unsigned int delims[] = {'.', '-', '_', '\0'}; + const uint delims[] = {'.', '-', '_', '\0'}; size_t pref_len_act, pref_len_curr; const char *sep, *suf_act, *suf_curr; diff --git a/source/blender/editors/space_node/node_view.c b/source/blender/editors/space_node/node_view.c index 9283b073e86..5bdca04856b 100644 --- a/source/blender/editors/space_node/node_view.c +++ b/source/blender/editors/space_node/node_view.c @@ -382,7 +382,7 @@ typedef struct ImageSampleInfo { int x, y; int channels; - unsigned char col[4]; + uchar col[4]; float colf[4]; float linearcol[4]; @@ -450,7 +450,7 @@ bool ED_space_node_color_sample( if (fx >= 0.0f && fy >= 0.0f && fx < 1.0f && fy < 1.0f) { const float *fp; - unsigned char *cp; + uchar *cp; int x = (int)(fx * ibuf->x), y = (int)(fy * ibuf->y); CLAMP(x, 0, ibuf->x - 1); @@ -463,7 +463,7 @@ bool ED_space_node_color_sample( ret = true; } else if (ibuf->rect) { - cp = (unsigned char *)(ibuf->rect + y * ibuf->x + x); + cp = (uchar *)(ibuf->rect + y * ibuf->x + x); rgb_uchar_to_float(r_col, cp); IMB_colormanagement_colorspace_to_scene_linear_v3(r_col, ibuf->rect_colorspace); ret = true; @@ -507,7 +507,7 @@ static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event) if (fx >= 0.0f && fy >= 0.0f && fx < 1.0f && fy < 1.0f) { const float *fp; - unsigned char *cp; + uchar *cp; int x = (int)(fx * ibuf->x), y = (int)(fy * ibuf->y); CLAMP(x, 0, ibuf->x - 1); @@ -522,7 +522,7 @@ static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event) info->zfp = NULL; if (ibuf->rect) { - cp = (unsigned char *)(ibuf->rect + y * ibuf->x + x); + cp = (uchar *)(ibuf->rect + y * ibuf->x + x); info->col[0] = cp[0]; info->col[1] = cp[1]; diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 0766996c00b..b50a3e1743e 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -99,9 +99,9 @@ static Sequence *special_seq_update = NULL; -void color3ubv_from_seq(Scene *curscene, Sequence *seq, unsigned char col[3]) +void color3ubv_from_seq(Scene *curscene, Sequence *seq, uchar col[3]) { - unsigned char blendcol[3]; + uchar blendcol[3]; switch (seq->type) { case SEQ_TYPE_IMAGE: @@ -366,7 +366,7 @@ static void drawmeta_contents(Scene *scene, Sequence *seqm, float x1, float y1, * so for now, just use the meta's immediate children, could be fixed but * its only drawing - campbell */ Sequence *seq; - unsigned char col[4]; + uchar col[4]; int chan_min = MAXSEQ; int chan_max = 0; @@ -467,15 +467,15 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, const float handsize_clamped, const short direction, - unsigned int pos, + uint pos, bool seq_active, float pixelx, bool y_threshold) { float rx1 = 0, rx2 = 0; float x1, x2, y1, y2; - unsigned int whichsel = 0; - unsigned char col[4]; + uint whichsel = 0; + uchar col[4]; x1 = seq->startdisp; x2 = seq->enddisp; @@ -557,7 +557,7 @@ static void draw_seq_handle(View2D *v2d, } static void draw_seq_outline(Sequence *seq, - unsigned int pos, + uint pos, float x1, float x2, float y1, @@ -566,7 +566,7 @@ static void draw_seq_outline(Sequence *seq, float pixely, bool seq_active) { - unsigned char col[3]; + uchar col[3]; /* Get the color for the outline. */ if (seq_active && (seq->flag & SELECT)) { @@ -751,10 +751,10 @@ static void draw_seq_text(View2D *v2d, UI_view2d_text_cache_add_rectf(v2d, &rect, str, str_len, col); } -static void draw_sequence_extensions(Scene *scene, Sequence *seq, unsigned int pos, float pixely) +static void draw_sequence_extensions(Scene *scene, Sequence *seq, uint pos, float pixely) { float x1, x2, y1, y2; - unsigned char col[4], blend_col[3]; + uchar col[4], blend_col[3]; x1 = seq->startdisp; x2 = seq->enddisp; @@ -793,9 +793,9 @@ static void draw_sequence_extensions(Scene *scene, Sequence *seq, unsigned int p GPU_blend(false); } -static void draw_color_strip_band(Sequence *seq, unsigned int pos, float text_margin_y, float y1) +static void draw_color_strip_band(Sequence *seq, uint pos, float text_margin_y, float y1) { - unsigned char col[4]; + uchar col[4]; SolidColorVars *colvars = (SolidColorVars *)seq->effectdata; rgb_float_to_uchar(col, colvars->col); @@ -827,14 +827,14 @@ static void draw_color_strip_band(Sequence *seq, unsigned int pos, float text_ma static void draw_seq_background(Scene *scene, Sequence *seq, - unsigned int pos, + uint pos, float x1, float x2, float y1, float y2, bool is_single_image) { - unsigned char col[4]; + uchar col[4]; /* Get the correct color per strip type, transitions use their inputs ones. */ if (ELEM(seq->type, SEQ_TYPE_CROSS, SEQ_TYPE_GAMCROSS, SEQ_TYPE_WIPE)) { @@ -1538,7 +1538,7 @@ static void sequencer_draw_display_buffer(const bContext *C, IMB_rect_from_float(ibuf); } - display_buffer = (unsigned char *)ibuf->rect; + display_buffer = (uchar *)ibuf->rect; format = GL_RGBA; type = GL_UNSIGNED_BYTE; } diff --git a/source/blender/editors/space_sequencer/sequencer_scopes.c b/source/blender/editors/space_sequencer/sequencer_scopes.c index 309840ea9e3..3dcbdb6c4b0 100644 --- a/source/blender/editors/space_sequencer/sequencer_scopes.c +++ b/source/blender/editors/space_sequencer/sequencer_scopes.c @@ -50,24 +50,24 @@ static void rgb_to_yuv_normalized(const float rgb[3], float yuv[3]) yuv[2] += 0.5f; } -static void scope_put_pixel(unsigned char *table, unsigned char *pos) +static void scope_put_pixel(uchar *table, uchar *pos) { - unsigned char newval = table[*pos]; + uchar newval = table[*pos]; pos[0] = pos[1] = pos[2] = newval; pos[3] = 255; } -static void scope_put_pixel_single(unsigned char *table, unsigned char *pos, int col) +static void scope_put_pixel_single(uchar *table, uchar *pos, int col) { char newval = table[pos[col]]; pos[col] = newval; pos[3] = 255; } -static void wform_put_line(int w, unsigned char *last_pos, unsigned char *new_pos) +static void wform_put_line(int w, uchar *last_pos, uchar *new_pos) { if (last_pos > new_pos) { - unsigned char *temp = new_pos; + uchar *temp = new_pos; new_pos = last_pos; last_pos = temp; } @@ -81,10 +81,10 @@ static void wform_put_line(int w, unsigned char *last_pos, unsigned char *new_po } } -static void wform_put_line_single(int w, unsigned char *last_pos, unsigned char *new_pos, int col) +static void wform_put_line_single(int w, uchar *last_pos, uchar *new_pos, int col) { if (last_pos > new_pos) { - unsigned char *temp = new_pos; + uchar *temp = new_pos; new_pos = last_pos; last_pos = temp; } @@ -98,12 +98,12 @@ static void wform_put_line_single(int w, unsigned char *last_pos, unsigned char } } -static void wform_put_border(unsigned char *tgt, int w, int h) +static void wform_put_border(uchar *tgt, int w, int h) { int x, y; for (x = 0; x < w; x++) { - unsigned char *p = tgt + 4 * x; + uchar *p = tgt + 4 * x; p[1] = p[3] = 155; p[4 * w + 1] = p[4 * w + 3] = 155; p = tgt + 4 * (w * (h - 1) + x); @@ -112,7 +112,7 @@ static void wform_put_border(unsigned char *tgt, int w, int h) } for (y = 0; y < h; y++) { - unsigned char *p = tgt + 4 * w * y; + uchar *p = tgt + 4 * w * y; p[1] = p[3] = 155; p[4 + 1] = p[4 + 3] = 155; p = tgt + 4 * (w * y + w - 1); @@ -121,7 +121,7 @@ static void wform_put_border(unsigned char *tgt, int w, int h) } } -static void wform_put_gridrow(unsigned char *tgt, float perc, int w, int h) +static void wform_put_gridrow(uchar *tgt, float perc, int w, int h) { int i; @@ -134,7 +134,7 @@ static void wform_put_gridrow(unsigned char *tgt, float perc, int w, int h) } } -static void wform_put_grid(unsigned char *tgt, int w, int h) +static void wform_put_grid(uchar *tgt, int w, int h) { wform_put_gridrow(tgt, 90.0, w, h); wform_put_gridrow(tgt, 70.0, w, h); @@ -145,27 +145,27 @@ static ImBuf *make_waveform_view_from_ibuf_byte(ImBuf *ibuf) { ImBuf *rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect); int x, y; - const unsigned char *src = (unsigned char *)ibuf->rect; - unsigned char *tgt = (unsigned char *)rval->rect; + const uchar *src = (uchar *)ibuf->rect; + uchar *tgt = (uchar *)rval->rect; int w = ibuf->x + 3; int h = 515; float waveform_gamma = 0.2; - unsigned char wtable[256]; + uchar wtable[256]; wform_put_grid(tgt, w, h); wform_put_border(tgt, w, h); for (x = 0; x < 256; x++) { - wtable[x] = (unsigned char)(pow(((float)x + 1) / 256, waveform_gamma) * 255); + wtable[x] = (uchar)(pow(((float)x + 1) / 256, waveform_gamma) * 255); } for (y = 0; y < ibuf->y; y++) { - unsigned char *last_p = NULL; + uchar *last_p = NULL; for (x = 0; x < ibuf->x; x++) { - const unsigned char *rgb = src + 4 * (ibuf->x * y + x); + const uchar *rgb = src + 4 * (ibuf->x * y + x); float v = (float)IMB_colormanagement_get_luminance_byte(rgb) / 255.0f; - unsigned char *p = tgt; + uchar *p = tgt; p += 4 * (w * ((int)(v * (h - 3)) + 1) + x + 1); scope_put_pixel(wtable, p); @@ -187,25 +187,25 @@ static ImBuf *make_waveform_view_from_ibuf_float(ImBuf *ibuf) ImBuf *rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect); int x, y; const float *src = ibuf->rect_float; - unsigned char *tgt = (unsigned char *)rval->rect; + uchar *tgt = (uchar *)rval->rect; int w = ibuf->x + 3; int h = 515; float waveform_gamma = 0.2; - unsigned char wtable[256]; + uchar wtable[256]; wform_put_grid(tgt, w, h); for (x = 0; x < 256; x++) { - wtable[x] = (unsigned char)(pow(((float)x + 1) / 256, waveform_gamma) * 255); + wtable[x] = (uchar)(pow(((float)x + 1) / 256, waveform_gamma) * 255); } for (y = 0; y < ibuf->y; y++) { - unsigned char *last_p = NULL; + uchar *last_p = NULL; for (x = 0; x < ibuf->x; x++) { const float *rgb = src + 4 * (ibuf->x * y + x); float v = IMB_colormanagement_get_luminance(rgb); - unsigned char *p = tgt; + uchar *p = tgt; CLAMP(v, 0.0f, 1.0f); @@ -241,28 +241,28 @@ static ImBuf *make_sep_waveform_view_from_ibuf_byte(ImBuf *ibuf) { ImBuf *rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect); int x, y; - const unsigned char *src = (const unsigned char *)ibuf->rect; - unsigned char *tgt = (unsigned char *)rval->rect; + const uchar *src = (const uchar *)ibuf->rect; + uchar *tgt = (uchar *)rval->rect; int w = ibuf->x + 3; int sw = ibuf->x / 3; int h = 515; float waveform_gamma = 0.2; - unsigned char wtable[256]; + uchar wtable[256]; wform_put_grid(tgt, w, h); for (x = 0; x < 256; x++) { - wtable[x] = (unsigned char)(pow(((float)x + 1) / 256, waveform_gamma) * 255); + wtable[x] = (uchar)(pow(((float)x + 1) / 256, waveform_gamma) * 255); } for (y = 0; y < ibuf->y; y++) { - unsigned char *last_p[3] = {NULL, NULL, NULL}; + uchar *last_p[3] = {NULL, NULL, NULL}; for (x = 0; x < ibuf->x; x++) { int c; - const unsigned char *rgb = src + 4 * (ibuf->x * y + x); + const uchar *rgb = src + 4 * (ibuf->x * y + x); for (c = 0; c < 3; c++) { - unsigned char *p = tgt; + uchar *p = tgt; p += 4 * (w * ((rgb[c] * (h - 3)) / 255 + 1) + c * sw + x / 3 + 1); scope_put_pixel_single(wtable, p, c); @@ -287,27 +287,27 @@ static ImBuf *make_sep_waveform_view_from_ibuf_float(ImBuf *ibuf) ImBuf *rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect); int x, y; const float *src = ibuf->rect_float; - unsigned char *tgt = (unsigned char *)rval->rect; + uchar *tgt = (uchar *)rval->rect; int w = ibuf->x + 3; int sw = ibuf->x / 3; int h = 515; float waveform_gamma = 0.2; - unsigned char wtable[256]; + uchar wtable[256]; wform_put_grid(tgt, w, h); for (x = 0; x < 256; x++) { - wtable[x] = (unsigned char)(pow(((float)x + 1) / 256, waveform_gamma) * 255); + wtable[x] = (uchar)(pow(((float)x + 1) / 256, waveform_gamma) * 255); } for (y = 0; y < ibuf->y; y++) { - unsigned char *last_p[3] = {NULL, NULL, NULL}; + uchar *last_p[3] = {NULL, NULL, NULL}; for (x = 0; x < ibuf->x; x++) { int c; const float *rgb = src + 4 * (ibuf->x * y + x); for (c = 0; c < 3; c++) { - unsigned char *p = tgt; + uchar *p = tgt; float v = rgb[c]; CLAMP(v, 0.0f, 1.0f); @@ -343,18 +343,18 @@ ImBuf *make_sep_waveform_view_from_ibuf(ImBuf *ibuf) static void draw_zebra_byte(ImBuf *src, ImBuf *ibuf, float perc) { - unsigned int limit = 255.0f * perc / 100.0f; - unsigned char *p = (unsigned char *)src->rect; - unsigned char *o = (unsigned char *)ibuf->rect; + uint limit = 255.0f * perc / 100.0f; + uchar *p = (uchar *)src->rect; + uchar *o = (uchar *)ibuf->rect; int x; int y; for (y = 0; y < ibuf->y; y++) { for (x = 0; x < ibuf->x; x++) { - unsigned char r = *p++; - unsigned char g = *p++; - unsigned char b = *p++; - unsigned char a = *p++; + uchar r = *p++; + uchar g = *p++; + uchar b = *p++; + uchar a = *p++; if (r >= limit || g >= limit || b >= limit) { if (((x + y) & 0x08) != 0) { @@ -375,7 +375,7 @@ static void draw_zebra_float(ImBuf *src, ImBuf *ibuf, float perc) { float limit = perc / 100.0f; const float *p = src->rect_float; - unsigned char *o = (unsigned char *)ibuf->rect; + uchar *o = (uchar *)ibuf->rect; int x; int y; @@ -417,7 +417,7 @@ ImBuf *make_zebra_view_from_ibuf(ImBuf *src, float perc) static void draw_histogram_marker(ImBuf *ibuf, int x) { - unsigned char *p = (unsigned char *)ibuf->rect; + uchar *p = (uchar *)ibuf->rect; int barh = ibuf->y * 0.1; int i; @@ -431,7 +431,7 @@ static void draw_histogram_marker(ImBuf *ibuf, int x) static void draw_histogram_bar(ImBuf *ibuf, int x, float val, int col) { - unsigned char *p = (unsigned char *)ibuf->rect; + uchar *p = (uchar *)ibuf->rect; int barh = ibuf->y * val * 0.9f; int i; @@ -456,12 +456,12 @@ static void make_histogram_view_from_ibuf_byte_cb_ex(void *__restrict userdata, { MakeHistogramViewData *data = userdata; const ImBuf *ibuf = data->ibuf; - const unsigned char *src = (unsigned char *)ibuf->rect; + const uchar *src = (uchar *)ibuf->rect; uint32_t(*cur_bins)[HIS_STEPS] = tls->userdata_chunk; for (int x = 0; x < ibuf->x; x++) { - const unsigned char *pixel = src + (y * ibuf->x + x) * 4; + const uchar *pixel = src + (y * ibuf->x + x) * 4; for (int j = 3; j--;) { cur_bins[j][pixel[j]]++; @@ -488,9 +488,9 @@ static ImBuf *make_histogram_view_from_ibuf_byte(ImBuf *ibuf) { ImBuf *rval = IMB_allocImBuf(515, 128, 32, IB_rect); int x; - unsigned int nr, ng, nb; + uint nr, ng, nb; - unsigned int bins[3][HIS_STEPS]; + uint bins[3][HIS_STEPS]; memset(bins, 0, sizeof(bins)); @@ -534,7 +534,7 @@ static ImBuf *make_histogram_view_from_ibuf_byte(ImBuf *ibuf) } } - wform_put_border((unsigned char *)rval->rect, rval->x, rval->y); + wform_put_border((uchar *)rval->rect, rval->x, rval->y); return rval; } @@ -576,7 +576,7 @@ static ImBuf *make_histogram_view_from_ibuf_float(ImBuf *ibuf) int nr, ng, nb; int x; - unsigned int bins[3][HIS_STEPS]; + uint bins[3][HIS_STEPS]; memset(bins, 0, sizeof(bins)); @@ -619,7 +619,7 @@ static ImBuf *make_histogram_view_from_ibuf_float(ImBuf *ibuf) draw_histogram_marker(rval, get_bin_float(0.0)); draw_histogram_marker(rval, get_bin_float(1.0)); - wform_put_border((unsigned char *)rval->rect, rval->x, rval->y); + wform_put_border((uchar *)rval->rect, rval->x, rval->y); return rval; } @@ -636,8 +636,7 @@ ImBuf *make_histogram_view_from_ibuf(ImBuf *ibuf) } } -static void vectorscope_put_cross( - unsigned char r, unsigned char g, unsigned char b, char *tgt, int w, int h, int size) +static void vectorscope_put_cross(uchar r, uchar g, uchar b, char *tgt, int w, int h, int size) { float rgb[3], yuv[3]; char *p; @@ -676,10 +675,10 @@ static ImBuf *make_vectorscope_view_from_ibuf_byte(ImBuf *ibuf) int w = 515; int h = 515; float scope_gamma = 0.2; - unsigned char wtable[256]; + uchar wtable[256]; for (x = 0; x < 256; x++) { - wtable[x] = (unsigned char)(pow(((float)x + 1) / 256, scope_gamma) * 255); + wtable[x] = (uchar)(pow(((float)x + 1) / 256, scope_gamma) * 255); } for (x = 0; x < 256; x++) { @@ -702,7 +701,7 @@ static ImBuf *make_vectorscope_view_from_ibuf_byte(ImBuf *ibuf) rgb_to_yuv_normalized(rgb, yuv); p = tgt + 4 * (w * (int)((yuv[2] * (h - 3) + 1)) + (int)((yuv[1] * (w - 3) + 1))); - scope_put_pixel(wtable, (unsigned char *)p); + scope_put_pixel(wtable, (uchar *)p); } } @@ -721,10 +720,10 @@ static ImBuf *make_vectorscope_view_from_ibuf_float(ImBuf *ibuf) int w = 515; int h = 515; float scope_gamma = 0.2; - unsigned char wtable[256]; + uchar wtable[256]; for (x = 0; x < 256; x++) { - wtable[x] = (unsigned char)(pow(((float)x + 1) / 256, scope_gamma) * 255); + wtable[x] = (uchar)(pow(((float)x + 1) / 256, scope_gamma) * 255); } for (x = 0; x <= 255; x++) { @@ -748,7 +747,7 @@ static ImBuf *make_vectorscope_view_from_ibuf_float(ImBuf *ibuf) rgb_to_yuv_normalized(rgb, yuv); p = tgt + 4 * (w * (int)((yuv[2] * (h - 3) + 1)) + (int)((yuv[1] * (w - 3) + 1))); - scope_put_pixel(wtable, (unsigned char *)p); + scope_put_pixel(wtable, (uchar *)p); } } diff --git a/source/blender/editors/space_sequencer/sequencer_view.c b/source/blender/editors/space_sequencer/sequencer_view.c index 714a634766c..b2114eab62e 100644 --- a/source/blender/editors/space_sequencer/sequencer_view.c +++ b/source/blender/editors/space_sequencer/sequencer_view.c @@ -57,11 +57,11 @@ typedef struct ImageSampleInfo { int x, y; int channels; - unsigned char col[4]; + uchar col[4]; float colf[4]; float linearcol[4]; - unsigned char *colp; + uchar *colp; const float *colfp; int draw; @@ -117,7 +117,7 @@ static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event) if (fx >= 0.0f && fy >= 0.0f && fx < ibuf->x && fy < ibuf->y) { const float *fp; - unsigned char *cp; + uchar *cp; int x = (int)fx, y = (int)fy; info->x = x; @@ -129,7 +129,7 @@ static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event) info->colfp = NULL; if (ibuf->rect) { - cp = (unsigned char *)(ibuf->rect + y * ibuf->x + x); + cp = (uchar *)(ibuf->rect + y * ibuf->x + x); info->col[0] = cp[0]; info->col[1] = cp[1]; diff --git a/source/blender/editors/space_text/text_format.c b/source/blender/editors/space_text/text_format.c index 2eeb46049d2..bdbf55d9198 100644 --- a/source/blender/editors/space_text/text_format.c +++ b/source/blender/editors/space_text/text_format.c @@ -121,7 +121,7 @@ int flatten_string_strlen(FlattenString *fs, const char *str) /* Ensures the format string for the given line is long enough, reallocating * as needed. Allocation is done here, alone, to ensure consistency. */ -int text_check_format_len(TextLine *line, unsigned int len) +int text_check_format_len(TextLine *line, uint len) { if (line->format) { if (strlen(line->format) < len) { diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index e0b15d0a9d5..26600bd7dbc 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -3420,7 +3420,7 @@ static int text_insert_exec(bContext *C, wmOperator *op) char *str; bool done = false; size_t i = 0; - unsigned int code; + uint code; text_drawcache_tag_update(st, 0); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 30587e6084d..522d1a15e3f 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1555,9 +1555,7 @@ void VIEW3D_OT_localview_remove_from(wmOperatorType *ot) /** \name Local Collections * \{ */ -static uint free_localcollection_bit(Main *bmain, - unsigned short local_collections_uuid, - bool *r_reset) +static uint free_localcollection_bit(Main *bmain, ushort local_collections_uuid, bool *r_reset) { ScrArea *sa; bScreen *sc; @@ -1596,7 +1594,7 @@ static uint free_localcollection_bit(Main *bmain, } static void local_collections_reset_uuid(LayerCollection *layer_collection, - const unsigned short local_view_bit) + const ushort local_view_bit) { if (layer_collection->flag & LAYER_COLLECTION_HIDE) { layer_collection->local_collections_bits &= ~local_view_bit; diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index a9eaad6868e..965df86acc0 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -559,7 +559,7 @@ static void viewRedrawPost(bContext *C, TransInfo *t) /* ************************** TRANSFORMATIONS **************************** */ -static void view_editmove(unsigned short UNUSED(event)) +static void view_editmove(ushort UNUSED(event)) { #if 0 // TRANSFORM_FIX_ME int refresh = 0; @@ -1576,7 +1576,7 @@ static void drawAutoKeyWarning(TransInfo *UNUSED(t), ARegion *region) /* warning text (to clarify meaning of overlays) * - original color was red to match the icon, but that clashes badly with a less nasty border */ - unsigned char color[3]; + uchar color[3]; UI_GetThemeColorShade3ubv(TH_TEXT_HI, -50, color); BLF_color3ubv(font_id, color); #ifdef WITH_INTERNATIONAL diff --git a/source/blender/editors/transform/transform_convert.c b/source/blender/editors/transform/transform_convert.c index 1049db74a75..19319d2606b 100644 --- a/source/blender/editors/transform/transform_convert.c +++ b/source/blender/editors/transform/transform_convert.c @@ -1128,10 +1128,10 @@ static void posttrans_action_clean(bAnimContext *ac, bAction *act) /* struct for use in re-sorting BezTriples during Graph Editor transform */ typedef struct BeztMap { BezTriple *bezt; - unsigned int oldIndex; /* index of bezt in fcu->bezt array before sorting */ - unsigned int newIndex; /* index of bezt in fcu->bezt array after sorting */ - short swapHs; /* swap order of handles (-1=clear; 0=not checked, 1=swap) */ - char pipo, cipo; /* interpolation of current and next segments */ + uint oldIndex; /* index of bezt in fcu->bezt array before sorting */ + uint newIndex; /* index of bezt in fcu->bezt array after sorting */ + short swapHs; /* swap order of handles (-1=clear; 0=not checked, 1=swap) */ + char pipo, cipo; /* interpolation of current and next segments */ } BeztMap; /* This function converts an FCurve's BezTriple array to a BeztMap array diff --git a/source/blender/editors/transform/transform_draw_cursors.c b/source/blender/editors/transform/transform_draw_cursors.c index f3105c8eb36..95ca5ae0c30 100644 --- a/source/blender/editors/transform/transform_draw_cursors.c +++ b/source/blender/editors/transform/transform_draw_cursors.c @@ -313,7 +313,7 @@ void transform_draw_cursor_draw(bContext *UNUSED(C), int x, int y, void *customd break; } case HLP_TRACKBALL: { - unsigned char col[3], col2[3]; + uchar col[3], col2[3]; UI_GetThemeColor3ubv(TH_GRID, col); GPU_matrix_translate_3fv(mval); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 7a787b77a62..11b4600466c 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -337,7 +337,7 @@ static void animrecord_check_state(Scene *scene, ID *id, wmTimer *animtimer) static bool fcu_test_selected(FCurve *fcu) { BezTriple *bezt = fcu->bezt; - unsigned int i; + uint i; if (bezt == NULL) { /* ignore baked */ return 0; @@ -1222,7 +1222,7 @@ void recalcData(TransInfo *t) void drawLine(TransInfo *t, const float center[3], const float dir[3], char axis, short options) { float v1[3], v2[3], v3[3]; - unsigned char col[3], col2[3]; + uchar col[3], col2[3]; if (t->spacetype == SPACE_VIEW3D) { View3D *v3d = t->view; diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 5cc1feddf7a..423990b3713 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -523,12 +523,12 @@ void initTransformOrientation(bContext *C, TransInfo *t) /** * utility function - get first n, selected vert/edge/faces */ -static unsigned int bm_mesh_elems_select_get_n__internal( - BMesh *bm, BMElem **elems, const unsigned int n, const BMIterType itype, const char htype) +static uint bm_mesh_elems_select_get_n__internal( + BMesh *bm, BMElem **elems, const uint n, const BMIterType itype, const char htype) { BMIter iter; BMElem *ele; - unsigned int i; + uint i; BLI_assert(ELEM(htype, BM_VERT, BM_EDGE, BM_FACE)); BLI_assert(ELEM(itype, BM_VERTS_OF_MESH, BM_EDGES_OF_MESH, BM_FACES_OF_MESH)); @@ -579,18 +579,18 @@ static unsigned int bm_mesh_elems_select_get_n__internal( return i; } -static unsigned int bm_mesh_verts_select_get_n(BMesh *bm, BMVert **elems, const unsigned int n) +static uint bm_mesh_verts_select_get_n(BMesh *bm, BMVert **elems, const uint n) { return bm_mesh_elems_select_get_n__internal( bm, (BMElem **)elems, min_ii(n, bm->totvertsel), BM_VERTS_OF_MESH, BM_VERT); } -static unsigned int bm_mesh_edges_select_get_n(BMesh *bm, BMEdge **elems, const unsigned int n) +static uint bm_mesh_edges_select_get_n(BMesh *bm, BMEdge **elems, const uint n) { return bm_mesh_elems_select_get_n__internal( bm, (BMElem **)elems, min_ii(n, bm->totedgesel), BM_EDGES_OF_MESH, BM_EDGE); } #if 0 -static unsigned int bm_mesh_faces_select_get_n(BMesh *bm, BMVert **elems, const unsigned int n) +static uint bm_mesh_faces_select_get_n(BMesh *bm, BMVert **elems, const uint n) { return bm_mesh_elems_select_get_n__internal( bm, (BMElem **)elems, min_ii(n, bm->totfacesel), BM_FACES_OF_MESH, BM_FACE); diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 86e99c986f8..9adc15ccb61 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -158,7 +158,7 @@ static bool doForceIncrementSnap(const TransInfo *t) void drawSnapping(const struct bContext *C, TransInfo *t) { - unsigned char col[4], selectedCol[4], activeCol[4]; + uchar col[4], selectedCol[4], activeCol[4]; if (!activeSnap(t)) { return; diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index f55c73fd15e..34c9e1f3273 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -447,7 +447,7 @@ struct RayCastAll_Data { float local_scale; Object *ob; - unsigned int ob_uuid; + uint ob_uuid; /* output data */ ListBase *hit_list; @@ -460,7 +460,7 @@ static struct SnapObjectHitDepth *hit_depth_create(const float depth, int index, Object *ob, const float obmat[4][4], - unsigned int ob_uuid) + uint ob_uuid) { struct SnapObjectHitDepth *hit = MEM_mallocN(sizeof(*hit), __func__); @@ -586,7 +586,7 @@ static bool raycastMesh(SnapObjectContext *sctx, Object *ob, Mesh *me, const float obmat[4][4], - const unsigned int ob_index, + const uint ob_index, bool use_hide, bool use_backface_culling, /* read/write args */ @@ -761,7 +761,7 @@ static bool raycastEditMesh(SnapObjectContext *sctx, Object *ob, BMEditMesh *em, const float obmat[4][4], - const unsigned int ob_index, + const uint ob_index, bool use_backface_culling, /* read/write args */ float *ray_depth, @@ -931,7 +931,7 @@ static bool raycastObj(SnapObjectContext *sctx, const float ray_dir[3], Object *ob, const float obmat[4][4], - const unsigned int ob_index, + const uint ob_index, bool use_obedit, bool use_occlusion_test, bool use_backface_culling, @@ -1046,7 +1046,7 @@ static bool raycastObj(SnapObjectContext *sctx, struct RaycastObjUserData { const float *ray_start; const float *ray_dir; - unsigned int ob_index; + uint ob_index; /* read/write args */ float *ray_depth; /* return args */ @@ -1227,7 +1227,7 @@ static void cb_mlooptri_edges_get(const int index, int v_index[3], const BVHTree const MLoopTri *lt = &data->looptri[index]; for (int j = 2, j_next = 0; j_next < 3; j = j_next++) { const MEdge *ed = &medge[mloop[lt->tri[j]].e]; - unsigned int tri_edge[2] = {mloop[lt->tri[j]].v, mloop[lt->tri[j_next]].v}; + uint tri_edge[2] = {mloop[lt->tri[j]].v, mloop[lt->tri[j_next]].v}; if (ELEM(ed->v1, tri_edge[0], tri_edge[1]) && ELEM(ed->v2, tri_edge[0], tri_edge[1])) { // printf("real edge found\n"); v_index[j] = mloop[lt->tri[j]].e; @@ -3049,7 +3049,7 @@ bool ED_transform_snap_object_project_ray(SnapObjectContext *sctx, static short transform_snap_context_project_view3d_mixed_impl( SnapObjectContext *sctx, Depsgraph *depsgraph, - const unsigned short snap_to_flag, + const ushort snap_to_flag, const struct SnapObjectParams *params, const float mval[2], const float prev_co[3], @@ -3225,7 +3225,7 @@ static short transform_snap_context_project_view3d_mixed_impl( short ED_transform_snap_object_project_view3d_ex(SnapObjectContext *sctx, Depsgraph *depsgraph, - const unsigned short snap_to, + const ushort snap_to, const struct SnapObjectParams *params, const float mval[2], const float prev_co[3], @@ -3265,7 +3265,7 @@ short ED_transform_snap_object_project_view3d_ex(SnapObjectContext *sctx, */ bool ED_transform_snap_object_project_view3d(SnapObjectContext *sctx, Depsgraph *depsgraph, - const unsigned short snap_to, + const ushort snap_to, const struct SnapObjectParams *params, const float mval[2], const float prev_co[3], 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