From fc07a4d45ec980e4a9ba966b4060e605467dab9e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 17 Jul 2025 12:30:39 +1000 Subject: [PATCH] Cleanup: quiet ignored qualifier & unused warnings --- intern/itasc/ControlledObject.hpp | 4 +- intern/itasc/Object.hpp | 4 +- intern/itasc/UncontrolledObject.hpp | 4 +- .../intern/scene_graph/FrsMaterial.h | 44 +++++++++---------- .../blender/freestyle/intern/stroke/Stroke.h | 10 ++--- .../freestyle/intern/view_map/Silhouette.h | 2 +- .../freestyle/intern/view_map/ViewMap.h | 2 +- .../geometry/intern/mesh_boolean_manifold.cc | 2 +- .../modifiers/intern/MOD_meshsequencecache.cc | 2 + .../python/bmesh/bmesh_py_types_customdata.cc | 14 ------ .../intern/cache/final_image_cache.cc | 2 +- 11 files changed, 39 insertions(+), 51 deletions(-) diff --git a/intern/itasc/ControlledObject.hpp b/intern/itasc/ControlledObject.hpp index 098a56af320..f01b317bce8 100644 --- a/intern/itasc/ControlledObject.hpp +++ b/intern/itasc/ControlledObject.hpp @@ -62,8 +62,8 @@ public: virtual const e_vector& getWy() const {return m_Wy;}; - virtual const unsigned int getNrOfCoordinates(){return m_nq;}; - virtual const unsigned int getNrOfConstraints(){return m_nc;}; + virtual unsigned int getNrOfCoordinates(){return m_nq;}; + virtual unsigned int getNrOfConstraints(){return m_nc;}; }; } diff --git a/intern/itasc/Object.hpp b/intern/itasc/Object.hpp index e54a6c95f11..26108765de3 100644 --- a/intern/itasc/Object.hpp +++ b/intern/itasc/Object.hpp @@ -39,8 +39,8 @@ public: (void)end_effector; return m_internalPose; }; - virtual const ObjectType getType(){return m_type;}; - virtual const unsigned int getNrOfCoordinates(){return 0;}; + virtual ObjectType getType(){return m_type;}; + virtual unsigned int getNrOfCoordinates(){return 0;}; virtual void updateKinematics(const Timestamp& /*timestamp*/)=0; virtual void pushCache(const Timestamp& /*timestamp*/)=0; virtual void initCache(Cache * /*cache*/) = 0; diff --git a/intern/itasc/UncontrolledObject.hpp b/intern/itasc/UncontrolledObject.hpp index d08c391e34e..649c3040d2c 100644 --- a/intern/itasc/UncontrolledObject.hpp +++ b/intern/itasc/UncontrolledObject.hpp @@ -28,8 +28,8 @@ public: virtual const e_matrix& getJu(unsigned int frameIndex) const; virtual const e_vector& getXudot() const {return m_xudot;} virtual void updateCoordinates(const Timestamp& timestamp)=0; - virtual const unsigned int getNrOfCoordinates(){return m_nu;}; - virtual const unsigned int getNrOfFrames(){return m_nf;}; + virtual unsigned int getNrOfCoordinates(){return m_nu;}; + virtual unsigned int getNrOfFrames(){return m_nf;}; }; diff --git a/source/blender/freestyle/intern/scene_graph/FrsMaterial.h b/source/blender/freestyle/intern/scene_graph/FrsMaterial.h index e7d9052598d..b6918eacb01 100644 --- a/source/blender/freestyle/intern/scene_graph/FrsMaterial.h +++ b/source/blender/freestyle/intern/scene_graph/FrsMaterial.h @@ -59,25 +59,25 @@ class FrsMaterial { } /** Returns the red component of the line color */ - inline const float lineR() const + inline float lineR() const { return Line[0]; } /** Returns the green component of the line color */ - inline const float lineG() const + inline float lineG() const { return Line[1]; } /** Returns the blue component of the line color */ - inline const float lineB() const + inline float lineB() const { return Line[2]; } /** Returns the alpha component of the line color */ - inline const float lineA() const + inline float lineA() const { return Line[3]; } @@ -89,25 +89,25 @@ class FrsMaterial { } /** Returns the red component of the diffuse color */ - inline const float diffuseR() const + inline float diffuseR() const { return Diffuse[0]; } /** Returns the green component of the diffuse color */ - inline const float diffuseG() const + inline float diffuseG() const { return Diffuse[1]; } /** Returns the blue component of the diffuse color */ - inline const float diffuseB() const + inline float diffuseB() const { return Diffuse[2]; } /** Returns the alpha component of the diffuse color */ - inline const float diffuseA() const + inline float diffuseA() const { return Diffuse[3]; } @@ -119,25 +119,25 @@ class FrsMaterial { } /** Returns the red component of the specular color */ - inline const float specularR() const + inline float specularR() const { return Specular[0]; } /** Returns the green component of the specular color */ - inline const float specularG() const + inline float specularG() const { return Specular[1]; } /** Returns the blue component of the specular color */ - inline const float specularB() const + inline float specularB() const { return Specular[2]; } /** Returns the alpha component of the specular color */ - inline const float specularA() const + inline float specularA() const { return Specular[3]; } @@ -149,25 +149,25 @@ class FrsMaterial { } /** Returns the red component of the ambient color */ - inline const float ambientR() const + inline float ambientR() const { return Ambient[0]; } /** Returns the green component of the ambient color */ - inline const float ambientG() const + inline float ambientG() const { return Ambient[1]; } /** Returns the blue component of the ambient color */ - inline const float ambientB() const + inline float ambientB() const { return Ambient[2]; } /** Returns the alpha component of the ambient color */ - inline const float ambientA() const + inline float ambientA() const { return Ambient[3]; } @@ -179,37 +179,37 @@ class FrsMaterial { } /** Returns the red component of the emissive color */ - inline const float emissionR() const + inline float emissionR() const { return Emission[0]; } /** Returns the green component of the emissive color */ - inline const float emissionG() const + inline float emissionG() const { return Emission[1]; } /** Returns the blue component of the emissive color */ - inline const float emissionB() const + inline float emissionB() const { return Emission[2]; } /** Returns the alpha component of the emissive color */ - inline const float emissionA() const + inline float emissionA() const { return Emission[3]; } /** Returns the shininess coefficient */ - inline const float shininess() const + inline float shininess() const { return Shininess; } /** Returns the line color priority */ - inline const int priority() const + inline int priority() const { return Priority; } diff --git a/source/blender/freestyle/intern/stroke/Stroke.h b/source/blender/freestyle/intern/stroke/Stroke.h index 74459a3163b..570cc9adbc8 100644 --- a/source/blender/freestyle/intern/stroke/Stroke.h +++ b/source/blender/freestyle/intern/stroke/Stroke.h @@ -98,19 +98,19 @@ class StrokeAttribute { } /** Returns the R color component. */ - inline const float getColorR() const + inline float getColorR() const { return _color[0]; } /** Returns the G color component. */ - inline const float getColorG() const + inline float getColorG() const { return _color[1]; } /** Returns the B color component. */ - inline const float getColorB() const + inline float getColorB() const { return _color[2]; } @@ -137,13 +137,13 @@ class StrokeAttribute { } /** Returns the thickness on the right of the vertex when following the stroke. */ - inline const float getThicknessR() const + inline float getThicknessR() const { return _thickness[0]; } /** Returns the thickness on the left of the vertex when following the stroke. */ - inline const float getThicknessL() const + inline float getThicknessL() const { return _thickness[1]; } diff --git a/source/blender/freestyle/intern/view_map/Silhouette.h b/source/blender/freestyle/intern/view_map/Silhouette.h index 17853a95f28..d06d33b3d9b 100644 --- a/source/blender/freestyle/intern/view_map/Silhouette.h +++ b/source/blender/freestyle/intern/view_map/Silhouette.h @@ -865,7 +865,7 @@ class FEdge : public Interface1D { const SShape *shape() const; float shape_importance() const; - inline const int qi() const + inline int qi() const { return invisibility(); } diff --git a/source/blender/freestyle/intern/view_map/ViewMap.h b/source/blender/freestyle/intern/view_map/ViewMap.h index b409f538377..f46e90a024f 100644 --- a/source/blender/freestyle/intern/view_map/ViewMap.h +++ b/source/blender/freestyle/intern/view_map/ViewMap.h @@ -1301,7 +1301,7 @@ class ViewEdge : public Interface1D { inline const SShape *occluded_shape() const; - inline const bool occludee_empty() const + inline bool occludee_empty() const { if (_aShape == 0) { return true; diff --git a/source/blender/geometry/intern/mesh_boolean_manifold.cc b/source/blender/geometry/intern/mesh_boolean_manifold.cc index 6628ed2c138..7f34eee66da 100644 --- a/source/blender/geometry/intern/mesh_boolean_manifold.cc +++ b/source/blender/geometry/intern/mesh_boolean_manifold.cc @@ -1213,7 +1213,7 @@ static void merge_out_faces(Vector &faces) } /** Return true if the ponts p0, p1, p2 are approximately in a straight line. */ -static inline const bool approx_in_line(const float3 &p0, const float3 &p1, const float3 &p2) +static inline bool approx_in_line(const float3 &p0, const float3 &p1, const float3 &p2) { float cos_ang = math::dot(math::normalize(p1 - p0), math::normalize(p2 - p1)); return math::abs(cos_ang - 1.0) < 1e-4; diff --git a/source/blender/modifiers/intern/MOD_meshsequencecache.cc b/source/blender/modifiers/intern/MOD_meshsequencecache.cc index b1012c8932a..03091c43f47 100644 --- a/source/blender/modifiers/intern/MOD_meshsequencecache.cc +++ b/source/blender/modifiers/intern/MOD_meshsequencecache.cc @@ -136,6 +136,8 @@ static bool can_use_mesh_for_orco_evaluation(MeshSeqCacheModifierData *mcmd, { return true; } +# else + UNUSED_VARS(frame_offset); # endif break; case CACHE_FILE_TYPE_INVALID: diff --git a/source/blender/python/bmesh/bmesh_py_types_customdata.cc b/source/blender/python/bmesh/bmesh_py_types_customdata.cc index 58c0b975fd6..c9a10a1a736 100644 --- a/source/blender/python/bmesh/bmesh_py_types_customdata.cc +++ b/source/blender/python/bmesh/bmesh_py_types_customdata.cc @@ -140,20 +140,6 @@ PyDoc_STRVAR( "Accessor for skin layer.\n" "\n" ":type: :class:`BMLayerCollection` of :class:`bmesh.types.BMVertSkin`"); -#ifdef WITH_FREESTYLE -PyDoc_STRVAR( - /* Wrap. */ - bpy_bmlayeraccess_collection__freestyle_edge_doc, - "Accessor for Freestyle edge layer.\n" - "\n" - ":type: :class:`BMLayerCollection`"); -PyDoc_STRVAR( - /* Wrap. */ - bpy_bmlayeraccess_collection__freestyle_face_doc, - "Accessor for Freestyle face layer.\n" - "\n" - ":type: :class:`BMLayerCollection`"); -#endif static PyObject *bpy_bmlayeraccess_collection_get(BPy_BMLayerAccess *self, void *flag) { diff --git a/source/blender/sequencer/intern/cache/final_image_cache.cc b/source/blender/sequencer/intern/cache/final_image_cache.cc index 4aef559a359..9f872263b98 100644 --- a/source/blender/sequencer/intern/cache/final_image_cache.cc +++ b/source/blender/sequencer/intern/cache/final_image_cache.cc @@ -33,7 +33,7 @@ struct FinalImageCache { int view_id; int display_channel; - const uint64_t hash() const + uint64_t hash() const { return get_default_hash(seqbasep, timeline_frame, view_id, display_channel); }