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

I-Jui Sung (Ray) ray at multicorewareinc.com
Fri Nov 15 11:50:34 PST 2013


 sc/source/core/opencl/op_math.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit ec6d0deca7e2fcde1f461e093b51bd101fe1eba9
Author: I-Jui (Ray) Sung <ray at multicorewareinc.com>
Date:   Fri Nov 15 13:37:22 2013 -0600

    GPU Calc: fix compilation error in using sprintf
    
    Change-Id: Iea316f3355a9105702391aa7b76268cdfc8831ef

diff --git a/sc/source/core/opencl/op_math.cxx b/sc/source/core/opencl/op_math.cxx
index dc5d7d4..5e5c749 100644
--- a/sc/source/core/opencl/op_math.cxx
+++ b/sc/source/core/opencl/op_math.cxx
@@ -1927,10 +1927,11 @@ void OpProduct::GenSlidingWindowFunction(std::stringstream &ss,
     ss << "    int gid0 = get_global_id(0);\n";
     ss << "    int i = 0;\n";
     ss << "    double product=0.0;\n\n";
-    char sArgNoI[5];
     for (unsigned i = 0; i < vSubArguments.size(); i++)
     {
-        sprintf(sArgNoI,"%d",i);
+        std::stringstream ssArgNoI;
+        ssArgNoI << i;
+        std::string sArgNoI = ssArgNoI.str();
         ss << std::string("    double arg")+sArgNoI+";\n";
         FormulaToken *pCur = vSubArguments[i]->GetFormulaToken();
         assert(pCur);


More information about the Libreoffice-commits mailing list