summaryrefslogtreecommitdiffstats
path: root/scilab/modules
diff options
context:
space:
mode:
authorSamuel GOUGEON <sgougeon@free.fr>2021-04-16 23:38:22 +0200
committerClément David <clement.david@esi-group.com>2021-04-27 15:45:10 +0200
commitf0d304e399c1b4a4b53ced3bae8b785a30122f33 (patch)
tree7f04d2c4e8c93c358169c1f3923b8c3027fb86af /scilab/modules
parent79be6de155a538fc1cfc4eff09f43b2029db6149 (diff)
downloadscilab-f0d304e399c1b4a4b53ced3bae8b785a30122f33.zip
scilab-f0d304e399c1b4a4b53ced3bae8b785a30122f33.tar.gz
* Bug 16284 fixed: typename() updated for Scilab 6 (11 'm', 'mc'=>'function')
http://bugzilla.scilab.org/16284 Change-Id: Ie1b66431b1487ccaaaa9cb066abc73b14426e40a
Diffstat (limited to 'scilab/modules')
-rw-r--r--scilab/modules/core/sci_gateway/cpp/sci_typename.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/scilab/modules/core/sci_gateway/cpp/sci_typename.cpp b/scilab/modules/core/sci_gateway/cpp/sci_typename.cpp
index 5071985..cc12ecb 100644
--- a/scilab/modules/core/sci_gateway/cpp/sci_typename.cpp
+++ b/scilab/modules/core/sci_gateway/cpp/sci_typename.cpp
@@ -25,15 +25,15 @@ extern "C"
25#include "elem_common.h" 25#include "elem_common.h"
26} 26}
27/*--------------------------------------------------------------------------*/ 27/*--------------------------------------------------------------------------*/
28#define NB_OF_TYPE 18 28#define NB_OF_TYPE 17
29/*--------------------------------------------------------------------------*/ 29/*--------------------------------------------------------------------------*/
30types::Function::ReturnValue sci_typename(types::typed_list &in, int _iRetCount, types::typed_list &out) 30types::Function::ReturnValue sci_typename(types::typed_list &in, int _iRetCount, types::typed_list &out)
31{ 31{
32 int iOne = 1; 32 int iOne = 1;
33 const wchar_t* pstShortTypeName[NB_OF_TYPE] = {L"s", L"p", L"b", L"sp", L"spb", L"msp", L"i", L"h", L"c", 33 const wchar_t* pstShortTypeName[NB_OF_TYPE] = {L"s", L"p", L"b", L"sp", L"spb", L"msp", L"i", L"h", L"c",
34 L"m", L"mc", L"f", L"l", L"tl", L"ml", L"ptr", L"ip", L"fptr" 34 L"function", L"f", L"l", L"tl", L"ml", L"ptr", L"ip", L"fptr"
35 }; 35 };
36 double pstShortTypeNum[NB_OF_TYPE] = {1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 128, 129, 130}; 36 double pstShortTypeNum[NB_OF_TYPE] = {1, 2, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16, 17, 128, 129, 130};
37 37
38 /* Check the number of input argument */ 38 /* Check the number of input argument */
39 if (in.size() != 0) 39 if (in.size() != 0)
@@ -49,15 +49,15 @@ types::Function::ReturnValue sci_typename(types::typed_list &in, int _iRetCount,
49 return types::Function::Error; 49 return types::Function::Error;
50 } 50 }
51 51
52 if (in.size() == 0) 52 // get type number
53 { 53 types::Double* pDblOut = new types::Double(NB_OF_TYPE, 1);
54 // get type number 54 double* pdblOut = pDblOut->get();
55 types::Double* pDblOut = new types::Double(NB_OF_TYPE, 1); 55 int iSize = NB_OF_TYPE;
56 double* pdblOut = pDblOut->get(); 56 C2F(dcopy)(&iSize, pstShortTypeNum, &iOne, pdblOut, &iOne);
57 int iSize = NB_OF_TYPE; 57 out.push_back(pDblOut);
58 C2F(dcopy)(&iSize, pstShortTypeNum, &iOne, pdblOut, &iOne);
59 out.push_back(pDblOut);
60 58
59 if (_iRetCount > 1)
60 {
61 // get type name 61 // get type name
62 types::String* pStrOut = new types::String(NB_OF_TYPE, 1); 62 types::String* pStrOut = new types::String(NB_OF_TYPE, 1);
63 for (int i = 0; i < NB_OF_TYPE; i++) 63 for (int i = 0; i < NB_OF_TYPE; i++)