Cleanup: Resolve warnings

Unused variables, missing include for declaration, missing 'static'
specifier. Also rename function to match naming convention.
This commit is contained in:
Julian Eisel 2020-09-18 20:51:22 +02:00
parent 9d528381b5
commit 9ce1a04e2a
4 changed files with 5 additions and 9 deletions

View File

@ -57,6 +57,7 @@
#include "WM_toolsystem.h"
#include "ED_object.h" /* own include */
#include "object_intern.h"
/* -------------------------------------------------------------------- */
/** \name High Level Mode Operations
@ -406,7 +407,7 @@ bool ED_object_mode_generic_has_data(struct Depsgraph *depsgraph, struct Object
*
* \{ */
bool OBJECT_switch_object_poll(bContext *C)
static bool object_switch_object_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if (!CTX_wm_region_view3d(C)) {
@ -415,7 +416,7 @@ bool OBJECT_switch_object_poll(bContext *C)
return ob && ELEM(ob->mode, OB_MODE_EDIT, OB_MODE_SCULPT);
}
static int object_switch_object_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int object_switch_object_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
{
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
@ -502,7 +503,7 @@ void OBJECT_OT_switch_object(wmOperatorType *ot)
/* api callbacks */
ot->invoke = object_switch_object_invoke;
ot->poll = OBJECT_switch_object_poll;
ot->poll = object_switch_object_poll;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}

View File

@ -5722,8 +5722,7 @@ static void do_brush_action(Sculpt *sd, Object *ob, Brush *brush, UnifiedPaintSe
if (brush->deform_target == BRUSH_DEFORM_TARGET_CLOTH_SIM) {
if (!ss->cache->cloth_sim) {
ss->cache->cloth_sim = SCULPT_cloth_brush_simulation_create(
ss, brush, 1.0f, 0.0f, false, true);
ss->cache->cloth_sim = SCULPT_cloth_brush_simulation_create(ss, 1.0f, 0.0f, false, true);
SCULPT_cloth_brush_simulation_init(ss, ss->cache->cloth_sim);
SCULPT_cloth_brush_build_nodes_constraints(
sd, ob, nodes, totnode, ss->cache->cloth_sim, ss->cache->location, FLT_MAX);

View File

@ -873,7 +873,6 @@ static void cloth_brush_apply_brush_foces(Sculpt *sd, Object *ob, PBVHNode **nod
/* Public functions. */
SculptClothSimulation *SCULPT_cloth_brush_simulation_create(SculptSession *ss,
Brush *brush,
const float cloth_mass,
const float cloth_damping,
const bool use_collisions,
@ -993,7 +992,6 @@ void SCULPT_do_cloth_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
if (SCULPT_stroke_is_first_brush_step(ss->cache) || !ss->cache->cloth_sim) {
ss->cache->cloth_sim = SCULPT_cloth_brush_simulation_create(
ss,
brush,
brush->cloth_mass,
brush->cloth_damping,
(brush->flag2 & BRUSH_CLOTH_USE_COLLISION),
@ -1355,7 +1353,6 @@ static int sculpt_cloth_filter_invoke(bContext *C, wmOperator *op, const wmEvent
const bool use_collisions = RNA_boolean_get(op->ptr, "use_collisions");
ss->filter_cache->cloth_sim = SCULPT_cloth_brush_simulation_create(
ss,
NULL,
cloth_mass,
cloth_damping,
use_collisions,

View File

@ -366,7 +366,6 @@ void SCULPT_do_cloth_brush(struct Sculpt *sd,
void SCULPT_cloth_simulation_free(struct SculptClothSimulation *cloth_sim);
struct SculptClothSimulation *SCULPT_cloth_brush_simulation_create(struct SculptSession *ss,
struct Brush *brush,
const float cloth_mass,
const float cloth_damping,
const bool use_collisions,