From 0bbcae2b771545b13d608c876599e048b40dd883 Mon Sep 17 00:00:00 2001 From: przemek83 <4788832+przemek83@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:50:30 +0100 Subject: [PATCH] Add parentheses to make the operator precedence explicit. --- src/QwtBleUtilities.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/QwtBleUtilities.cpp b/src/QwtBleUtilities.cpp index 7b7d5b6..0057942 100644 --- a/src/QwtBleUtilities.cpp +++ b/src/QwtBleUtilities.cpp @@ -18,20 +18,22 @@ bool doublesAreEqual(double left, double right) { static const double qtDoublePrecision{1e-12}; return std::abs(left - right) <= - qtDoublePrecision * std::max({1.0, std::abs(left), std::abs(right)}); + (qtDoublePrecision * + std::max({1.0, std::abs(left), std::abs(right)})); } bool floatsAreEqual(float left, float right) { static const float qtFloatPrecision{1e-6F}; return std::abs(left - right) <= - qtFloatPrecision * std::max({1.0F, std::abs(left), std::abs(right)}); + (qtFloatPrecision * + std::max({1.0F, std::abs(left), std::abs(right)})); } QString doubleToStringUsingLocale(double value, int precision) { static bool initialized{false}; - static QLocale locale = QLocale::system(); + static QLocale locale{QLocale::system()}; if (!initialized) { locale.setNumberOptions(locale.numberOptions() &