core: replace IS_FP_SAME macro by inline function

No reason to keep this as a macro - a function is easier to
read, type safe and easier to debug. Moreover, give it the
more appropriate name "nearly_equal()". After all, it precisely
does NOT check floating points for equality.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-08-30 17:55:43 +02:00 committed by Robert C. Helling
parent 5db4a95a26
commit 61701509b0
9 changed files with 28 additions and 25 deletions

View file

@ -183,7 +183,7 @@ void DownloadFromDCWidget::updateProgressBar()
if (empty_string(last_text)) {
// if we get the first actual text after the download is finished
// (which happens for example on the OSTC), then don't bother
if (!empty_string(progress_bar_text) && IS_FP_SAME(progress_bar_fraction, 1.0))
if (!empty_string(progress_bar_text) && nearly_equal(progress_bar_fraction, 1.0))
progress_bar_text = "";
}
if (!empty_string(progress_bar_text)) {