Cleanup: Clang tidy

This commit is contained in:
Hans Goudey 2022-07-29 23:23:50 -05:00
parent 599a7ddf17
commit aa7734c9da
6 changed files with 19 additions and 24 deletions

View File

@ -73,7 +73,7 @@ static void set_crazy_vertex_quat(float r_quat[4],
static bool modifiers_disable_subsurf_temporary(struct Scene *scene, Object *ob)
{
bool disabled = false;
int cageIndex = BKE_modifiers_get_cage_index(scene, ob, nullptr, 1);
int cageIndex = BKE_modifiers_get_cage_index(scene, ob, nullptr, true);
ModifierData *md = static_cast<ModifierData *>(ob->modifiers.first);
for (int i = 0; md && i <= cageIndex; i++, md = md->next) {
@ -241,7 +241,7 @@ int BKE_crazyspace_get_first_deform_matrices_editbmesh(struct Depsgraph *depsgra
Mesh *me_input = static_cast<Mesh *>(ob->data);
Mesh *me = nullptr;
int i, a, modifiers_left_num = 0, verts_num = 0;
int cageIndex = BKE_modifiers_get_cage_index(scene, ob, nullptr, 1);
int cageIndex = BKE_modifiers_get_cage_index(scene, ob, nullptr, true);
float(*defmats)[3][3] = nullptr, (*deformedVerts)[3] = nullptr;
VirtualModifierData virtualModifierData;
ModifierEvalContext mectx = {depsgraph, ob, ModifierApplyFlag(0)};
@ -362,7 +362,7 @@ int BKE_sculpt_get_first_deform_matrices(struct Depsgraph *depsgraph,
VirtualModifierData virtualModifierData;
Object object_eval;
crazyspace_init_object_for_eval(depsgraph, object, &object_eval);
MultiresModifierData *mmd = get_multires_modifier(scene, &object_eval, 0);
MultiresModifierData *mmd = get_multires_modifier(scene, &object_eval, false);
const bool is_sculpt_mode = (object->mode & OB_MODE_SCULPT) != 0;
const bool has_multires = mmd != nullptr && mmd->sculptlvl > 0;
const ModifierEvalContext mectx = {depsgraph, &object_eval, ModifierApplyFlag(0)};

View File

@ -556,7 +556,7 @@ void paintvert_hide(bContext *C, Object *ob, const bool unselected)
{
Mesh *const me = BKE_mesh_from_object(ob);
if (me == NULL || me->totvert == 0) {
if (me == nullptr || me->totvert == 0) {
return;
}
@ -584,7 +584,7 @@ void paintvert_reveal(bContext *C, Object *ob, const bool select)
{
Mesh *const me = BKE_mesh_from_object(ob);
if (me == NULL || me->totvert == 0) {
if (me == nullptr || me->totvert == 0) {
return;
}

View File

@ -1032,15 +1032,13 @@ static eContextResult screen_ctx_sel_actions_impl(const bContext *C,
CTX_data_id_pointer_set(result, (ID *)action);
break;
}
else {
if (editable && ID_IS_LINKED(action)) {
continue;
}
if (editable && ID_IS_LINKED(action)) {
continue;
}
/* Add the action to the output list if not already added. */
if (BLI_gset_add(seen_set, action)) {
CTX_data_id_list_add(result, &action->id);
}
/* Add the action to the output list if not already added. */
if (BLI_gset_add(seen_set, action)) {
CTX_data_id_list_add(result, &action->id);
}
}
}

View File

@ -757,9 +757,7 @@ static void sculpt_vertex_neighbor_add(SculptVertexNeighborIter *iter,
iter->size++;
}
static void sculpt_vertex_neighbors_get_bmesh(SculptSession *ss,
PBVHVertRef vertex,
SculptVertexNeighborIter *iter)
static void sculpt_vertex_neighbors_get_bmesh(PBVHVertRef vertex, SculptVertexNeighborIter *iter)
{
BMVert *v = (BMVert *)vertex.i;
BMIter liter;
@ -875,7 +873,7 @@ void SCULPT_vertex_neighbors_get(SculptSession *ss,
sculpt_vertex_neighbors_get_faces(ss, vertex, iter);
return;
case PBVH_BMESH:
sculpt_vertex_neighbors_get_bmesh(ss, vertex, iter);
sculpt_vertex_neighbors_get_bmesh(vertex, iter);
return;
case PBVH_GRIDS:
sculpt_vertex_neighbors_get_grids(ss, vertex, include_duplicates, iter);

View File

@ -432,7 +432,7 @@ static void utile_decref(UndoImageTile *utile)
/** \name Image Undo Buffer
* \{ */
typedef struct UndoImageBuf {
struct UndoImageBuf {
struct UndoImageBuf *next, *prev;
/**
@ -456,8 +456,7 @@ typedef struct UndoImageBuf {
bool use_float;
char gen_type;
} image_state;
} UndoImageBuf;
};
static UndoImageBuf *ubuf_from_image_no_tiles(Image *image, const ImBuf *ibuf)
{
@ -552,7 +551,7 @@ static void ubuf_free(UndoImageBuf *ubuf)
/** \name Image Undo Handle
* \{ */
typedef struct UndoImageHandle {
struct UndoImageHandle {
struct UndoImageHandle *next, *prev;
/** Each undo handle refers to a single image which may have multiple buffers. */
@ -567,8 +566,7 @@ typedef struct UndoImageHandle {
* List of #UndoImageBuf's to support multiple buffers per image.
*/
ListBase buffers;
} UndoImageHandle;
};
static void uhandle_restore_list(ListBase *undo_handles, bool use_init)
{

View File

@ -498,7 +498,8 @@ static bool snap_object_is_snappable(const SnapObjectContext *sctx,
const bool is_edited = (base->object->mode == OB_MODE_EDIT);
const bool is_selectable = (base->flag & BASE_SELECTABLE);
/* Get attributes of state. */
const bool is_in_object_mode = (base_act == NULL) || (base_act->object->mode == OB_MODE_OBJECT);
const bool is_in_object_mode = (base_act == nullptr) ||
(base_act->object->mode == OB_MODE_OBJECT);
if (is_in_object_mode) {
/* Handle target selection options that make sense for object mode. */