From e25785d09b92ab6d78d37b76bfb07f80be40de9c Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Sun, 6 Nov 2016 20:04:21 +0000 Subject: [PATCH] Fixed wrong CLogMessage constructor being used nullptr was being implicitly converted to a null C-style string via the initializer_list constructor of CLogCategoryList. refs #790 --- src/blackmisc/logcategorylist.h | 3 +++ src/plugins/simulator/fs9/simulatorfs9.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/blackmisc/logcategorylist.h b/src/blackmisc/logcategorylist.h index a67748f47..c5cca55a3 100644 --- a/src/blackmisc/logcategorylist.h +++ b/src/blackmisc/logcategorylist.h @@ -50,6 +50,9 @@ namespace BlackMisc //! Initializer list constructor. CLogCategoryList(std::initializer_list il) : CSequence(il) {} + //! Prevent accidental use of the initializer list constructor. + CLogCategoryList(std::nullptr_t) = delete; + //! Copy assignment. CLogCategoryList &operator =(const CLogCategoryList &) = default; diff --git a/src/plugins/simulator/fs9/simulatorfs9.cpp b/src/plugins/simulator/fs9/simulatorfs9.cpp index 20e59b532..bf86ffeb7 100644 --- a/src/plugins/simulator/fs9/simulatorfs9.cpp +++ b/src/plugins/simulator/fs9/simulatorfs9.cpp @@ -79,7 +79,7 @@ namespace BlackSimPlugin FS_PBH pbhstrct; pbhstrct.pbh = positionVelocity.pbh; int pitch = std::floor(pbhstrct.pitch / CFs9Sdk::pitchMultiplier()); - if (pitch < -90 || pitch > 89) { CLogMessage(nullptr).warning("FS9: Pitch value out of limits: %1") << pitch; } + if (pitch < -90 || pitch > 89) { CLogMessage().warning("FS9: Pitch value out of limits: %1") << pitch; } int bank = std::floor(pbhstrct.bank / CFs9Sdk::bankMultiplier()); // MSFS has inverted pitch and bank angles