Fix qwt 'comparison is always false'/true warnings

This commit is contained in:
Brian Bergstrand
2016-01-05 21:46:48 -06:00
parent 169a970868
commit e7badee075
2 changed files with 3 additions and 3 deletions

View File

@@ -18,7 +18,7 @@ static inline double qwtMsecsForType( QwtDate::IntervalType type )
365.0 * 24.0 * 3600.0 * 1000.0,
};
if ( type < 0 || type >= static_cast<int>( sizeof( msecs ) / sizeof( msecs[0] ) ) )
if ( static_cast<int>(type) < 0 || static_cast<int>(type) >= static_cast<int>( sizeof( msecs ) / sizeof( msecs[0] ) ) )
return 1.0;
return msecs[ type ];

View File

@@ -235,7 +235,7 @@ QPen QwtPlotTradingCurve::symbolPen() const
void QwtPlotTradingCurve::setSymbolBrush(
Direction direction, const QBrush &brush )
{
if ( direction < 0 || direction >= 2 )
if ( static_cast<int>(direction) < 0 || static_cast<int>(direction) >= 2 )
return;
if ( brush != d_data->symbolBrush[ direction ] )
@@ -256,7 +256,7 @@ void QwtPlotTradingCurve::setSymbolBrush(
*/
QBrush QwtPlotTradingCurve::symbolBrush( Direction direction ) const
{
if ( direction < 0 || direction >= 2 )
if ( static_cast<int>(direction) < 0 || static_cast<int>(direction) >= 2 )
return QBrush();
return d_data->symbolBrush[ direction ];