From 0ae007065d4d8f61843c8c3c6a96d1e5975a9e2c Mon Sep 17 00:00:00 2001 From: Guy Addadi Date: Fri, 20 Jun 2025 19:09:56 +0300 Subject: [PATCH] Fix: C++20 compatibility for modern compilers (GCC 10+) --- CodeExterne/Poisson/include/Ply.h | 8 +-- CodeExterne/Poisson/include/SparseMatrix.inl | 2 +- include/general/garb_coll_pub.h | 4 +- include/general/ptxd.h | 68 ++++++++++---------- include/private/flux_pts_tpl.h | 2 +- src/TpMMPD/BufferImage_code.h | 8 +-- src/op_buf/opb_general.cpp | 2 +- 7 files changed, 47 insertions(+), 47 deletions(-) diff --git a/CodeExterne/Poisson/include/Ply.h b/CodeExterne/Poisson/include/Ply.h index be5760a2e7..1cf47c3367 100755 --- a/CodeExterne/Poisson/include/Ply.h +++ b/CodeExterne/Poisson/include/Ply.h @@ -301,7 +301,7 @@ class PlyValueVertex PlyValueVertex( void ) : value( Real(0) ) { ; } PlyValueVertex( Point3D< Real > p , Real v ) : point(p) , value(v) { ; } PlyValueVertex operator + ( PlyValueVertex p ) const { return PlyValueVertex( point+p.point , value+p.value ); } - PlyValueVertex operator - ( PlyValueVertex p ) const { return PlyValueVertex( point-p.value , value-p.value ); } + PlyValueVertex operator - ( PlyValueVertex p ) const { return PlyValueVertex( point-p.point , value-p.value ); } template< class _Real > PlyValueVertex operator * ( _Real s ) const { return PlyValueVertex( point*s , Real(value*s) ); } template< class _Real > PlyValueVertex operator / ( _Real s ) const { return PlyValueVertex( point/s , Real(value/s) ); } PlyValueVertex& operator += ( PlyValueVertex p ) { point += p.point , value += p.value ; return *this; } @@ -340,7 +340,7 @@ class PlyOrientedVertex PlyOrientedVertex( void ) { ; } PlyOrientedVertex( Point3D< Real > p , Point3D< Real > n ) : point(p) , normal(n) { ; } PlyOrientedVertex operator + ( PlyOrientedVertex p ) const { return PlyOrientedVertex( point+p.point , normal+p.normal ); } - PlyOrientedVertex operator - ( PlyOrientedVertex p ) const { return PlyOrientedVertex( point-p.value , normal-p.normal ); } + PlyOrientedVertex operator - ( PlyOrientedVertex p ) const { return PlyOrientedVertex( point-p.point , normal-p.normal ); } template< class _Real > PlyOrientedVertex operator * ( _Real s ) const { return PlyOrientedVertex( point*s , normal*s ); } template< class _Real > PlyOrientedVertex operator / ( _Real s ) const { return PlyOrientedVertex( point/s , normal/s ); } PlyOrientedVertex& operator += ( PlyOrientedVertex p ) { point += p.point , normal += p.normal ; return *this; } @@ -386,7 +386,7 @@ class PlyColorVertex } _PlyColorVertex operator + ( _PlyColorVertex p ) const { return _PlyColorVertex( point+p.point , color+p.color ); } - _PlyColorVertex operator - ( _PlyColorVertex p ) const { return _PlyColorVertex( point-p.value , color-p.color ); } + _PlyColorVertex operator - ( _PlyColorVertex p ) const { return _PlyColorVertex( point-p.point , color-p.color ); } template< class _Real > _PlyColorVertex operator * ( _Real s ) const { return _PlyColorVertex( point*s , color*s ); } template< class _Real > _PlyColorVertex operator / ( _Real s ) const { return _PlyColorVertex( point/s , color/s ); } _PlyColorVertex& operator += ( _PlyColorVertex p ) { point += p.point , color += p.color ; return *this; } @@ -455,7 +455,7 @@ class PlyColorAndValueVertex } _PlyColorAndValueVertex operator + ( _PlyColorAndValueVertex p ) const { return _PlyColorAndValueVertex( point+p.point , color+p.color , value+p.value ); } - _PlyColorAndValueVertex operator - ( _PlyColorAndValueVertex p ) const { return _PlyColorAndValueVertex( point-p.value , color-p.color , value+p.value ); } + _PlyColorAndValueVertex operator - ( _PlyColorAndValueVertex p ) const { return _PlyColorAndValueVertex( point-p.point , color-p.color , value+p.value ); } template< class _Real > _PlyColorAndValueVertex operator * ( _Real s ) const { return _PlyColorAndValueVertex( point*s , color*s , value*s ); } template< class _Real > _PlyColorAndValueVertex operator / ( _Real s ) const { return _PlyColorAndValueVertex( point/s , color/s , value/s ); } _PlyColorAndValueVertex& operator += ( _PlyColorAndValueVertex p ) { point += p.point , color += p.color , value += p.value ; return *this; } diff --git a/CodeExterne/Poisson/include/SparseMatrix.inl b/CodeExterne/Poisson/include/SparseMatrix.inl index 9bdde69247..eafe97160d 100755 --- a/CodeExterne/Poisson/include/SparseMatrix.inl +++ b/CodeExterne/Poisson/include/SparseMatrix.inl @@ -195,7 +195,7 @@ void SparseMatrix< T >::SetRowSize( int row , int count ) template void SparseMatrix::SetZero() { - Resize(this->m_N, this->m_M); + Resize(this->rows, this->_maxEntriesPerRow); } template diff --git a/include/general/garb_coll_pub.h b/include/general/garb_coll_pub.h index c77308c69c..051097ecd2 100755 --- a/include/general/garb_coll_pub.h +++ b/include/general/garb_coll_pub.h @@ -56,7 +56,7 @@ template class ElList : public PRC0 { public : - ElList(); + ElList(); Type car() const; // Fatal error when empty ElList cdr() const; // Fatal error when empty @@ -71,7 +71,7 @@ template class ElList : public PRC0 INT card() const; void clear() {while(!empty()) pop();} - ElList(RC_Object*); + ElList(RC_Object*); }; template class liste_phys : public RC_Object diff --git a/include/general/ptxd.h b/include/general/ptxd.h index c9ade41e59..4b52c43c02 100755 --- a/include/general/ptxd.h +++ b/include/general/ptxd.h @@ -189,30 +189,30 @@ template class Pt2d : public ElStdTypeScal // Constructeur - Pt2d() : x (0), y (0) {} - Pt2d(Type X,Type Y) : x (X), y (Y) {} + Pt2d() : x (0), y (0) {} + Pt2d(Type X,Type Y) : x (X), y (Y) {} - Pt2d(const Pt2d& p) : x (p.x), y (p.y) {} - explicit Pt2d(const Pt2d& p) : + Pt2d(const Pt2d& p) : x (p.x), y (p.y) {} + explicit Pt2d(const Pt2d& p) : x( TCompl::FromC( p.x)), y( TCompl::FromC( p.y)) { } - static Pt2d IP2ToThisT(const Pt2d & aP){return Pt2d(Type(aP.x),Type(aP.y));} - static Pt2d RP2ToThisT(const Pt2d & aP){return Pt2d(Type(aP.x),Type(aP.y));} - static Pt2d FP2ToThisT(const Pt2d & aP){return Pt2d(Type(aP.x),Type(aP.y));} + static Pt2d IP2ToThisT(const Pt2d & aP){return Pt2d(Type(aP.x),Type(aP.y));} + static Pt2d RP2ToThisT(const Pt2d & aP){return Pt2d(Type(aP.x),Type(aP.y));} + static Pt2d FP2ToThisT(const Pt2d & aP){return Pt2d(Type(aP.x),Type(aP.y));} /* - Pt2d(const Pt2d& p) : x (p.x), y (p.y) {}; - Pt2d(const Pt2d& p): x (Pt2d::RtoT(p.x)), y (Pt2d::RtoT(p.y)) {}; + Pt2d(const Pt2d& p) : x (p.x), y (p.y) {}; + Pt2d(const Pt2d& p): x (Pt2d::RtoT(p.x)), y (Pt2d::RtoT(p.y)) {}; */ static Pt2d FromPolar(REAL rho,REAL teta) { - return Pt2d(ElStdTypeScal::RtoT(cos(teta)*rho),ElStdTypeScal::RtoT(sin(teta)*rho)); + return Pt2d(ElStdTypeScal::RtoT(cos(teta)*rho),ElStdTypeScal::RtoT(sin(teta)*rho)); } static Pt2d polar(const Pt2d & p,REAL AngDef); @@ -226,7 +226,7 @@ template class Pt2d : public ElStdTypeScal return TypeProvPtScalR (this->T2R(x),this->T2R(y)); } - Pt2d operator - () const { return Pt2d(-x,-y); } + Pt2d operator - () const { return Pt2d(-x,-y); } Pt2d yx() const { return Pt2d(y,x);} Pt2d conj() const { return Pt2d(x,-y);} Pt2d::TypeScalReel> inv() const @@ -241,19 +241,19 @@ template class Pt2d : public ElStdTypeScal // binaires, PtxPt => Pt Pt2d operator + (const Pt2d & p2) const - {return Pt2d(x+p2.x,y+p2.y);} + {return Pt2d(x+p2.x,y+p2.y);} Pt2d operator * (const Pt2d & p2) const - {return Pt2d(x*p2.x-y*p2.y,x*p2.y+y*p2.x);} + {return Pt2d(x*p2.x-y*p2.y,x*p2.y+y*p2.x);} // TCompl Pt2d operator / (const Pt2d & p2) const { TypeProvPtScalR aRes = this->ToPtProvR() * p2.inv().ToPtProvR(); - return Pt2d ((Type)aRes.x,(Type)aRes.y); + return Pt2d((Type)aRes.x,(Type)aRes.y); } Pt2d operator - (const Pt2d & p2) const - {return Pt2d(x-p2.x,y-p2.y);} + {return Pt2d(x-p2.x,y-p2.y);} Pt2d mcbyc(const Pt2d & p2) const {return Pt2d(x*p2.x,y*p2.y);} Pt2d dcbyc(const Pt2d & p2) const @@ -291,18 +291,18 @@ template class Pt2d : public ElStdTypeScal // binaires, PtxScalaire => Pt - Pt2d operator * (INT lambda) const { return Pt2d(x*lambda,y*lambda);} + Pt2d operator * (INT lambda) const { return Pt2d(x*lambda,y*lambda);} Pt2d::TypeScalReel> operator * (REAL lambda) const { return Pt2d::TypeScalReel>(x*lambda,y*lambda);} - Pt2d operator / (INT lambda) const { return Pt2d(x/lambda,y/lambda);} + Pt2d operator / (INT lambda) const { return Pt2d(x/lambda,y/lambda);} Pt2d::TypeScalReel> operator / (REAL lambda) const { return Pt2d::TypeScalReel>(x/lambda,y/lambda);} // operator * est deja surcharge - Pt2d mul (const Type & aL) const { return Pt2d(x*aL,y*aL);} - Pt2d div (const Type & aL) const { return Pt2d(x/aL,y/aL);} + Pt2d mul (const Type & aL) const { return Pt2d(x*aL,y*aL);} + Pt2d div (const Type & aL) const { return Pt2d(x/aL,y/aL);} // binaires, PtxPt => scalaire @@ -340,7 +340,7 @@ template class Pt2d : public ElStdTypeScal Output WhichMax(); Output WhichMin(); - Pt2d AbsP() const {return Pt2d(ElAbs(x),ElAbs(y));} + Pt2d AbsP() const {return Pt2d(ElAbs(x),ElAbs(y));} private : void Verif_adr_xy(); @@ -388,8 +388,8 @@ template <> Pt2d::Pt2d(const Pt2d& p) : x (round_ni(p.x)), y (round template <> Pt2d::Pt2d(const Pt2d& p) : x (p.x), y (p.y) {}; */ /* - Pt2d(const Pt2d& p) : x (p.x), y (p.y) {}; - Pt2d(const Pt2d& p): x (Pt2d::RtoT(p.x)), y (Pt2d::RtoT(p.y)) {}; + Pt2d(const Pt2d& p) : x (p.x), y (p.y) {}; + Pt2d(const Pt2d& p): x (Pt2d::RtoT(p.x)), y (Pt2d::RtoT(p.y)) {}; */ //Rotate aPt(X,Y) with angle(rad) and center(X,Y) @@ -846,23 +846,23 @@ template class Pt3d : public ElStdTypeScal Pt3d(); - Pt3d(const Pt3d& ); // to please visual - explicit Pt3d(const Pt3d& p); + Pt3d(const Pt3d& ); // to please visual + explicit Pt3d(const Pt3d& p); - static Pt3d P3ToThisT(const Pt3d & aP){return Pt3d(Type(aP.x),Type(aP.y),Type(aP.z));} - static Pt3d P3ToThisT(const Pt3d & aP){return Pt3d(Type(aP.x),Type(aP.y),Type(aP.z));} - static Pt3d P3ToThisT(const Pt3d & aP){return Pt3d(Type(aP.x),Type(aP.y),Type(aP.z));} + static Pt3d P3ToThisT(const Pt3d & aP){return Pt3d(Type(aP.x),Type(aP.y),Type(aP.z));} + static Pt3d P3ToThisT(const Pt3d & aP){return Pt3d(Type(aP.x),Type(aP.y),Type(aP.z));} + static Pt3d P3ToThisT(const Pt3d & aP){return Pt3d(Type(aP.x),Type(aP.y),Type(aP.z));} - Pt3d(const Pt2d&,Type z); // to please visual + Pt3d(const Pt2d&,Type z); // to please visual Pt3d mcbyc(const Pt3d & p2) const {return Pt3d(x*p2.x,y*p2.y,z*p2.z);} Pt3d dcbyc(const Pt3d & p2) const {return Pt3d(x/p2.x,y/p2.y,z/p2.z);} - static Pt3d RandC() {return Pt3d(NRrandC(),NRrandC(),NRrandC());} - static Pt3d Rand3() {return Pt3d(NRrandom3(),NRrandom3(),NRrandom3());} + static Pt3d RandC() {return Pt3d(NRrandC(),NRrandC(),NRrandC());} + static Pt3d Rand3() {return Pt3d(NRrandom3(),NRrandom3(),NRrandom3());} Pt3d(Type X,Type Y,Type Z); Pt3d operator + (const Pt3d & p2) const; @@ -897,12 +897,12 @@ template class Pt3d : public ElStdTypeScal std::vector ToTab() const; static Pt3d FromTab(const std::vector &); - Pt3d AbsP() const {return Pt3d(ElAbs(x),ElAbs(y),ElAbs(z));} + Pt3d AbsP() const {return Pt3d(ElAbs(x),ElAbs(y),ElAbs(z));} /* friend Pt3d Sup (const Pt3d & p1,const Pt3d & p2) - { return Pt3d(ElMax(p1.x,p2.x),ElMax(p1.y,p2.y),ElMax(p1.z,p2.z));} + { return Pt3d(ElMax(p1.x,p2.x),ElMax(p1.y,p2.y),ElMax(p1.z,p2.z));} friend Pt3d Inf (const Pt3d & p1,const Pt3d & p2) - { return Pt3d(ElMin(p1.x,p2.x),ElMin(p1.y,p2.y),ElMin(p1.z,p2.z));} + { return Pt3d(ElMin(p1.x,p2.x),ElMin(p1.y,p2.y),ElMin(p1.z,p2.z));} */ Output sigma(); Output VMax(); @@ -1008,7 +1008,7 @@ template void corner_boxes ( Pt3d p1, Pt3d p2, - Pt3d (& t)[8] + Pt3d(& t)[8] ); template void pt_set_min_max(Pt3d & p0,Pt3d & p1); diff --git a/include/private/flux_pts_tpl.h b/include/private/flux_pts_tpl.h index c295f4901c..9d2ad05788 100755 --- a/include/private/flux_pts_tpl.h +++ b/include/private/flux_pts_tpl.h @@ -125,7 +125,7 @@ template class Std_Pack_Of_Pts : public Std_Pack_Of_Pts_Gen virtual void rgb_bgr(const Std_Pack_Of_Pts_Gen *); private : - Std_Pack_Of_Pts (INT dim,INT sz_buf); + Std_Pack_Of_Pts (INT dim,INT sz_buf); // _pts[d][i] == coordinate of the ith Pts in the dth dimension Tab_Prov *> * _tprov_tprov; diff --git a/src/TpMMPD/BufferImage_code.h b/src/TpMMPD/BufferImage_code.h index 0e37f7f612..93b027ee61 100755 --- a/src/TpMMPD/BufferImage_code.h +++ b/src/TpMMPD/BufferImage_code.h @@ -349,7 +349,7 @@ BufferImage& BufferImage::operator += (BufferImage const &img) int NC = _size.first; int NL = _size.second; int NC2,NL2; - //img.Size(NC2,NL2); + //img.size(NC2,NL2); NC2 = img.numCols(); NL2 = img.numLines(); int nbBands2 = img.numBands(); @@ -393,7 +393,7 @@ BufferImage& BufferImage::operator -= (BufferImage const &img) int NC = _size.first; int NL = _size.second; int NC2,NL2; - img.Size(NC2,NL2); + img.size(NC2,NL2); int nbBands2 = img.numBands(); T* ptrLine = _data; const T* ptrLine2 = img.getPtr(); @@ -434,7 +434,7 @@ BufferImage& BufferImage::operator *= (BufferImage const &img) int NC = _size.first; int NL = _size.second; int NC2,NL2; - img.Size(NC2,NL2); + img.size(NC2,NL2); int nbBands2 = img.numBands(); T* ptrLine = _data; const T* ptrLine2 = img.getPtr(); @@ -476,7 +476,7 @@ BufferImage& BufferImage::operator /= (BufferImage const &img) int NC = _size.first; int NL = _size.second; int NC2,NL2; - //img.Size(NC2,NL2); + //img.size(NC2,NL2); NC2 = img.numCols(); NL2 = img.numLines(); int nbBands2 = img.numBands(); diff --git a/src/op_buf/opb_general.cpp b/src/op_buf/opb_general.cpp index 75b1e9d27a..d6d755ece6 100755 --- a/src/op_buf/opb_general.cpp +++ b/src/op_buf/opb_general.cpp @@ -212,7 +212,7 @@ template class Buf_Fonc_OB_TPL : public Buf_Fonc_Op_buf { public : - Buf_Fonc_OB_TPL + Buf_Fonc_OB_TPL ( Flux_Pts_Computed * flx, Fonc_Num_Computed *,