Skip to content

Commit

Permalink
Change to isnan for cross-compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gamnn authored and Simon Inns committed Jan 19, 2020
1 parent 3e2664d commit 091653e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tools/ld-analyse/snranalysisdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ void SnrAnalysisDialog::removeChartContents()
// Add a data point to the chart
void SnrAnalysisDialog::addDataPoint(qint32 fieldNumber, qreal blackSnr, qreal whiteSnr)
{
if (!isnanf(static_cast<float>(blackSnr))) blackPoints->append(QPointF(fieldNumber, blackSnr));
if (!isnanf(static_cast<float>(whiteSnr))) whitePoints->append(QPointF(fieldNumber, whiteSnr));
if (!std::isnan(static_cast<float>(blackSnr))) blackPoints->append(QPointF(fieldNumber, blackSnr));
if (!std::isnan(static_cast<float>(whiteSnr))) whitePoints->append(QPointF(fieldNumber, whiteSnr));

// Keep track of the minimum and maximum SNR values
if (blackSnr < minSnr) minSnr = blackSnr;
Expand Down
5 changes: 1 addition & 4 deletions tools/ld-analyse/snranalysisdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@
#ifndef SNRANALYSISDIALOG_H
#define SNRANALYSISDIALOG_H

/* workaround for Macs */
#if defined(__APPLE__)
#define isnanf(X) isnan((double)(X))
#endif
#include <cmath>

#include <QDialog>
#include <qwt_plot.h>
Expand Down

0 comments on commit 091653e

Please sign in to comment.