index-of-nearest-104619 #2

Merged
Iliya Katushenock merged 62 commits from HooglyBoogly/blender:index-of-nearest-104619 into index_of_nearest 2023-04-20 21:19:53 +02:00
7 changed files with 11 additions and 11 deletions
Showing only changes of commit 770b193253 - Show all commits

View File

@ -1379,7 +1379,7 @@ const char *BLI_path_extension_or_end(const char *filepath)
{ {
/* NOTE(@ideasman42): Skip the extension when there are no preceding non-extension characters in /* NOTE(@ideasman42): Skip the extension when there are no preceding non-extension characters in
* the file name. This ignores extensions at the beginning of a string or directly after a slash. * the file name. This ignores extensions at the beginning of a string or directly after a slash.
* Only using trailing extension characters has the advantage that stripping the extenion * Only using trailing extension characters has the advantage that stripping the extension
* never leads to a blank string (which can't be used as a file path). * never leads to a blank string (which can't be used as a file path).
* Matches Python's `os.path.splitext`. */ * Matches Python's `os.path.splitext`. */
const char *ext = NULL; const char *ext = NULL;

View File

@ -846,7 +846,7 @@ static bool gpencil_weightpaint_brush_init(bContext *C, wmOperator *op)
/* Get boolean array of vertex groups deformed by bones. */ /* Get boolean array of vertex groups deformed by bones. */
gso->vgroup_bone_deformed = gpencil_vgroup_bone_deformed_map_get(ob, gso->vgroup_tot); gso->vgroup_bone_deformed = gpencil_vgroup_bone_deformed_map_get(ob, gso->vgroup_tot);
if (gso->vgroup_bone_deformed != NULL) { if (gso->vgroup_bone_deformed != NULL) {
/* Get boolean array of locked vertext groups. */ /* Get boolean array of locked vertex groups. */
gso->vgroup_locked = BKE_object_defgroup_lock_flags_get(ob, gso->vgroup_tot); gso->vgroup_locked = BKE_object_defgroup_lock_flags_get(ob, gso->vgroup_tot);
if (gso->vgroup_locked == NULL) { if (gso->vgroup_locked == NULL) {
gso->vgroup_locked = (bool *)MEM_callocN(sizeof(bool) * gso->vgroup_tot, __func__); gso->vgroup_locked = (bool *)MEM_callocN(sizeof(bool) * gso->vgroup_tot, __func__);

View File

@ -208,7 +208,7 @@ static void ruler_item_as_string(
} }
else { else {
BKE_unit_value_as_string( BKE_unit_value_as_string(
numstr, numstr_size, (double)ruler_angle, prec, B_UNIT_ROTATION, unit, false); numstr, numstr_size, double(ruler_angle), prec, B_UNIT_ROTATION, unit, false);
} }
} }
else { else {
@ -220,7 +220,7 @@ static void ruler_item_as_string(
else { else {
BKE_unit_value_as_string(numstr, BKE_unit_value_as_string(numstr,
numstr_size, numstr_size,
(double)(ruler_len * unit->scale_length), double(ruler_len * unit->scale_length),
prec, prec,
B_UNIT_LENGTH, B_UNIT_LENGTH,
unit, unit,

View File

@ -1464,7 +1464,7 @@ static void gizmo_3d_setup_draw_modal(wmGizmo *axis, const int axis_idx, const i
case MAN_AXIS_SCALE_Z: { case MAN_AXIS_SCALE_Z: {
float end, start_co[3] = {0.0f, 0.0f, 0.0f}; float end, start_co[3] = {0.0f, 0.0f, 0.0f};
gizmo_line_range(twtype, axis_type, NULL, &end); gizmo_line_range(twtype, axis_type, nullptr, &end);
RNA_float_set(axis->ptr, "length", end); RNA_float_set(axis->ptr, "length", end);
RNA_enum_set(axis->ptr, RNA_enum_set(axis->ptr,
"draw_options", "draw_options",
@ -1797,7 +1797,7 @@ static void gizmo_refresh_from_matrix(wmGizmo *axis,
copy_m4_m4(axis->matrix_basis, twmat); copy_m4_m4(axis->matrix_basis, twmat);
if (scale) { if (scale) {
float end; float end;
gizmo_line_range(twtype, axis_type, NULL, &end); gizmo_line_range(twtype, axis_type, nullptr, &end);
RNA_float_set(axis->ptr, "length", end * scale[aidx_norm]); RNA_float_set(axis->ptr, "length", end * scale[aidx_norm]);
} }

View File

@ -243,9 +243,9 @@ static void memfile_undosys_step_decode(struct bContext *C,
* modified IDs should already have other depsgraph update tags anyway. * modified IDs should already have other depsgraph update tags anyway.
* However, for the sake of consistency, it's better to effectively use it, * However, for the sake of consistency, it's better to effectively use it,
* since content of that ID pointer does have been modified. */ * since content of that ID pointer does have been modified. */
unsigned int recalc_flags = id->recalc | ((id->tag & LIB_TAG_UNDO_OLD_ID_REREAD_IN_PLACE) ? uint recalc_flags = id->recalc | ((id->tag & LIB_TAG_UNDO_OLD_ID_REREAD_IN_PLACE) ?
ID_RECALC_COPY_ON_WRITE : ID_RECALC_COPY_ON_WRITE :
IDRecalcFlag(0)); IDRecalcFlag(0));
/* Tag depsgraph to update data-block for changes that happened between the /* Tag depsgraph to update data-block for changes that happened between the
* current and the target state, see direct_link_id_restore_recalc(). */ * current and the target state, see direct_link_id_restore_recalc(). */
if (recalc_flags != 0) { if (recalc_flags != 0) {

View File

@ -198,7 +198,7 @@ void PackIsland::calculate_pre_rotation_(const UVPackIsland_Params &params)
} }
const float(*source)[2] = reinterpret_cast<const float(*)[2]>(coords.data()); const float(*source)[2] = reinterpret_cast<const float(*)[2]>(coords.data());
float angle = -BLI_convexhull_aabb_fit_points_2d(source, (int)coords.size()); float angle = -BLI_convexhull_aabb_fit_points_2d(source, int(coords.size()));
if (1) { if (1) {
/* "Stand-up" islands. */ /* "Stand-up" islands. */

View File

@ -375,7 +375,7 @@ static bool wm_init_splash_show_on_startup_check()
else { else {
/* A less common case, if there is no user preferences, show the splash screen /* A less common case, if there is no user preferences, show the splash screen
* so the user has the opportunity to restore settings from a previous version. */ * so the user has the opportunity to restore settings from a previous version. */
const char *const cfgdir = BKE_appdir_folder_id(BLENDER_USER_CONFIG, NULL); const char *const cfgdir = BKE_appdir_folder_id(BLENDER_USER_CONFIG, nullptr);
if (cfgdir) { if (cfgdir) {
char userpref[FILE_MAX]; char userpref[FILE_MAX];
BLI_path_join(userpref, sizeof(userpref), cfgdir, BLENDER_USERPREF_FILE); BLI_path_join(userpref, sizeof(userpref), cfgdir, BLENDER_USERPREF_FILE);