[Libreoffice-commits] core.git: sc/source

Tor Lillqvist tml at collabora.com
Thu Oct 6 13:18:27 UTC 2016


 sc/source/core/opencl/formulagroupcl.cxx |   16 ++++++++--------
 sc/source/core/opencl/op_statistical.cxx |   12 ++++++------
 2 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 321a0625bd153dfb522d7f9574d698f632ab7262
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Oct 6 16:03:16 2016 +0300

    Undo bogus changes to OpenCL code in 3e22dfa5eb1ccebdc719a671d23bde7ccab256fb
    
    Change-Id: Ieb6e6555f79c8030672a58a23248a2a5e7f8e09d

diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 740e26e..7701c2c 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -36,9 +36,9 @@
 
 static const char* publicFunc =
  "\n"
- "#define FormulaError::IllegalFPOperation 503 // #NUM!\n"
- "#define FormulaError::NoValue 519 // #VALUE!\n"
- "#define FormulaError::DivisionByZero 532 // #DIV/0!\n"
+ "#define IllegalFPOperation 503 // #NUM!\n"
+ "#define NoValue 519 // #VALUE!\n"
+ "#define DivisionByZero 532 // #DIV/0!\n"
  "#define NOTAVAILABLE 0x7fff // #N/A\n"
  "\n"
  "double CreateDoubleError(ulong nErr)\n"
@@ -51,9 +51,9 @@ static const char* publicFunc =
  "    if (isfinite(fVal))\n"
  "        return 0;\n"
  "    if (isinf(fVal))\n"
- "        return FormulaError::IllegalFPOperation; // normal INF\n"
+ "        return IllegalFPOperation; // normal INF\n"
  "    if (as_ulong(fVal) & 0XFFFF0000u)\n"
- "        return FormulaError::NoValue;            // just a normal NAN\n"
+ "        return NoValue;            // just a normal NAN\n"
  "    return (as_ulong(fVal) & 0XFFFF); // any other error\n"
  "}\n"
  "\n"
@@ -1762,7 +1762,7 @@ public:
         if (isAverage())
             ss <<
                 "if (nCount==0)\n"
-                "    return CreateDoubleError(FormulaError::DivisionByZero);\n";
+                "    return CreateDoubleError(DivisionByZero);\n";
         else if (isMinOrMax())
             ss <<
                 "if (nCount==0)\n"
@@ -2156,7 +2156,7 @@ public:
     virtual std::string GetBottom() override { return "1.0"; }
     virtual std::string Gen2( const std::string& lhs, const std::string& rhs ) const override
     {
-        return "(" + rhs + "==0 ? CreateDoubleError(FormulaError::DivisionByZero) : (" + lhs + "/" + rhs + ") )";
+        return "(" + rhs + "==0 ? CreateDoubleError(DivisionByZero) : (" + lhs + "/" + rhs + ") )";
     }
     virtual std::string BinFuncName() const override { return "fdiv"; }
 
@@ -2166,7 +2166,7 @@ public:
         {
             ss <<
                 "if (isnan(" << vSubArguments[argno]->GenSlidingWindowDeclRef() << ")) {\n"
-                "    return CreateDoubleError(FormulaError::DivisionByZero);\n"
+                "    return CreateDoubleError(DivisionByZero);\n"
                 "}\n";
             return true;
         }
diff --git a/sc/source/core/opencl/op_statistical.cxx b/sc/source/core/opencl/op_statistical.cxx
index 2668770..c333e78 100644
--- a/sc/source/core/opencl/op_statistical.cxx
+++ b/sc/source/core/opencl/op_statistical.cxx
@@ -194,7 +194,7 @@ void OpVar::GenSlidingWindowFunction(std::stringstream &ss,
         }
     }
     ss << "    if (fCount <= 1.0)\n";
-    ss << "        return CreateDoubleError(FormulaError::DivisionByZero);\n";
+    ss << "        return CreateDoubleError(DivisionByZero);\n";
     ss << "    else\n";
     ss << "        return vSum * pow(fCount - 1.0,-1.0);\n";
     ss << "}\n";
@@ -2657,7 +2657,7 @@ void OpSlope::GenSlidingWindowFunction(std::stringstream &ss,
         ss << "    }\n";
 
         ss << "    if (fCount < 1.0)\n";
-        ss << "        return CreateDoubleError(FormulaError::NoValue);\n";
+        ss << "        return CreateDoubleError(NoValue);\n";
         ss << "    else\n";
         ss << "    {\n";
         ss << "        fMeanX = fSumX * pow(fCount,-1.0);\n";
@@ -2701,7 +2701,7 @@ void OpSlope::GenSlidingWindowFunction(std::stringstream &ss,
         ss << "            fSumSqrDeltaX += (argX-fMeanX) * (argX-fMeanX);\n";
         ss << "        }\n";
         ss << "        if(fSumSqrDeltaX == 0.0)\n";
-        ss << "            return CreateDoubleError(FormulaError::DivisionByZero);\n";
+        ss << "            return CreateDoubleError(DivisionByZero);\n";
         ss << "        else\n";
         ss << "        {\n";
         ss << "            return fSumDeltaXDeltaY*pow(fSumSqrDeltaX,-1.0);\n";
@@ -3321,7 +3321,7 @@ void OpPearson::GenSlidingWindowFunction(
     ss << "      double tmp = ( fSumDeltaXDeltaY / ";
     ss << "sqrt( fSumX * fSumY));\n\t";
     ss << "      if (isnan(tmp))\n";
-    ss << "          return CreateDoubleError(FormulaError::NoValue);\n";
+    ss << "          return CreateDoubleError(NoValue);\n";
     ss << "      return tmp;\n";
     ss << "}\n";
 }
@@ -4738,7 +4738,7 @@ void OpNormsinv:: GenSlidingWindowFunction
     ss << "z = q < 0.0 ? (-1)*z : z;\n";
     ss <<"}\n";
     ss <<"if (isnan(z))\n";
-    ss <<"    return CreateDoubleError(FormulaError::NoValue);\n";
+    ss <<"    return CreateDoubleError(NoValue);\n";
     ss <<"return z;\n";
     ss <<"}\n";
 }
@@ -7012,7 +7012,7 @@ void OpCovar::GenSlidingWindowFunction(std::stringstream& ss,
                 ss << "    }\n";
             }
             ss << "    if(cnt < 1) {\n";
-            ss << "        return CreateDoubleError(FormulaError::NoValue);\n";
+            ss << "        return CreateDoubleError(NoValue);\n";
             ss << "    }\n";
             ss << "    else {\n";
             ss << "        vMean0 = vSum0 / cnt;\n";


More information about the Libreoffice-commits mailing list