Merge branch 'const-fix' into 'devel'

Fix 'static assertion failed: comparison object must be invocable as const'

See merge request vlsi-eda/coriolis!9
This commit is contained in:
Jean-Paul Chaput 2021-10-31 11:20:20 +00:00
commit 53f019d165
14 changed files with 33 additions and 33 deletions

View File

@ -48,11 +48,11 @@ namespace {
class SortAcByXY {
public:
inline bool operator() ( AutoContactTerminal* contact1, AutoContactTerminal* contact2 );
inline bool operator() ( AutoContactTerminal* contact1, AutoContactTerminal* contact2 ) const;
};
inline bool SortAcByXY::operator() ( AutoContactTerminal* contact1, AutoContactTerminal* contact2 )
inline bool SortAcByXY::operator() ( AutoContactTerminal* contact1, AutoContactTerminal* contact2 ) const
{
DbU::Unit x1 = contact1->getX();
DbU::Unit x2 = contact2->getX();

View File

@ -50,7 +50,7 @@ namespace {
class CompareByLength {
public:
inline bool operator() ( const Segment* lhs, const Segment* rhs )
inline bool operator() ( const Segment* lhs, const Segment* rhs ) const
{
DbU::Unit delta = lhs->getLength() - rhs->getLength();
if (delta < 0) return false;
@ -61,7 +61,7 @@ namespace {
class CompareBySegmentBox {
public:
inline bool operator() ( const Box& lhs, const Box& rhs )
inline bool operator() ( const Box& lhs, const Box& rhs ) const
{
bool lhsH = (lhs.getWidth() >= lhs.getHeight());
bool rhsH = (rhs.getWidth() >= rhs.getHeight());

View File

@ -1359,7 +1359,7 @@ namespace Anabatic {
PriorityQueue* PriorityQueue::CompareByDistance::_pqueue = NULL;
bool PriorityQueue::CompareByDistance::operator() ( const Vertex* lhs, const Vertex* rhs )
bool PriorityQueue::CompareByDistance::operator() ( const Vertex* lhs, const Vertex* rhs ) const
{
if (lhs->getDistance() == rhs->getDistance()) {
if (_pqueue and _pqueue->hasAttractor()) {

View File

@ -55,7 +55,7 @@ namespace {
private:
class AxisCompare {
public:
bool operator() ( const Axis* lhs, const Axis* rhs );
bool operator() ( const Axis* lhs, const Axis* rhs ) const;
};
class AxisMatch : public unary_function<Axis*,bool> {
@ -155,7 +155,7 @@ namespace {
}
inline bool UsedFragments::AxisCompare::operator() ( const Axis* lhs, const Axis* rhs )
inline bool UsedFragments::AxisCompare::operator() ( const Axis* lhs, const Axis* rhs ) const
{
if (lhs->getAxis () < rhs->getAxis ()) return true;
return false;
@ -259,7 +259,7 @@ namespace Anabatic {
{ }
bool GCell::CompareByDensity::operator() ( GCell* lhs, GCell* rhs )
bool GCell::CompareByDensity::operator() ( GCell* lhs, GCell* rhs ) const
{
float difference = lhs->getDensity(_depth) - rhs->getDensity(_depth);
if (difference != 0.0) return (difference > 0.0);

View File

@ -439,7 +439,7 @@ namespace Anabatic {
class CompareByDistance {
public:
inline CompareByDistance ();
bool operator() ( const Vertex* lhs, const Vertex* rhs );
bool operator() ( const Vertex* lhs, const Vertex* rhs ) const;
static inline void setQueue ( PriorityQueue* );
private:
static PriorityQueue* _pqueue;

View File

@ -103,13 +103,13 @@ namespace Anabatic {
class CompareByDensity : public binary_function<GCell*,GCell*,bool> {
public:
CompareByDensity ( size_t depth );
inline bool operator() ( GCell* lhs, GCell* rhs );
inline bool operator() ( GCell* lhs, GCell* rhs ) const;
private:
size_t _depth;
};
class CompareByKey : public binary_function<const GCell*,const GCell*,bool> {
public:
inline bool operator() ( const GCell* lhs, const GCell* rhs );
inline bool operator() ( const GCell* lhs, const GCell* rhs ) const;
};
public:
class Key {
@ -125,7 +125,7 @@ namespace Anabatic {
public:
class Compare {
public:
inline bool operator() ( const Key*, const Key* );
inline bool operator() ( const Key*, const Key* ) const;
};
private:
const GCell* _gcell;
@ -504,7 +504,7 @@ namespace Anabatic {
}
// GCell::CompareByKey Inline Functions.
inline bool GCell::CompareByKey::operator() ( const GCell* lhs, const GCell* rhs )
inline bool GCell::CompareByKey::operator() ( const GCell* lhs, const GCell* rhs ) const
{ return lhs->getKey() < rhs->getKey(); }
@ -531,7 +531,7 @@ namespace Anabatic {
return lhs._gcell->getId() < rhs._gcell->getId();
}
inline bool GCell::Key::Compare::operator() ( const GCell::Key* lhs, const GCell::Key* rhs )
inline bool GCell::Key::Compare::operator() ( const GCell::Key* lhs, const GCell::Key* rhs ) const
{
//if (lhs->isSaturated() xor rhs->isSaturated()) return lhs->isSaturated();

View File

@ -214,7 +214,7 @@ namespace std {
template<>
struct less<Hurricane::JsonObject*> {
inline bool operator() ( const Hurricane::JsonObject* lhs, const Hurricane::JsonObject* rhs )
inline bool operator() ( const Hurricane::JsonObject* lhs, const Hurricane::JsonObject* rhs ) const
{ return lhs->getTypeName() < rhs->getTypeName(); }
};

View File

@ -76,11 +76,11 @@ namespace Hurricane {
struct SelectedNetCompare {
inline bool operator() ( const SelectedNet& lhs, const SelectedNet& rhs );
inline bool operator() ( const SelectedNet& lhs, const SelectedNet& rhs ) const;
};
inline bool SelectedNetCompare::operator() ( const SelectedNet& lhs, const SelectedNet& rhs )
inline bool SelectedNetCompare::operator() ( const SelectedNet& lhs, const SelectedNet& rhs ) const
{
return lhs.getNet()->getName() < rhs.getNet()->getName();
}

View File

@ -66,7 +66,7 @@ namespace {
private:
class AxisCompare {
public:
bool operator() ( const Axis* lhs, const Axis* rhs );
bool operator() ( const Axis* lhs, const Axis* rhs ) const;
};
class AxisMatch : public unary_function<Axis*,bool> {
@ -166,7 +166,7 @@ namespace {
}
inline bool UsedFragments::AxisCompare::operator() ( const Axis* lhs, const Axis* rhs )
inline bool UsedFragments::AxisCompare::operator() ( const Axis* lhs, const Axis* rhs ) const
{
if ( lhs->getAxis () < rhs->getAxis () ) return true;
return false;
@ -273,7 +273,7 @@ namespace Katabatic {
{ }
bool GCell::CompareByDensity::operator() ( GCell* lhs, GCell* rhs )
bool GCell::CompareByDensity::operator() ( GCell* lhs, GCell* rhs ) const
{
//float difference = roundfp ( lhs->getDensity(_depth) - rhs->getDensity(_depth) );
float difference = lhs->getDensity(_depth) - rhs->getDensity(_depth);
@ -292,7 +292,7 @@ namespace Katabatic {
// lhs < rhs --> true
bool GCell::CompareByKey::operator() ( const GCell* lhs, const GCell* rhs )
bool GCell::CompareByKey::operator() ( const GCell* lhs, const GCell* rhs ) const
{
return lhs->getKey() < rhs->getKey();
}

View File

@ -76,18 +76,18 @@ namespace Katabatic {
public:
class CompareByIndex : public binary_function<const GCell*,const GCell*,bool> {
public:
bool operator() ( const GCell* lhs, const GCell* rhs );
bool operator() ( const GCell* lhs, const GCell* rhs ) const;
};
class CompareByDensity : public binary_function<GCell*,GCell*,bool> {
public:
CompareByDensity ( unsigned int depth );
bool operator() ( GCell* lhs, GCell* rhs );
bool operator() ( GCell* lhs, GCell* rhs ) const;
private:
unsigned int _depth;
};
class CompareByKey : public binary_function<const GCell*,const GCell*,bool> {
public:
bool operator() ( const GCell* lhs, const GCell* rhs );
bool operator() ( const GCell* lhs, const GCell* rhs ) const;
};
class Key {
@ -289,7 +289,7 @@ namespace Katabatic {
// GCell::CompareByIndex Inline Functions.
inline bool GCell::CompareByIndex::operator() ( const GCell* lhs, const GCell* rhs )
inline bool GCell::CompareByIndex::operator() ( const GCell* lhs, const GCell* rhs ) const
{ return ( lhs->getIndex() < rhs->getIndex() ); }

View File

@ -47,11 +47,11 @@ namespace {
class SortAcByXY {
public:
inline bool operator() ( AutoContactTerminal* contact1, AutoContactTerminal* contact2 );
inline bool operator() ( AutoContactTerminal* contact1, AutoContactTerminal* contact2 ) const;
};
inline bool SortAcByXY::operator() ( AutoContactTerminal* contact1, AutoContactTerminal* contact2 )
inline bool SortAcByXY::operator() ( AutoContactTerminal* contact1, AutoContactTerminal* contact2 ) const
{
DbU::Unit x1 = contact1->getX();
DbU::Unit x2 = contact2->getX();

View File

@ -52,7 +52,7 @@ namespace Katana {
public:
class CompareById : public binary_function<const TrackSegment*,const TrackSegment*,bool> {
public:
inline bool operator() ( const TrackSegment* lhs, const TrackSegment* rhs );
inline bool operator() ( const TrackSegment* lhs, const TrackSegment* rhs ) const;
};
public:
@ -181,7 +181,7 @@ namespace Katana {
};
inline bool TrackSegment::CompareById::operator() ( const TrackSegment* lhs, const TrackSegment* rhs )
inline bool TrackSegment::CompareById::operator() ( const TrackSegment* lhs, const TrackSegment* rhs ) const
{ return lhs->getId() < rhs->getId(); }

View File

@ -47,7 +47,7 @@ namespace Kite {
public:
class CompareById : public binary_function<const TrackSegment*,const TrackSegment*,bool> {
public:
inline bool operator() ( const TrackSegment* lhs, const TrackSegment* rhs );
inline bool operator() ( const TrackSegment* lhs, const TrackSegment* rhs ) const;
};
public:
@ -150,7 +150,7 @@ namespace Kite {
};
inline bool TrackSegment::CompareById::operator() ( const TrackSegment* lhs, const TrackSegment* rhs )
inline bool TrackSegment::CompareById::operator() ( const TrackSegment* lhs, const TrackSegment* rhs ) const
{ return lhs->getId() < rhs->getId(); }

View File

@ -90,11 +90,11 @@ namespace Solstice {
struct SelectedRoutingErrorCompare {
inline bool operator() ( const SelectedRoutingError& lhs, const SelectedRoutingError& rhs );
inline bool operator() ( const SelectedRoutingError& lhs, const SelectedRoutingError& rhs ) const;
};
inline bool SelectedRoutingErrorCompare::operator() ( const SelectedRoutingError& lhs, const SelectedRoutingError& rhs )
inline bool SelectedRoutingErrorCompare::operator() ( const SelectedRoutingError& lhs, const SelectedRoutingError& rhs ) const
{
return lhs.getRoutingError() < rhs.getRoutingError();
}