Browse Source

Fix a bunch of C5266 warnings (pointless const on bool/int returns)

warning C5266: 'const' qualifier on return type has no effect
Microsoft doesn't even document C5266
newinvert
Marek Roszko 2 years ago
parent
commit
573b66d243
  1. 6
      common/gal/color4d.cpp
  2. 2
      common/gal/cursors.cpp
  3. 12
      common/settings/bom_settings.cpp
  4. 2
      eeschema/sch_sheet_path.h
  5. 6
      include/gal/color4d.h
  6. 2
      include/gal/cursors.h
  7. 12
      include/settings/bom_settings.h
  8. 2
      include/tool/tool_action.h
  9. 2
      libs/kimath/include/math/vector2d.h

6
common/gal/color4d.cpp

@ -245,19 +245,19 @@ COLOR4D COLOR4D::LegacyMix( const COLOR4D& aColor ) const
namespace KIGFX {
const bool operator==( const COLOR4D& lhs, const COLOR4D& rhs )
bool operator==( const COLOR4D& lhs, const COLOR4D& rhs )
{
return lhs.a == rhs.a && lhs.r == rhs.r && lhs.g == rhs.g && lhs.b == rhs.b;
}
const bool operator!=( const COLOR4D& lhs, const COLOR4D& rhs )
bool operator!=( const COLOR4D& lhs, const COLOR4D& rhs )
{
return !( lhs == rhs );
}
const bool operator<( const COLOR4D& lhs, const COLOR4D& rhs )
bool operator<( const COLOR4D& lhs, const COLOR4D& rhs )
{
if( lhs.r < rhs.r )
return true;

2
common/gal/cursors.cpp

@ -405,7 +405,7 @@ const wxCursor CURSOR_STORE::GetCursor( KICURSOR aCursorType )
}
const wxStockCursor CURSOR_STORE::GetStockCursor( KICURSOR aCursorType )
wxStockCursor CURSOR_STORE::GetStockCursor( KICURSOR aCursorType )
{
wxStockCursor stockCursor;
switch( aCursorType )

12
common/settings/bom_settings.cpp

@ -45,13 +45,13 @@ bool BOM_FIELD::operator==( const BOM_FIELD& rhs ) const
}
const bool operator!=( const BOM_FIELD& lhs, const BOM_FIELD& rhs )
bool operator!=( const BOM_FIELD& lhs, const BOM_FIELD& rhs )
{
return !( lhs == rhs );
}
const bool operator<( const BOM_FIELD& lhs, const BOM_FIELD& rhs )
bool operator<( const BOM_FIELD& lhs, const BOM_FIELD& rhs )
{
return lhs.name < rhs.name;
}
@ -74,13 +74,13 @@ void from_json( const nlohmann::json& j, BOM_FIELD& f )
}
const bool operator!=( const BOM_PRESET& lhs, const BOM_PRESET& rhs )
bool operator!=( const BOM_PRESET& lhs, const BOM_PRESET& rhs )
{
return !( lhs == rhs );
}
const bool operator<( const BOM_PRESET& lhs, const BOM_PRESET& rhs )
bool operator<( const BOM_PRESET& lhs, const BOM_PRESET& rhs )
{
return lhs.name < rhs.name;
}
@ -172,13 +172,13 @@ bool BOM_FMT_PRESET::operator==( const BOM_FMT_PRESET& rhs ) const
}
const bool operator!=( const BOM_FMT_PRESET& lhs, const BOM_FMT_PRESET& rhs )
bool operator!=( const BOM_FMT_PRESET& lhs, const BOM_FMT_PRESET& rhs )
{
return !( lhs == rhs );
}
const bool operator<( const BOM_FMT_PRESET& lhs, const BOM_FMT_PRESET& rhs )
bool operator<( const BOM_FMT_PRESET& lhs, const BOM_FMT_PRESET& rhs )
{
return lhs.name < rhs.name;
}

2
eeschema/sch_sheet_path.h

@ -430,7 +430,7 @@ namespace std
struct SHEET_PATH_HASH
{
const size_t operator()( const SCH_SHEET_PATH& path ) const
size_t operator()( const SCH_SHEET_PATH& path ) const
{
return path.GetCurrentHash();
}

6
include/gal/color4d.h

@ -387,12 +387,12 @@ public:
};
/// @brief Equality operator, are two colors equal
const bool operator==( const COLOR4D& lhs, const COLOR4D& rhs );
bool operator==( const COLOR4D& lhs, const COLOR4D& rhs );
/// @brief Not equality operator, are two colors not equal
const bool operator!=( const COLOR4D& lhs, const COLOR4D& rhs );
bool operator!=( const COLOR4D& lhs, const COLOR4D& rhs );
const bool operator<( const COLOR4D& lhs, const COLOR4D& rhs );
bool operator<( const COLOR4D& lhs, const COLOR4D& rhs );
/// Syntactic sugar for outputting colors to strings
std::ostream &operator<<( std::ostream &aStream, COLOR4D const &aColor );

2
include/gal/cursors.h

@ -113,7 +113,7 @@ public:
static const wxCursor GetCursor( KICURSOR aCursorType );
static const wxStockCursor GetStockCursor( KICURSOR aCursorType );
static wxStockCursor GetStockCursor( KICURSOR aCursorType );
private:
///< Internal store of cursors by ID

12
include/settings/bom_settings.h

@ -37,8 +37,8 @@ struct BOM_FIELD
bool operator==( const BOM_FIELD& rhs ) const;
};
const bool operator!=( const BOM_FIELD& lhs, const BOM_FIELD& rhs );
const bool operator<( const BOM_FIELD& lhs, const BOM_FIELD& rhs );
bool operator!=( const BOM_FIELD& lhs, const BOM_FIELD& rhs );
bool operator<( const BOM_FIELD& lhs, const BOM_FIELD& rhs );
void to_json( nlohmann::json& j, const BOM_FIELD& f );
void from_json( const nlohmann::json& j, BOM_FIELD& f );
@ -63,8 +63,8 @@ struct BOM_PRESET
static BOM_PRESET GroupedByValueFootprint();
};
const bool operator!=( const BOM_PRESET& lhs, const BOM_PRESET& rhs );
const bool operator<( const BOM_PRESET& lhs, const BOM_PRESET& rhs );
bool operator!=( const BOM_PRESET& lhs, const BOM_PRESET& rhs );
bool operator<( const BOM_PRESET& lhs, const BOM_PRESET& rhs );
void to_json( nlohmann::json& j, const BOM_PRESET& f );
void from_json( const nlohmann::json& j, BOM_PRESET& f );
@ -89,8 +89,8 @@ struct BOM_FMT_PRESET
static BOM_FMT_PRESET Semicolons();
};
const bool operator!=( const BOM_FMT_PRESET& lhs, const BOM_FMT_PRESET& rhs );
const bool operator<( const BOM_FMT_PRESET& lhs, const BOM_FMT_PRESET& rhs );
bool operator!=( const BOM_FMT_PRESET& lhs, const BOM_FMT_PRESET& rhs );
bool operator<( const BOM_FMT_PRESET& lhs, const BOM_FMT_PRESET& rhs );
void to_json( nlohmann::json& j, const BOM_FMT_PRESET& f );
void from_json( const nlohmann::json& j, BOM_FMT_PRESET& f );

2
include/tool/tool_action.h

@ -189,7 +189,7 @@ public:
*
* It is used in context menu.
*/
const BITMAPS GetIcon() const
BITMAPS GetIcon() const
{
return m_icon;
}

2
libs/kimath/include/math/vector2d.h

@ -538,7 +538,7 @@ const VECTOR2<T> LexicographicalMin( const VECTOR2<T>& aA, const VECTOR2<T>& aB
template <class T>
const int LexicographicalCompare( const VECTOR2<T>& aA, const VECTOR2<T>& aB )
int LexicographicalCompare( const VECTOR2<T>& aA, const VECTOR2<T>& aB )
{
if( aA.x < aB.x )
return -1;

Loading…
Cancel
Save