From 568f0b8887869faf2e8642f352aa5bcfed3dacf2 Mon Sep 17 00:00:00 2001 From: Paul Bignier Date: Wed, 17 Jun 2015 17:06:52 +0200 Subject: [PATCH] Scicos gateways: fix for sci_scicosim https://codereview.scilab.org/#/c/16682/ correctly casted opar & outtb, but the pointer size failed under linux Change-Id: I408339143fe637e9375021e07817cbeb2a2cc67f --- .../scicos/sci_gateway/cpp/sci_scicosim.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scilab/modules/scicos/sci_gateway/cpp/sci_scicosim.cpp b/scilab/modules/scicos/sci_gateway/cpp/sci_scicosim.cpp index 5b763fa..3144607 100644 --- a/scilab/modules/scicos/sci_gateway/cpp/sci_scicosim.cpp +++ b/scilab/modules/scicos/sci_gateway/cpp/sci_scicosim.cpp @@ -1696,7 +1696,7 @@ types::Function::ReturnValue sci_scicosim(types::typed_list &in, int _iRetCount, return types::Function::Error; } memcpy(opar[j], oparDouble->get(), oparDouble->getSize() * sizeof(double)); // Real part - memcpy((double*)(opar[j]) + sizeof(double)*oparDouble->getSize(), oparDouble->getImg(), oparDouble->getSize() * sizeof(double)); // Complex part + memcpy((double*)(opar[j]) + oparDouble->getSize(), oparDouble->getImg(), oparDouble->getSize() * sizeof(double)); // Complex part // FIXME: delete oparDouble because we copied it instead of using it? } oparsz[j] = oparDouble->getRows(); @@ -1912,7 +1912,7 @@ types::Function::ReturnValue sci_scicosim(types::typed_list &in, int _iRetCount, return types::Function::Error; } memcpy(outtbptr[j], outtbDouble->get(), outtbDouble->getSize() * sizeof(double)); // Real part - memcpy((double*)(outtbptr[j]) + sizeof(double)*outtbDouble->getSize(), outtbDouble->getImg(), outtbDouble->getSize() * sizeof(double)); // Complex part + memcpy((double*)(outtbptr[j]) + outtbDouble->getSize(), outtbDouble->getImg(), outtbDouble->getSize() * sizeof(double)); // Complex part // FIXME: delete outtbDouble because we copied it instead of using it? } outtbsz[j] = outtbDouble->getRows(); @@ -2189,7 +2189,7 @@ types::Function::ReturnValue sci_scicosim(types::typed_list &in, int _iRetCount, case 26 : error = _("The number of parameter provided by Scicos blocks is different from what expected by the code generated by the Modelica compiler. You might have relaxed a parameter using FIXED property (i.e., fixed=false) in a Modelica model. This will be corrected in the next version"); break; - // In this case, you need to turn off the parameter embedded code generation mode by setting 'Modelica_ParEmb=%f' in the Scilab command window, and recompile the Scicos diagram + // In this case, you need to turn off the parameter embedded code generation mode by setting 'Modelica_ParEmb=%f' in the Scilab command window, and recompile the Scicos diagram default : if (ierr >= 1000) -- 1.7.9.5