From 5f8c48d520d9c99dbd36faf7b302eecfdb8fc856 Mon Sep 17 00:00:00 2001 From: Darrell Walisser Date: Sat, 3 Sep 2016 15:44:12 -0400 Subject: [PATCH] use std::isnan since c++11 provides it and wxIsNan is broken in c++11 --- src/BlockFile.cpp | 5 ++--- src/effects/lv2/LV2Effect.cpp | 9 +++++---- src/widgets/numformatter.cpp | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/BlockFile.cpp b/src/BlockFile.cpp index 414a3de2c..5647f07d8 100644 --- a/src/BlockFile.cpp +++ b/src/BlockFile.cpp @@ -46,13 +46,12 @@ out. #include "BlockFile.h" #include -#include +#include #include #include #include #include -#include #include "Internat.h" #include "MemoryX.h" @@ -317,7 +316,7 @@ static void ComputeMinMax256(float *summary256, max = summary256[3*i+1]; else if (!(summary256[3*i+1] <= max)) bad++; - if (wxIsNaN(summary256[3*i+2])) + if (std::isnan(summary256[3*i+2])) bad++; if (summary256[3*i+2] < -1 || summary256[3*i+2] > 1) bad++; diff --git a/src/effects/lv2/LV2Effect.cpp b/src/effects/lv2/LV2Effect.cpp index 60cd79982..4dee28b96 100644 --- a/src/effects/lv2/LV2Effect.cpp +++ b/src/effects/lv2/LV2Effect.cpp @@ -13,6 +13,8 @@ #if defined(USE_LV2) +#include + #include #include #include @@ -23,7 +25,6 @@ #include #endif -#include #include #include #include @@ -561,13 +562,13 @@ bool LV2Effect::SetHost(EffectHostInterface *host) lilv_scale_points_free(points); // Collect the value and range info - ctrl.mHasLo = !wxIsNaN(minimumVals[i]); - ctrl.mHasHi = !wxIsNaN(maximumVals[i]); + ctrl.mHasLo = !std::isnan(minimumVals[i]); + ctrl.mHasHi = !std::isnan(maximumVals[i]); ctrl.mMin = ctrl.mHasLo ? minimumVals[i] : 0.0; ctrl.mMax = ctrl.mHasHi ? maximumVals[i] : 1.0; ctrl.mLo = ctrl.mMin; ctrl.mHi = ctrl.mMax; - ctrl.mDef = !wxIsNaN(defaultValues[i]) ? + ctrl.mDef = !std::isnan(defaultValues[i]) ? defaultValues[i] : ctrl.mHasLo ? ctrl.mLo : diff --git a/src/widgets/numformatter.cpp b/src/widgets/numformatter.cpp index dfbf19151..b98b04478 100644 --- a/src/widgets/numformatter.cpp +++ b/src/widgets/numformatter.cpp @@ -32,7 +32,7 @@ #include #include // for setlocale and LC_ALL -#include +#include #include // ---------------------------------------------------------------------------- @@ -134,11 +134,11 @@ wxString NumberFormatter::ToString(double val, int precision, int style) format.Printf(wxT("%%.%df"), precision); } - if (isnan(val)) + if (std::isnan(val)) { return _("NaN"); } - if (isinf(val)) + if (std::isinf(val)) { return _("-Infinity"); }