[Bf-blender-cvs] [c3ecfdf40b0] master: Cleanup: Compilation warnings

Sergey Sharybin noreply at git.blender.org
Fri Mar 18 12:07:27 CET 2022


Commit: c3ecfdf40b02f7d12775f1ded2f039d40f1470bb
Author: Sergey Sharybin
Date:   Wed Mar 16 10:57:19 2022 +0100
Branches: master
https://developer.blender.org/rBc3ecfdf40b02f7d12775f1ded2f039d40f1470bb

Cleanup: Compilation warnings

Mainly -Wset-but-unused-variable.
Makes default compilation on macOS way less noisy.

Differential Revision: https://developer.blender.org/D14357

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

M	intern/cycles/session/tile.cpp
M	intern/dualcon/intern/octree.cpp
M	intern/ghost/intern/GHOST_ContextCGL.mm
M	intern/ghost/intern/GHOST_SystemCocoa.mm
M	intern/mantaflow/intern/MANTA_main.cpp
M	intern/mikktspace/mikktspace.c
M	source/blender/blenkernel/intern/dynamicpaint.c
M	source/blender/blenkernel/intern/mesh_validate.cc
M	source/blender/blenkernel/intern/particle_child.c
M	source/blender/blenlib/intern/delaunay_2d.cc
M	source/blender/bmesh/tools/bmesh_decimate_collapse.c
M	source/blender/editors/io/io_collada.c
M	source/blender/editors/mesh/editmesh_rip_edge.c
M	source/blender/editors/mesh/editmesh_tools.c
M	source/blender/editors/space_action/space_action.c
M	source/blender/editors/space_clip/tracking_ops.c
M	source/blender/editors/space_nla/space_nla.c
M	source/blender/editors/space_sequencer/sequencer_draw.c
M	source/blender/editors/uvedit/uvedit_parametrizer.c
M	source/blender/gpencil_modifiers/intern/lineart/lineart_util.c
M	source/blender/gpu/intern/gpu_shader_dependency.cc
M	source/blender/io/alembic/intern/alembic_capi.cc
M	source/blender/python/intern/bpy_props.c

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

diff --git a/intern/cycles/session/tile.cpp b/intern/cycles/session/tile.cpp
index 755e85450a3..82272a7dbf5 100644
--- a/intern/cycles/session/tile.cpp
+++ b/intern/cycles/session/tile.cpp
@@ -43,7 +43,6 @@ static std::vector<std::string> exr_channel_names_for_passes(const BufferParams
   static const char *component_suffixes[] = {"R", "G", "B", "A"};
 
   int pass_index = 0;
-  int num_channels = 0;
   std::vector<std::string> channel_names;
   for (const BufferPass &pass : buffer_params.passes) {
     if (pass.offset == PASS_UNUSED) {
@@ -51,7 +50,6 @@ static std::vector<std::string> exr_channel_names_for_passes(const BufferParams
     }
 
     const PassInfo pass_info = pass.get_info();
-    num_channels += pass_info.num_components;
 
     /* EXR canonically expects first part of channel names to be sorted alphabetically, which is
      * not guaranteed to be the case with passes names. Assign a prefix based on the pass index
diff --git a/intern/dualcon/intern/octree.cpp b/intern/dualcon/intern/octree.cpp
index 9e360848e6b..18242d48292 100644
--- a/intern/dualcon/intern/octree.cpp
+++ b/intern/dualcon/intern/octree.cpp
@@ -242,6 +242,10 @@ void Octree::printMemUsage()
 
   dc_printf("Total allocated bytes on disk: %d \n", totalbytes);
   dc_printf("Total leaf nodes: %d\n", totalLeafs);
+
+  /* Unused when not debuggining. */
+  (void)totalbytes;
+  (void)totalLeafs;
 }
 
 void Octree::resetMinimalEdges()
diff --git a/intern/ghost/intern/GHOST_ContextCGL.mm b/intern/ghost/intern/GHOST_ContextCGL.mm
index 9322b6cee7a..dd800ef52a3 100644
--- a/intern/ghost/intern/GHOST_ContextCGL.mm
+++ b/intern/ghost/intern/GHOST_ContextCGL.mm
@@ -7,6 +7,12 @@
  * Definition of GHOST_ContextCGL class.
  */
 
+/* Don't generate OpenGL deprecation warning. This is a known thing, and is not something easily
+ * solvable in a short term. */
+#ifdef __clang__
+#  pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
 #include "GHOST_ContextCGL.h"
 
 #include <Cocoa/Cocoa.h>
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index f0db6b6fdfc..b6836614962 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -1050,8 +1050,6 @@ void GHOST_SystemCocoa::notifyExternalEventProcessed()
 GHOST_TSuccess GHOST_SystemCocoa::handleWindowEvent(GHOST_TEventType eventType,
                                                     GHOST_WindowCocoa *window)
 {
-  NSArray *windowsList;
-  windowsList = [NSApp orderedWindows];
   if (!validWindow(window)) {
     return GHOST_kFailure;
   }
diff --git a/intern/mantaflow/intern/MANTA_main.cpp b/intern/mantaflow/intern/MANTA_main.cpp
index 6083c4908a1..282fbdb3f77 100644
--- a/intern/mantaflow/intern/MANTA_main.cpp
+++ b/intern/mantaflow/intern/MANTA_main.cpp
@@ -263,6 +263,8 @@ MANTA::MANTA(int *res, FluidModifierData *fmd)
   }
   /* All requested initializations must not fail in constructor. */
   BLI_assert(initSuccess);
+  (void)initSuccess; /* Ignored in release. */
+
   updatePointers(fmd);
 }
 
diff --git a/intern/mikktspace/mikktspace.c b/intern/mikktspace/mikktspace.c
index fe302eb5e7c..794590d30a4 100644
--- a/intern/mikktspace/mikktspace.c
+++ b/intern/mikktspace/mikktspace.c
@@ -1114,7 +1114,7 @@ static tbool GenerateTSpaces(STSpace psTspace[],
   STSpace *pSubGroupTspace = NULL;
   SSubGroup *pUniSubGroups = NULL;
   int *pTmpMembers = NULL;
-  int iMaxNrFaces = 0, iUniqueTspaces = 0, g = 0, i = 0;
+  int iMaxNrFaces = 0, g = 0, i = 0;
   for (g = 0; g < iNrActiveGroups; g++)
     if (iMaxNrFaces < pGroups[g].iNrFaces)
       iMaxNrFaces = pGroups[g].iNrFaces;
@@ -1136,7 +1136,6 @@ static tbool GenerateTSpaces(STSpace psTspace[],
     return TFALSE;
   }
 
-  iUniqueTspaces = 0;
   for (g = 0; g < iNrActiveGroups; g++) {
     const SGroup *pGroup = &pGroups[g];
     int iUniqueSubGroups = 0, s = 0;
@@ -1211,9 +1210,7 @@ static tbool GenerateTSpaces(STSpace psTspace[],
           ++l;
       }
 
-      // assign tangent space index
       assert(bFound || l == iUniqueSubGroups);
-      // piTempTangIndices[f*3+index] = iUniqueTspaces+l;
 
       // if no match was found we allocate a new subgroup
       if (!bFound) {
@@ -1262,10 +1259,9 @@ static tbool GenerateTSpaces(STSpace psTspace[],
       }
     }
 
-    // clean up and offset iUniqueTspaces
+    // clean up
     for (s = 0; s < iUniqueSubGroups; s++)
       free(pUniSubGroups[s].pTriMembers);
-    iUniqueTspaces += iUniqueSubGroups;
   }
 
   // clean up
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index ce07e501897..d70ab8ed606 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -5244,7 +5244,6 @@ static void dynamic_paint_effect_shrink_cb(void *__restrict userdata,
   PaintPoint *pPoint = &((PaintPoint *)sData->type_data)[index];
   const PaintPoint *prevPoint = data->prevPoint;
   const float eff_scale = data->eff_scale;
-  float totalAlpha = 0.0f;
 
   const int *n_index = sData->adj_data->n_index;
   const int *n_target = sData->adj_data->n_target;
@@ -5257,8 +5256,6 @@ static void dynamic_paint_effect_shrink_cb(void *__restrict userdata,
     const PaintPoint *pPoint_prev = &prevPoint[n_target[n_idx]];
     float a_factor, ea_factor, w_factor;
 
-    totalAlpha += pPoint_prev->e_color[3];
-
     /* Check if neighboring point has lower alpha,
      * if so, decrease this point's alpha as well. */
     if (pPoint->color[3] <= 0.0f && pPoint->e_color[3] <= 0.0f && pPoint->wetness <= 0.0f) {
diff --git a/source/blender/blenkernel/intern/mesh_validate.cc b/source/blender/blenkernel/intern/mesh_validate.cc
index fb526354305..4374659bff8 100644
--- a/source/blender/blenkernel/intern/mesh_validate.cc
+++ b/source/blender/blenkernel/intern/mesh_validate.cc
@@ -1049,41 +1049,40 @@ bool BKE_mesh_validate_all_customdata(CustomData *vdata,
 
 bool BKE_mesh_validate(Mesh *me, const bool do_verbose, const bool cddata_check_mask)
 {
-  bool is_valid = true;
   bool changed;
 
   if (do_verbose) {
     CLOG_INFO(&LOG, 0, "MESH: %s", me->id.name + 2);
   }
 
-  is_valid &= BKE_mesh_validate_all_customdata(&me->vdata,
-                                               me->totvert,
-                                               &me->edata,
-                                               me->totedge,
-                                               &me->ldata,
-                                               me->totloop,
-                                               &me->pdata,
-                                               me->totpoly,
-                                               cddata_check_mask,
-                                               do_verbose,
-                                               true,
-                                               &changed);
-
-  is_valid &= BKE_mesh_validate_arrays(me,
-                                       me->mvert,
-                                       me->totvert,
-                                       me->medge,
-                                       me->totedge,
-                                       me->mface,
-                                       me->totface,
-                                       me->mloop,
-                                       me->totloop,
-                                       me->mpoly,
-                                       me->totpoly,
-                                       me->dvert,
-                                       do_verbose,
-                                       true,
-                                       &changed);
+  BKE_mesh_validate_all_customdata(&me->vdata,
+                                   me->totvert,
+                                   &me->edata,
+                                   me->totedge,
+                                   &me->ldata,
+                                   me->totloop,
+                                   &me->pdata,
+                                   me->totpoly,
+                                   cddata_check_mask,
+                                   do_verbose,
+                                   true,
+                                   &changed);
+
+  BKE_mesh_validate_arrays(me,
+                           me->mvert,
+                           me->totvert,
+                           me->medge,
+                           me->totedge,
+                           me->mface,
+                           me->totface,
+                           me->mloop,
+                           me->totloop,
+                           me->mpoly,
+                           me->totpoly,
+                           me->dvert,
+                           do_verbose,
+                           true,
+                           &changed);
 
   if (changed) {
     DEG_id_tag_update(&me->id, ID_RECALC_GEOMETRY_ALL_MODES);
diff --git a/source/blender/blenkernel/intern/particle_child.c b/source/blender/blenkernel/intern/particle_child.c
index 8106ae8b302..5dba4d3f003 100644
--- a/source/blender/blenkernel/intern/particle_child.c
+++ b/source/blender/blenkernel/intern/particle_child.c
@@ -142,9 +142,6 @@ static void do_kink_spiral(ParticleThreadContext *ctx,
   float kink_freq = part->kink_freq;
   float kink_shape = part->kink_shape;
   float kink_axis_random = part->kink_axis_random;
-  float rough1 = part->rough1;
-  float rough2 = part->rough2;
-  float rough_end = part->rough_end;
 
   ParticlePathIterator iter;
   ParticleCacheKey *key;
@@ -164,9 +161,6 @@ static void do_kink_spiral(ParticleThreadContext *ctx,
   if (ptex) {
     kink_amp *= ptex->kink_amp;
     kink_freq *= ptex->kink_freq;
-    rough1 *= ptex->rough1;
-    rough2 *= ptex->rough2;
-    rough_end *= ptex->roughe;
   }
 
   cut_time = (totkeys - 1) * ptex->length;
diff --git a/source/blender/blenlib/intern/delaunay_2d.cc b/source/blender/blenlib/intern/delaunay_2d.cc
index 4a02072e770..e6164c98402 100644
--- a/source/blender/blenlib/intern/delaunay_2d.cc
+++ b/source/blender/blenlib/intern/delaunay_2d.cc
@@ -2202,7 +2202,6 @@ void add_face_constraints(CDT_state<T> *cdt_state,
 {
   int nv = input.vert.size();
   int nf = input.face.size();
-  int fsta

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list