[Libreoffice-commits] core.git: registry/tools

Noel Grandin noel at peralex.com
Thu Feb 4 06:25:57 UTC 2016


 registry/tools/regcompare.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 0e414e1433acf775c17063cc748818ee7dd822e3
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Jan 27 11:06:24 2016 +0200

    loplugin:fpcomparison in registry/
    
    Change-Id: Ifdc2df9ba51ce8ef2c8793bb51c28a547f22214f
    Reviewed-on: https://gerrit.libreoffice.org/21866
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/registry/tools/regcompare.cxx b/registry/tools/regcompare.cxx
index d5e33c7..901f719 100644
--- a/registry/tools/regcompare.cxx
+++ b/registry/tools/regcompare.cxx
@@ -25,6 +25,7 @@
 #include "options.hxx"
 
 #include <rtl/ustring.hxx>
+#include <rtl/math.hxx>
 #include <osl/diagnose.h>
 
 #include <stdio.h>
@@ -584,7 +585,7 @@ static sal_uInt32 checkConstValue(Options_Impl const & options,
             }
             break;
         case RT_TYPE_FLOAT:
-            if (constValue1.m_value.aFloat != constValue2.m_value.aFloat)
+            if (!rtl::math::approxEqual(constValue1.m_value.aFloat, constValue2.m_value.aFloat))
             {
                 if ( options.forceOutput() && !options.unoTypeCheck() )
                 {
@@ -596,7 +597,7 @@ static sal_uInt32 checkConstValue(Options_Impl const & options,
             }
             break;
         case RT_TYPE_DOUBLE:
-            if (constValue1.m_value.aDouble != constValue2.m_value.aDouble)
+            if (!rtl::math::approxEqual(constValue1.m_value.aDouble, constValue2.m_value.aDouble))
             {
                 if ( options.forceOutput() && !options.unoTypeCheck() )
                 {


More information about the Libreoffice-commits mailing list