mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-21 11:31:51 -05:00
Fix implicit-const-int-float-conversion error (by JG1UAA)
This commit is contained in:
parent
2e3cec2201
commit
2545103ba5
@ -54,7 +54,7 @@ namespace Radio
|
|||||||
value *= std::pow (10., scale);
|
value *= std::pow (10., scale);
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
if (value < 0. || value > std::numeric_limits<Frequency>::max ())
|
if (value < 0. || value > static_cast<double>(std::numeric_limits<Frequency>::max ()))
|
||||||
{
|
{
|
||||||
value = 0.;
|
value = 0.;
|
||||||
*ok = false;
|
*ok = false;
|
||||||
@ -91,8 +91,8 @@ namespace Radio
|
|||||||
value *= std::pow (10., scale);
|
value *= std::pow (10., scale);
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
if (value < -std::numeric_limits<Frequency>::max ()
|
if (value < static_cast<double>(std::numeric_limits<Frequency>::min ())
|
||||||
|| value > std::numeric_limits<Frequency>::max ())
|
|| value > static_cast<double>(std::numeric_limits<Frequency>::max ()))
|
||||||
{
|
{
|
||||||
value = 0.;
|
value = 0.;
|
||||||
*ok = false;
|
*ok = false;
|
||||||
|
@ -39,8 +39,8 @@ namespace
|
|||||||
FrequencyDeltaLineEdit::FrequencyDeltaLineEdit (QWidget * parent)
|
FrequencyDeltaLineEdit::FrequencyDeltaLineEdit (QWidget * parent)
|
||||||
: QLineEdit (parent)
|
: QLineEdit (parent)
|
||||||
{
|
{
|
||||||
setValidator (new MHzValidator {-std::numeric_limits<FrequencyDelta>::max () / 10.e6,
|
setValidator (new MHzValidator {static_cast<double>(std::numeric_limits<FrequencyDelta>::min ()) / 10.e6,
|
||||||
std::numeric_limits<FrequencyDelta>::max () / 10.e6, this});
|
static_cast<double>(std::numeric_limits<FrequencyDelta>::max ()) / 10.e6, this});
|
||||||
}
|
}
|
||||||
|
|
||||||
auto FrequencyDeltaLineEdit::frequency_delta () const -> FrequencyDelta
|
auto FrequencyDeltaLineEdit::frequency_delta () const -> FrequencyDelta
|
||||||
|
@ -39,7 +39,7 @@ namespace
|
|||||||
FrequencyLineEdit::FrequencyLineEdit (QWidget * parent)
|
FrequencyLineEdit::FrequencyLineEdit (QWidget * parent)
|
||||||
: QLineEdit (parent)
|
: QLineEdit (parent)
|
||||||
{
|
{
|
||||||
setValidator (new MHzValidator {0., std::numeric_limits<Radio::Frequency>::max () / 10.e6, this});
|
setValidator (new MHzValidator {0., static_cast<double>(std::numeric_limits<Radio::Frequency>::max ()) / 10.e6, this});
|
||||||
}
|
}
|
||||||
|
|
||||||
auto FrequencyLineEdit::frequency () const -> Frequency
|
auto FrequencyLineEdit::frequency () const -> Frequency
|
||||||
|
Loading…
Reference in New Issue
Block a user