summaryrefslogtreecommitdiffstats
path: root/scilab/modules/scicos
diff options
context:
space:
mode:
authorClément David <clement.david@esi-group.com>2021-07-15 15:50:48 +0200
committerClément David <clement.david@esi-group.com>2021-07-15 15:50:48 +0200
commit81a9cc049332de0c712cf56da585fcd25c8e59e3 (patch)
treef365c25a05c1782a16b2985bf7481116c106952d /scilab/modules/scicos
parentb0937f19e4b8ddf416ca9a9a433bcbbd3f4ef2c0 (diff)
parent90b4ecb9b57ac6ad4e00d4a99b0d8bd1a6424403 (diff)
downloadscilab-master.zip
scilab-master.tar.gz
Merge remote-tracking branch 'origin/6.1'HEADmaster
Change-Id: I5d26fc380a28efe0bb6d0096fe9684b274b55bfe
Diffstat (limited to 'scilab/modules/scicos')
-rw-r--r--scilab/modules/scicos/Makefile.in2
-rw-r--r--scilab/modules/scicos/macros/scicos_scicos/scicos_flat.sci7
-rw-r--r--scilab/modules/scicos/sci_gateway/cpp/sci_scicosim.cpp27
3 files changed, 31 insertions, 5 deletions
diff --git a/scilab/modules/scicos/Makefile.in b/scilab/modules/scicos/Makefile.in
index 8b4798c..62dc79b 100644
--- a/scilab/modules/scicos/Makefile.in
+++ b/scilab/modules/scicos/Makefile.in
@@ -939,9 +939,11 @@ NMEDIT = @NMEDIT@
939OBJDUMP = @OBJDUMP@ 939OBJDUMP = @OBJDUMP@
940OBJEXT = @OBJEXT@ 940OBJEXT = @OBJEXT@
941OCAMLC = @OCAMLC@ 941OCAMLC = @OCAMLC@
942OCAMLCFLAGS = @OCAMLCFLAGS@
942OCAMLDEP = @OCAMLDEP@ 943OCAMLDEP = @OCAMLDEP@
943OCAMLLEX = @OCAMLLEX@ 944OCAMLLEX = @OCAMLLEX@
944OCAMLOPT = @OCAMLOPT@ 945OCAMLOPT = @OCAMLOPT@
946OCAMLOPTFLAGS = @OCAMLOPTFLAGS@
945OCAMLYACC = @OCAMLYACC@ 947OCAMLYACC = @OCAMLYACC@
946OPENMPI_CC = @OPENMPI_CC@ 948OPENMPI_CC = @OPENMPI_CC@
947OPENMPI_CFLAGS = @OPENMPI_CFLAGS@ 949OPENMPI_CFLAGS = @OPENMPI_CFLAGS@
diff --git a/scilab/modules/scicos/macros/scicos_scicos/scicos_flat.sci b/scilab/modules/scicos/macros/scicos_scicos/scicos_flat.sci
index 4a0da2c..2b77eda 100644
--- a/scilab/modules/scicos/macros/scicos_scicos/scicos_flat.sci
+++ b/scilab/modules/scicos/macros/scicos_scicos/scicos_flat.sci
@@ -343,10 +343,11 @@ function [cor,corinv,links_table,cur_fictitious,sco_mat,ok, IN, OUT, EIN, EOUT]
343 end //end of loop on objects 343 end //end of loop on objects
344 344
345 if ksup==0&nb==0 then 345 if ksup==0&nb==0 then
346 if or(flag=="nw") then 346 msg = msprintf(gettext("%s: Empty diagram"), "Xcos: scicos_flat")
347 disp(msprintf(gettext("%s: Empty diagram"), "scicos_flat")); 347 if or(getscilabmode()==["NW" "NWNI"]) then
348 disp(msg);
348 else 349 else
349 messagebox(msprintf(gettext("%s: Empty diagram"), "Xcos"),"modal"); 350 messagebox(msg,"modal");
350 end 351 end
351 ok=%f 352 ok=%f
352 return 353 return
diff --git a/scilab/modules/scicos/sci_gateway/cpp/sci_scicosim.cpp b/scilab/modules/scicos/sci_gateway/cpp/sci_scicosim.cpp
index 12eaee8..5622d3a 100644
--- a/scilab/modules/scicos/sci_gateway/cpp/sci_scicosim.cpp
+++ b/scilab/modules/scicos/sci_gateway/cpp/sci_scicosim.cpp
@@ -12,7 +12,7 @@
12 * along with this program. 12 * along with this program.
13 * 13 *
14 */ 14 */
15 15#include <vector>
16#include <string> 16#include <string>
17#include <cstdio> 17#include <cstdio>
18#include <cwchar> 18#include <cwchar>
@@ -1614,7 +1614,7 @@ types::Function::ReturnValue sci_scicosim(types::typed_list &in, int _iRetCount,
1614 oztyp[j] = SCSUNKNOW_N; 1614 oztyp[j] = SCSUNKNOW_N;
1615 oz[j] = il_state_oz->get(j); 1615 oz[j] = il_state_oz->get(j);
1616 ozsz[j] = 0; // rows 1616 ozsz[j] = 0; // rows
1617 ozsz[j + nopar] = 0; // cols 1617 ozsz[j + noz] = 0; // cols
1618 break; 1618 break;
1619 } 1619 }
1620 } 1620 }
@@ -1624,9 +1624,18 @@ types::Function::ReturnValue sci_scicosim(types::typed_list &in, int _iRetCount,
1624 /**************************** 1624 /****************************
1625 * Set opar, oparsz, opartyp 1625 * Set opar, oparsz, opartyp
1626 ****************************/ 1626 ****************************/
1627 struct UTF8AllocatedStrings : std::vector<char*> {
1628 ~UTF8AllocatedStrings() {
1629 for (char* ptr : *this)
1630 {
1631 FREE(ptr);
1632 }
1633 };
1634 };
1627 void** opar = nullptr; 1635 void** opar = nullptr;
1628 int* oparsz = nullptr; 1636 int* oparsz = nullptr;
1629 int* opartyp = nullptr; 1637 int* opartyp = nullptr;
1638 UTF8AllocatedStrings oparStrings;
1630 if (nopar > 0) 1639 if (nopar > 0)
1631 { 1640 {
1632 // Allocation of 'opar' 1641 // Allocation of 'opar'
@@ -1813,6 +1822,20 @@ types::Function::ReturnValue sci_scicosim(types::typed_list &in, int _iRetCount,
1813 opar[j] = (SCSUINT32_COP *) oparUInt32->get(); 1822 opar[j] = (SCSUINT32_COP *) oparUInt32->get();
1814 break; 1823 break;
1815 } 1824 }
1825 case types::InternalType::ScilabString :
1826 {
1827 types::String* oparString = il_sim_opar->get(j)->getAs<types::String>();
1828 opartyp[j] = SCSINT8_N; // int8
1829 oparsz[j] = oparString->getSize();
1830 oparsz[j + nopar] = 1;
1831 for (int i = 0; i < oparString->getSize(); ++i)
1832 {
1833 // convert string as char* buffers, owned by oparStrings
1834 oparStrings.emplace_back(wide_string_to_UTF8(oparString->get(i)));
1835 opar[j] = oparStrings.back();
1836 }
1837 break;
1838 }
1816 default: 1839 default:
1817 { 1840 {
1818 opartyp[j] = SCSUNKNOW_N; 1841 opartyp[j] = SCSUNKNOW_N;