[Bf-blender-cvs] [9ce1a04e2aa] master: Cleanup: Resolve warnings

Julian Eisel noreply at git.blender.org
Fri Sep 18 21:00:18 CEST 2020


Commit: 9ce1a04e2aa19a2746f0947bd8d8391f680cc90d
Author: Julian Eisel
Date:   Fri Sep 18 20:51:22 2020 +0200
Branches: master
https://developer.blender.org/rB9ce1a04e2aa19a2746f0947bd8d8391f680cc90d

Cleanup: Resolve warnings

Unused variables, missing include for declaration, missing 'static'
specifier. Also rename function to match naming convention.

===================================================================

M	source/blender/editors/object/object_modes.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/sculpt_paint/sculpt_cloth.c
M	source/blender/editors/sculpt_paint/sculpt_intern.h

===================================================================

diff --git a/source/blender/editors/object/object_modes.c b/source/blender/editors/object/object_modes.c
index caba10c820b..79846b42c65 100644
--- a/source/blender/editors/object/object_modes.c
+++ b/source/blender/editors/object/object_modes.c
@@ -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;
 }
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 0b4f853b677..ea084d70bf8 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -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);
diff --git a/source/blender/editors/sculpt_paint/sculpt_cloth.c b/source/blender/editors/sculpt_paint/sculpt_cloth.c
index d8fedecc61c..3d0e5791f0d 100644
--- a/source/blender/editors/sculpt_paint/sculpt_cloth.c
+++ b/source/blender/editors/sculpt_paint/sculpt_cloth.c
@@ -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,
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index bc88793b993..71d6eb844e9 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -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,



More information about the Bf-blender-cvs mailing list