Compatibility with clang-19
authorMarkus Vieth <mvieth@techfak.uni-bielefeld.de>
Thu, 22 Aug 2024 18:48:19 +0000 (20:48 +0200)
committerJochen Sprickerhof <jspricke@debian.org>
Tue, 14 Jan 2025 13:16:25 +0000 (14:16 +0100)
Gbp-Pq: Name 0005-Compatibility-with-clang-19.patch

registration/include/pcl/registration/correspondence_rejection_features.h
surface/include/pcl/surface/3rdparty/poisson4/octree_poisson.hpp
surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp

index 44835c379fce0d4cd3c45f9886d7f4898b7b8d88..f3bab8fef014743590ff45b60951b2dc3c131286 100644 (file)
@@ -269,9 +269,9 @@ protected:
       // Check if the representations are valid
       if (!feature_representation_->isValid(feat_src) ||
           !feature_representation_->isValid(feat_tgt)) {
-        PCL_ERROR("[pcl::registration::%s::getCorrespondenceScore] Invalid feature "
-                  "representation given!\n",
-                  this->getClassName().c_str());
+        PCL_ERROR(
+            "[pcl::registration::CorrespondenceRejectorFeatures::FeatureContainer::"
+            "getCorrespondenceScore] Invalid feature representation given!\n");
         return (std::numeric_limits<double>::max());
       }
 
index 7ed8aaf9d828ebb167ebff2194e69690c06068a6..e7f45b650e99d89eaf412292569ca0f65c3d8487 100644 (file)
@@ -746,7 +746,10 @@ namespace pcl
       Real temp,dist2;
       if(!children){return this;}
       for(int i=0;i<Cube::CORNERS;i++){
-        temp=SquareDistance(children[i].center,p);
+        Point3D<Real> child_center;
+        Real child_width;
+        children[i].centerAndWidth(child_center, child_width);
+        temp=SquareDistance(child_center,p);
         if(!i || temp<dist2){
           dist2=temp;
           nearest=i;
@@ -807,7 +810,7 @@ namespace pcl
       children=NULL;
 
       d=node.depth ();
-      for(i=0;i<DIMENSION;i++){this->offset[i] = node.offset[i];}
+      for(i=0;i<DIMENSION;i++){this->off[i] = node.off[i];}
       if(node.children){
         initChildren();
         for(i=0;i<Cube::CORNERS;i++){children[i] = node.children[i];}
@@ -817,7 +820,7 @@ namespace pcl
 
     template <class NodeData,class Real>
     int OctNode<NodeData,Real>::CompareForwardDepths(const void* v1,const void* v2){
-      return ((const OctNode<NodeData,Real>*)v1)->depth-((const OctNode<NodeData,Real>*)v2)->depth;
+      return ((const OctNode<NodeData,Real>*)v1)->depth()-((const OctNode<NodeData,Real>*)v2)->depth();
     }
 
     template< class NodeData , class Real >
@@ -874,7 +877,7 @@ namespace pcl
 
     template <class NodeData,class Real>
     int OctNode<NodeData,Real>::CompareBackwardDepths(const void* v1,const void* v2){
-      return ((const OctNode<NodeData,Real>*)v2)->depth-((const OctNode<NodeData,Real>*)v1)->depth;
+      return ((const OctNode<NodeData,Real>*)v2)->depth()-((const OctNode<NodeData,Real>*)v1)->depth();
     }
 
     template <class NodeData,class Real>
index 24f0a5402c5210a4751a8892f85892905825546c..5e54ac7862df4f1de8f99df0749b25349b08671e 100644 (file)
@@ -228,14 +228,18 @@ namespace pcl
     template<class T>
     void SparseMatrix<T>::SetZero()
     {
-      Resize(this->m_N, this->m_M);
+      // copied from operator *=
+      for (int i=0; i<rows; i++)
+      {
+        for(int ii=0;ii<rowSizes[i];ii++){m_ppElements[i][ii].Value=T(0);}
+      }
     }
 
     template<class T>
     void SparseMatrix<T>::SetIdentity()
     {
       SetZero();
-      for(int ij=0; ij < Min( this->Rows(), this->Columns() ); ij++)
+      for(int ij=0; ij < std::min<int>( rows, _maxEntriesPerRow ); ij++)
         (*this)(ij,ij) = T(1);
     }
 
@@ -388,7 +392,7 @@ namespace pcl
       T alpha,beta,rDotR;
       int i;
 
-      solution.Resize(M.Columns());
+      solution.Resize(bb.Dimensions());
       solution.SetZero();
 
       d=r=bb;