summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine ELIAS <antoine.elias@scilab-enterprises.com>2016-11-10 08:24:24 +0100
committerAntoine ELIAS <antoine.elias@scilab-enterprises.com>2016-11-10 08:24:24 +0100
commitbab474978d0f2bf1ebb41f88abe8504508e62790 (patch)
treefba3d6c4c50a46df4d163cd79937c9825a0f98d6
parent448ef39f7e22e8d46eabcf565d0a0cdfc657c997 (diff)
downloadscilab-bab474978d0f2bf1ebb41f88abe8504508e62790.zip
scilab-bab474978d0f2bf1ebb41f88abe8504508e62790.tar.gz
utf: ast 2
Change-Id: I9284d6353959fb60883dcee6c0c6bb94e4942637
-rw-r--r--scilab/modules/ast/includes/types/addfunction.h6
-rw-r--r--scilab/modules/ast/src/cpp/ast/consoledebugger.cpp10
-rw-r--r--scilab/modules/ast/src/cpp/ast/printvisitor.cpp38
-rw-r--r--scilab/modules/ast/src/cpp/parse/printerror.cpp1
-rw-r--r--scilab/modules/ast/src/cpp/symbol/variables.cpp16
-rw-r--r--scilab/modules/ast/src/cpp/system_env/sci_path.cpp7
-rw-r--r--scilab/modules/ast/src/cpp/types/arrayof.cpp2
-rw-r--r--scilab/modules/ast/src/cpp/types/bool.cpp6
-rw-r--r--scilab/modules/ast/src/cpp/types/inspector.cpp4
-rw-r--r--scilab/modules/ast/src/cpp/types/library.cpp2
-rw-r--r--scilab/modules/ast/src/cpp/types/singlepoly.cpp2
-rw-r--r--scilab/modules/ast/src/cpp/types/sparse.cpp4
-rw-r--r--scilab/modules/ast/src/cpp/types/struct.cpp4
-rw-r--r--scilab/modules/ast/tests/unit_tests/newtype.hxx10
14 files changed, 52 insertions, 60 deletions
diff --git a/scilab/modules/ast/includes/types/addfunction.h b/scilab/modules/ast/includes/types/addfunction.h
index 5feb003..0f0d47a 100644
--- a/scilab/modules/ast/includes/types/addfunction.h
+++ b/scilab/modules/ast/includes/types/addfunction.h
@@ -16,8 +16,8 @@
16 16
17#include "dynlib_ast.h" 17#include "dynlib_ast.h"
18 18
19EXTERN_AST void addCStackFunction(const char* _wstName, OLDGW_FUNC _pFunc, const char* _wstModule); 19EXTERN_AST void addCStackFunction(const char* _stName, OLDGW_FUNC _pFunc, const char* _stModule);
20EXTERN_AST void addCFunction(const char* _wstName, GW_C_FUNC _pFunc, const char* _wstModule); 20EXTERN_AST void addCFunction(const char* _stName, GW_C_FUNC _pFunc, const char* _stModule);
21EXTERN_AST void addMexFunction(const char* _wstName, MEXGW_FUNC _pFunc, const char* _wstModule); 21EXTERN_AST void addMexFunction(const char* _stName, MEXGW_FUNC _pFunc, const char* _stModule);
22 22
23#endif // __ADDFUNCTION_H__ 23#endif // __ADDFUNCTION_H__
diff --git a/scilab/modules/ast/src/cpp/ast/consoledebugger.cpp b/scilab/modules/ast/src/cpp/ast/consoledebugger.cpp
index 65fd68d..f520159 100644
--- a/scilab/modules/ast/src/cpp/ast/consoledebugger.cpp
+++ b/scilab/modules/ast/src/cpp/ast/consoledebugger.cpp
@@ -30,7 +30,7 @@ void ConsoleDebugger::onStop(int index)
30 debugger::Breakpoint* bp = manager->getBreakPoint(index); 30 debugger::Breakpoint* bp = manager->getBreakPoint(index);
31 if (bp) 31 if (bp)
32 { 32 {
33 sciprint(_("debugger stop on breakpoint(%d) in function %ls line %d\n"), index, bp->getFunctioName().data(), bp->getMacroLine()); 33 sciprint(_("debugger stop on breakpoint(%d) in function %s line %d\n"), index, bp->getFunctioName().data(), bp->getMacroLine());
34 } 34 }
35 } 35 }
36 36
@@ -51,7 +51,7 @@ void ConsoleDebugger::onErrorInFile(const std::string& filename)
51{ 51{
52 debugger::DebuggerMagager* manager = debugger::DebuggerMagager::getInstance(); 52 debugger::DebuggerMagager* manager = debugger::DebuggerMagager::getInstance();
53 ast::Exp* exp = manager->getExp(); 53 ast::Exp* exp = manager->getExp();
54 sciprint(_("debugger stop on error in file %ls line %d\n"), filename.data(), exp->getLocation().first_line); 54 sciprint(_("debugger stop on error in file %s line %d\n"), filename.data(), exp->getLocation().first_line);
55 printExp(); 55 printExp();
56} 56}
57 57
@@ -59,7 +59,7 @@ void ConsoleDebugger::onErrorInScript(const std::string& funcname)
59{ 59{
60 debugger::DebuggerMagager* manager = debugger::DebuggerMagager::getInstance(); 60 debugger::DebuggerMagager* manager = debugger::DebuggerMagager::getInstance();
61 ast::Exp* exp = manager->getExp(); 61 ast::Exp* exp = manager->getExp();
62 sciprint(_("debugger stop on error in function %ls line %d\n"), funcname.data(), exp->getLocation().first_line); 62 sciprint(_("debugger stop on error in function %s line %d\n"), funcname.data(), exp->getLocation().first_line);
63 printExp(); 63 printExp();
64} 64}
65 65
@@ -79,14 +79,14 @@ void ConsoleDebugger::updateBreakpoints()
79 return; 79 return;
80 } 80 }
81 81
82 sciprint("% 3ls % 7ls %24ls % 5ls %ls\n\n", L"num", L"enable", L"function", L"line", L"condition"); 82 sciprint("% 3s % 7s %24s % 5s %s\n\n", "num", "enable", "function", "line", "condition");
83 int i = 0; 83 int i = 0;
84 for (const auto& b : brks) 84 for (const auto& b : brks)
85 { 85 {
86 if (b->isMacro()) 86 if (b->isMacro())
87 { 87 {
88 std::string condition = b->getCondition(); 88 std::string condition = b->getCondition();
89 sciprint("% 3d % 7s %24s % 5d %ls\n", i, b->isEnable() ? "true" : "false", b->getFunctioName().c_str(), b->getMacroLine(), 89 sciprint("% 3d % 7s %24s % 5d %s\n", i, b->isEnable() ? "true" : "false", b->getFunctioName().c_str(), b->getMacroLine(),
90 condition.size() < 30 ? condition.c_str() : 90 condition.size() < 30 ? condition.c_str() :
91 (std::string(condition.begin(), condition.begin() + 27) + "...").c_str()); 91 (std::string(condition.begin(), condition.begin() + 27) + "...").c_str());
92 } 92 }
diff --git a/scilab/modules/ast/src/cpp/ast/printvisitor.cpp b/scilab/modules/ast/src/cpp/ast/printvisitor.cpp
index 1b300d1..e0813e9 100644
--- a/scilab/modules/ast/src/cpp/ast/printvisitor.cpp
+++ b/scilab/modules/ast/src/cpp/ast/printvisitor.cpp
@@ -142,7 +142,7 @@ void PrintVisitor::visit (const StringExp &e)
142 types::String * pStr = static_cast<types::String *>(pIT); 142 types::String * pStr = static_cast<types::String *>(pIT);
143 if (pStr->getSize() == 0) 143 if (pStr->getSize() == 0)
144 { 144 {
145 *ostr << L"[]"; 145 *ostr << "[]";
146 } 146 }
147 if (pStr->getSize() == 1) 147 if (pStr->getSize() == 1)
148 { 148 {
@@ -151,7 +151,7 @@ void PrintVisitor::visit (const StringExp &e)
151 } 151 }
152 else 152 else
153 { 153 {
154 *ostr << L"["; 154 *ostr << "[";
155 const int r = pStr->getRows(); 155 const int r = pStr->getRows();
156 const int c = pStr->getCols(); 156 const int c = pStr->getCols();
157 for (int i = 0; i < r; ++i) 157 for (int i = 0; i < r; ++i)
@@ -160,13 +160,13 @@ void PrintVisitor::visit (const StringExp &e)
160 { 160 {
161 std::string str(pStr->get(i, j)); 161 std::string str(pStr->get(i, j));
162 printString(str); 162 printString(str);
163 *ostr << L" "; 163 *ostr << " ";
164 } 164 }
165 std::string str(pStr->get(i, c - 1)); 165 std::string str(pStr->get(i, c - 1));
166 printString(str); 166 printString(str);
167 *ostr << L";"; 167 *ostr << ";";
168 } 168 }
169 *ostr << L"]"; 169 *ostr << "]";
170 } 170 }
171 } 171 }
172 else 172 else
@@ -190,7 +190,7 @@ void PrintVisitor::visit (const DoubleExp &e)
190 types::Double * pDbl = static_cast<types::Double *>(pIT); 190 types::Double * pDbl = static_cast<types::Double *>(pIT);
191 if (pDbl->getSize() == 0) 191 if (pDbl->getSize() == 0)
192 { 192 {
193 *ostr << L"[]"; 193 *ostr << "[]";
194 } 194 }
195 else if (pDbl->getSize() == 1) 195 else if (pDbl->getSize() == 1)
196 { 196 {
@@ -199,7 +199,7 @@ void PrintVisitor::visit (const DoubleExp &e)
199 const double imag = pDbl->getImg()[0]; 199 const double imag = pDbl->getImg()[0];
200 if (imag != 0) 200 if (imag != 0)
201 { 201 {
202 *ostr << pDbl->getReal()[0] << (imag > 0 ? L"+%i*" : L"-%i*") << std::abs(imag); 202 *ostr << pDbl->getReal()[0] << (imag > 0 ? "+%i*" : "-%i*") << std::abs(imag);
203 } 203 }
204 else 204 else
205 { 205 {
@@ -213,7 +213,7 @@ void PrintVisitor::visit (const DoubleExp &e)
213 } 213 }
214 else 214 else
215 { 215 {
216 *ostr << L"["; 216 *ostr << "[";
217 const int r = pDbl->getRows(); 217 const int r = pDbl->getRows();
218 const int c = pDbl->getCols(); 218 const int c = pDbl->getCols();
219 if (pDbl->isComplex()) 219 if (pDbl->isComplex())
@@ -225,14 +225,14 @@ void PrintVisitor::visit (const DoubleExp &e)
225 const double imag = pDbl->getImg(i, j); 225 const double imag = pDbl->getImg(i, j);
226 if (imag != 0) 226 if (imag != 0)
227 { 227 {
228 *ostr << pDbl->getReal(i, j) << (imag > 0 ? L"+%i*" : L"-%i*") << std::abs(imag) << L" "; 228 *ostr << pDbl->getReal(i, j) << (imag > 0 ? "+%i*" : "-%i*") << std::abs(imag) << " ";
229 } 229 }
230 else 230 else
231 { 231 {
232 *ostr << pDbl->get(i, j) << L" "; 232 *ostr << pDbl->get(i, j) << " ";
233 } 233 }
234 } 234 }
235 *ostr << pDbl->get(i, c - 1) << L";"; 235 *ostr << pDbl->get(i, c - 1) << ";";
236 } 236 }
237 } 237 }
238 else 238 else
@@ -241,12 +241,12 @@ void PrintVisitor::visit (const DoubleExp &e)
241 { 241 {
242 for (int j = 0; j < c - 1; ++j) 242 for (int j = 0; j < c - 1; ++j)
243 { 243 {
244 *ostr << pDbl->get(i, j) << L" "; 244 *ostr << pDbl->get(i, j) << " ";
245 } 245 }
246 *ostr << pDbl->get(i, c - 1) << L";"; 246 *ostr << pDbl->get(i, c - 1) << ";";
247 } 247 }
248 } 248 }
249 *ostr << L"]"; 249 *ostr << "]";
250 } 250 }
251 } 251 }
252 } 252 }
@@ -265,7 +265,7 @@ void PrintVisitor::visit (const BoolExp &e)
265 types::Bool * pBool = static_cast<types::Bool *>(pIT); 265 types::Bool * pBool = static_cast<types::Bool *>(pIT);
266 if (pBool->getSize() == 0) 266 if (pBool->getSize() == 0)
267 { 267 {
268 *ostr << L"[]"; 268 *ostr << "[]";
269 } 269 }
270 if (pBool->getSize() == 1) 270 if (pBool->getSize() == 1)
271 { 271 {
@@ -273,18 +273,18 @@ void PrintVisitor::visit (const BoolExp &e)
273 } 273 }
274 else 274 else
275 { 275 {
276 *ostr << L"["; 276 *ostr << "[";
277 const int r = pBool->getRows(); 277 const int r = pBool->getRows();
278 const int c = pBool->getCols(); 278 const int c = pBool->getCols();
279 for (int i = 0; i < r; ++i) 279 for (int i = 0; i < r; ++i)
280 { 280 {
281 for (int j = 0; j < c - 1; ++j) 281 for (int j = 0; j < c - 1; ++j)
282 { 282 {
283 *ostr << (pBool->get(i, j) ? SCI_TRUE : SCI_FALSE) << L" "; 283 *ostr << (pBool->get(i, j) ? SCI_TRUE : SCI_FALSE) << " ";
284 } 284 }
285 *ostr << (pBool->get(i, c - 1) ? SCI_TRUE : SCI_FALSE) << L";"; 285 *ostr << (pBool->get(i, c - 1) ? SCI_TRUE : SCI_FALSE) << ";";
286 } 286 }
287 *ostr << L"]"; 287 *ostr << "]";
288 } 288 }
289 } 289 }
290 } 290 }
diff --git a/scilab/modules/ast/src/cpp/parse/printerror.cpp b/scilab/modules/ast/src/cpp/parse/printerror.cpp
index 590d14d..fdaff44 100644
--- a/scilab/modules/ast/src/cpp/parse/printerror.cpp
+++ b/scilab/modules/ast/src/cpp/parse/printerror.cpp
@@ -45,7 +45,6 @@ void ParserSingleInstance::PrintError(const std::string& msg)
45 ostr << std::endl; 45 ostr << std::endl;
46 } 46 }
47 free(codeLine); 47 free(codeLine);
48 FREE(str);
49 48
50 /** Underline what causes the trouble */ 49 /** Underline what causes the trouble */
51 int i = 0; 50 int i = 0;
diff --git a/scilab/modules/ast/src/cpp/symbol/variables.cpp b/scilab/modules/ast/src/cpp/symbol/variables.cpp
index 3a6e98f..7d718d4 100644
--- a/scilab/modules/ast/src/cpp/symbol/variables.cpp
+++ b/scilab/modules/ast/src/cpp/symbol/variables.cpp
@@ -99,7 +99,7 @@ bool Variable::put(types::InternalType* _pIT, int _iLevel)
99 int iFuncProt = ConfigVariable::getFuncprot(); 99 int iFuncProt = ConfigVariable::getFuncprot();
100 if (iFuncProt != 0) 100 if (iFuncProt != 0)
101 { 101 {
102 bool bEquals = false; 102 bool bEquals = true;
103 if (pIT && pIT->isCallable()) 103 if (pIT && pIT->isCallable())
104 { 104 {
105 if (pIT->isMacroFile()) 105 if (pIT->isMacroFile())
@@ -121,13 +121,13 @@ bool Variable::put(types::InternalType* _pIT, int _iLevel)
121 return false; 121 return false;
122 } 122 }
123 123
124 wchar_t pwstFuncName[1024]; 124 if (ConfigVariable::getWarningMode())
125 os_swprintf(pwstFuncName, 1024, L"%-24ls", name.getName().c_str()); 125 {
126 char* pstFuncName = wide_string_to_UTF8(pwstFuncName); 126 char pstFuncName[1024];
127 127 os_sprintf(pstFuncName, 1024, "%-24s", name.getName().c_str());
128 sciprint(_("Warning : redefining function: %s. Use funcprot(0) to avoid this message"), pstFuncName); 128 sciprint(_("Warning : redefining function: %s. Use funcprot(0) to avoid this message"), pstFuncName);
129 sciprint("\n"); 129 sciprint("\n");
130 FREE(pstFuncName); 130 }
131 } 131 }
132 } 132 }
133 } 133 }
diff --git a/scilab/modules/ast/src/cpp/system_env/sci_path.cpp b/scilab/modules/ast/src/cpp/system_env/sci_path.cpp
index 6affca7..b4ca9da 100644
--- a/scilab/modules/ast/src/cpp/system_env/sci_path.cpp
+++ b/scilab/modules/ast/src/cpp/system_env/sci_path.cpp
@@ -35,13 +35,6 @@ char *getSCI(void)
35 return os_strdup(ConfigVariable::getSCIPath().c_str()); 35 return os_strdup(ConfigVariable::getSCIPath().c_str());
36} 36}
37/*--------------------------------------------------------------------------*/ 37/*--------------------------------------------------------------------------*/
38void setSCIW(const wchar_t* _sci_path)
39{
40 char* pstPath = wide_string_to_UTF8(_sci_path);
41 setSCI(pstPath);
42 FREE(pstPath);
43}
44/*--------------------------------------------------------------------------*/
45void setSCI(const char* _sci_path) 38void setSCI(const char* _sci_path)
46{ 39{
47 // 40 //
diff --git a/scilab/modules/ast/src/cpp/types/arrayof.cpp b/scilab/modules/ast/src/cpp/types/arrayof.cpp
index 97decc0..53a610f 100644
--- a/scilab/modules/ast/src/cpp/types/arrayof.cpp
+++ b/scilab/modules/ast/src/cpp/types/arrayof.cpp
@@ -1700,7 +1700,7 @@ template class EXTERN_AST ArrayOf < unsigned int >;
1700template class EXTERN_AST ArrayOf < long long >; 1700template class EXTERN_AST ArrayOf < long long >;
1701template class EXTERN_AST ArrayOf < unsigned long long >; 1701template class EXTERN_AST ArrayOf < unsigned long long >;
1702template class EXTERN_AST ArrayOf < double >; 1702template class EXTERN_AST ArrayOf < double >;
1703template class EXTERN_AST ArrayOf < wchar_t* >; 1703template class EXTERN_AST ArrayOf < char* >;
1704template class EXTERN_AST ArrayOf < SinglePoly* >; 1704template class EXTERN_AST ArrayOf < SinglePoly* >;
1705template class EXTERN_AST ArrayOf < SingleStruct* >; 1705template class EXTERN_AST ArrayOf < SingleStruct* >;
1706template class EXTERN_AST ArrayOf < InternalType* >; // Cell 1706template class EXTERN_AST ArrayOf < InternalType* >; // Cell
diff --git a/scilab/modules/ast/src/cpp/types/bool.cpp b/scilab/modules/ast/src/cpp/types/bool.cpp
index c0a7ec0..af7aeac 100644
--- a/scilab/modules/ast/src/cpp/types/bool.cpp
+++ b/scilab/modules/ast/src/cpp/types/bool.cpp
@@ -169,7 +169,7 @@ bool Bool::subMatrixToString(std::ostringstream& ostr, int* _piDims, int /*_iDim
169 iLen = 0; 169 iLen = 0;
170 } 170 }
171 171
172 ostemp << (get(iPos) ? L" T" : L" F"); 172 ostemp << (get(iPos) ? " T" : " F");
173 iLen += 2; 173 iLen += 2;
174 } 174 }
175 175
@@ -214,7 +214,7 @@ bool Bool::subMatrixToString(std::ostringstream& ostr, int* _piDims, int /*_iDim
214 _piDims[0] = iRows2; 214 _piDims[0] = iRows2;
215 _piDims[1] = iCols2; 215 _piDims[1] = iCols2;
216 int iPos = getIndex(_piDims); 216 int iPos = getIndex(_piDims);
217 ostemp << (get(iPos) == 0 ? L" F" : L" T"); 217 ostemp << (get(iPos) == 0 ? " F" : " T");
218 } 218 }
219 ostemp << std::endl << " "; 219 ostemp << std::endl << " ";
220 } 220 }
@@ -258,7 +258,7 @@ bool Bool::subMatrixToString(std::ostringstream& ostr, int* _piDims, int /*_iDim
258 _piDims[1] = iCols2; 258 _piDims[1] = iCols2;
259 int iPos = getIndex(_piDims); 259 int iPos = getIndex(_piDims);
260 260
261 ostemp << (get(iPos) == 0 ? L" F" : L" T"); 261 ostemp << (get(iPos) == 0 ? " F" : " T");
262 } 262 }
263 ostemp << std::endl << " "; 263 ostemp << std::endl << " ";
264 } 264 }
diff --git a/scilab/modules/ast/src/cpp/types/inspector.cpp b/scilab/modules/ast/src/cpp/types/inspector.cpp
index aeb040a..6ca44b6 100644
--- a/scilab/modules/ast/src/cpp/types/inspector.cpp
+++ b/scilab/modules/ast/src/cpp/types/inspector.cpp
@@ -73,7 +73,7 @@ InternalType* Inspector::getUnreferencedItem(size_t _iPos)
73 { 73 {
74 if (iCount == _iPos) 74 if (iCount == _iPos)
75 { 75 {
76 std::wcout << L"getUnreferencedItem : " << it << std::endl; 76 std::cout << "getUnreferencedItem : " << it << std::endl;
77 return it; 77 return it;
78 } 78 }
79 iCount++; 79 iCount++;
@@ -142,7 +142,7 @@ void Inspector::displayMemleak()
142 std::cerr << " " << it->second << " " << it->first; 142 std::cerr << " " << it->second << " " << it->first;
143 143
144 // list the not free-ed pointers 144 // list the not free-ed pointers
145 std::wcerr << L" : "; 145 std::cerr << " : ";
146 bool isFirst = true; 146 bool isFirst = true;
147 for (auto pi : m_vIT) 147 for (auto pi : m_vIT)
148 { 148 {
diff --git a/scilab/modules/ast/src/cpp/types/library.cpp b/scilab/modules/ast/src/cpp/types/library.cpp
index 8b95a56..7ba5646 100644
--- a/scilab/modules/ast/src/cpp/types/library.cpp
+++ b/scilab/modules/ast/src/cpp/types/library.cpp
@@ -89,7 +89,7 @@ bool Library::extract(const std::string & name, InternalType *& out)
89 if (out == NULL) 89 if (out == NULL)
90 { 90 {
91 char szError[bsiz]; 91 char szError[bsiz];
92 os_sprintf(szError, _("Unknown field : %ls.\n"), name.c_str()); 92 os_sprintf(szError, _("Unknown field : %s.\n"), name.c_str());
93 throw std::string(szError); 93 throw std::string(szError);
94 } 94 }
95 95
diff --git a/scilab/modules/ast/src/cpp/types/singlepoly.cpp b/scilab/modules/ast/src/cpp/types/singlepoly.cpp
index e0aca8a..00dd6ef 100644
--- a/scilab/modules/ast/src/cpp/types/singlepoly.cpp
+++ b/scilab/modules/ast/src/cpp/types/singlepoly.cpp
@@ -413,7 +413,7 @@ void SinglePoly::toStringInternal(double *_pdblVal, const std::string& _szVar, s
413 { 413 {
414 if (ostemp.str() == " ") 414 if (ostemp.str() == " ")
415 { 415 {
416 ostemp << L" 0"; 416 ostemp << " 0";
417 addSpaces(&ostemp2, static_cast<int>(ostemp.str().size())); 417 addSpaces(&ostemp2, static_cast<int>(ostemp.str().size()));
418 } 418 }
419 419
diff --git a/scilab/modules/ast/src/cpp/types/sparse.cpp b/scilab/modules/ast/src/cpp/types/sparse.cpp
index 7d9a396..9c273af 100644
--- a/scilab/modules/ast/src/cpp/types/sparse.cpp
+++ b/scilab/modules/ast/src/cpp/types/sparse.cpp
@@ -45,12 +45,12 @@ namespace
45 45
46/* used for debuging output 46/* used for debuging output
47*/ 47*/
48template<typename Os, typename In, typename Sz> Os& writeData(wchar_t const* title, In beg, Sz n, Os& os) 48template<typename Os, typename In, typename Sz> Os& writeData(char const* title, In beg, Sz n, Os& os)
49{ 49{
50 os << title; 50 os << title;
51 /* TODO: use tostring_common (with a kind of std::boolalpha for boolean output) 51 /* TODO: use tostring_common (with a kind of std::boolalpha for boolean output)
52 */ 52 */
53 mycopy_n(beg, n, std::ostream_iterator<typename std::iterator_traits<In>::value_type, char>(os, L" ")); 53 mycopy_n(beg, n, std::ostream_iterator<typename std::iterator_traits<In>::value_type, char>(os, " "));
54 os << std::endl; 54 os << std::endl;
55 return os; 55 return os;
56} 56}
diff --git a/scilab/modules/ast/src/cpp/types/struct.cpp b/scilab/modules/ast/src/cpp/types/struct.cpp
index 6076754..7965aad 100644
--- a/scilab/modules/ast/src/cpp/types/struct.cpp
+++ b/scilab/modules/ast/src/cpp/types/struct.cpp
@@ -143,7 +143,7 @@ bool Struct::extract(const std::string & name, InternalType *& out)
143 else 143 else
144 { 144 {
145 char szError[bsiz]; 145 char szError[bsiz];
146 os_sprintf(szError, _("Unknown field : %ls.\n"), name.c_str()); 146 os_sprintf(szError, _("Unknown field : %s.\n"), name.c_str());
147 throw std::string(szError); 147 throw std::string(szError);
148 } 148 }
149 149
@@ -524,7 +524,7 @@ bool Struct::toString(std::ostringstream& ostr)
524 ostr << " struct array with "; 524 ostr << " struct array with ";
525 525
526 String* pwstFields = getFieldNames(); 526 String* pwstFields = getFieldNames();
527 ostr << L"fields:" << std::endl; 527 ostr << "fields:" << std::endl;
528 for (int i = 0 ; i < pwstFields->getSize() ; i++) 528 for (int i = 0 ; i < pwstFields->getSize() ; i++)
529 { 529 {
530 ostr << " " << pwstFields->get(i) << std::endl; 530 ostr << " " << pwstFields->get(i) << std::endl;
diff --git a/scilab/modules/ast/tests/unit_tests/newtype.hxx b/scilab/modules/ast/tests/unit_tests/newtype.hxx
index 145e749..f20d3c6 100644
--- a/scilab/modules/ast/tests/unit_tests/newtype.hxx
+++ b/scilab/modules/ast/tests/unit_tests/newtype.hxx
@@ -32,20 +32,20 @@ public:
32 return bHasToString; 32 return bHasToString;
33 } 33 }
34 34
35 bool toString(std::wostringstream& ostr) 35 bool toString(std::ostringstream& ostr)
36 { 36 {
37 ostr << "This is my type."; 37 ostr << "This is my type.";
38 return true; 38 return true;
39 } 39 }
40 40
41 std::wstring getTypeStr() 41 std::string getTypeStr()
42 { 42 {
43 return L"NewType"; 43 return "NewType";
44 } 44 }
45 45
46 std::wstring getShortTypeStr() 46 std::string getShortTypeStr()
47 { 47 {
48 return L"nt"; 48 return "nt";
49 } 49 }
50 50
51 NewType* clone() 51 NewType* clone()