Suppress harmless gcc -Wfloat-equal in wxNumValidator code

Exact comparison with 0 here is fine, so just disable the warning for
this code.

Closes #18271.
This commit is contained in:
Vadim Zeitlin
2018-11-20 14:11:53 +01:00
parent bdca91c629
commit f7514dc79d

View File

@@ -228,10 +228,16 @@ private:
// wxNUM_VAL_ZERO_AS_BLANK flag.
wxString NormalizeValue(LongestValueType value) const
{
// We really want to compare with the exact 0 here, so disable gcc
// warning about doing this.
wxGCC_WARNING_SUPPRESS(float-equal)
wxString s;
if ( value != 0 || !BaseValidator::HasFlag(wxNUM_VAL_ZERO_AS_BLANK) )
s = this->ToString(value);
wxGCC_WARNING_RESTORE(float-equal)
return s;
}