std::wstring as parameter must be const & when is possible 14/17214/2
Antoine ELIAS [Wed, 16 Sep 2015 15:12:20 +0000 (17:12 +0200)]
remove using namespace ast/types/std and use :: instead of.

Change-Id: Id5033cd35c3e82176e5f4d43268370f75659a3d1

239 files changed:
scilab/modules/api_scilab/src/cpp/api_boolean.cpp
scilab/modules/api_scilab/src/cpp/api_boolean_sparse.cpp
scilab/modules/api_scilab/src/cpp/api_common.cpp
scilab/modules/api_scilab/src/cpp/api_double.cpp
scilab/modules/api_scilab/src/cpp/api_handle.cpp
scilab/modules/api_scilab/src/cpp/api_int.cpp
scilab/modules/api_scilab/src/cpp/api_list.cpp
scilab/modules/api_scilab/src/cpp/api_optional.cpp
scilab/modules/api_scilab/src/cpp/api_pointer.cpp
scilab/modules/api_scilab/src/cpp/api_poly.cpp
scilab/modules/api_scilab/src/cpp/api_sparse.cpp
scilab/modules/api_scilab/src/cpp/api_string.cpp
scilab/modules/ast/includes/analysis/AnalysisVisitor.hxx
scilab/modules/ast/includes/ast/debugvisitor.hxx
scilab/modules/ast/includes/ast/macrovarvisitor.hxx
scilab/modules/ast/includes/ast/runvisitor.hxx
scilab/modules/ast/includes/ast/scilabexception.hxx
scilab/modules/ast/includes/ast/visitor_common.hxx
scilab/modules/ast/includes/exps/boolexp.hxx
scilab/modules/ast/includes/exps/functiondec.hxx
scilab/modules/ast/includes/exps/stringexp.hxx
scilab/modules/ast/includes/operations/types_finite.hxx
scilab/modules/ast/includes/operations/types_power.hxx
scilab/modules/ast/includes/parse/parser.hxx
scilab/modules/ast/includes/parse/parser_private.hxx
scilab/modules/ast/includes/symbol/context.hxx
scilab/modules/ast/includes/system_env/configvariable.hxx
scilab/modules/ast/includes/types/callable.hxx
scilab/modules/ast/includes/types/file.hxx
scilab/modules/ast/includes/types/function.hxx
scilab/modules/ast/includes/types/library.hxx
scilab/modules/ast/includes/types/macrofile.hxx
scilab/modules/ast/includes/types/overload.hxx
scilab/modules/ast/includes/types/polynom.hxx
scilab/modules/ast/includes/types/singlepoly.hxx
scilab/modules/ast/includes/types/struct.hxx
scilab/modules/ast/includes/types/tlist.hxx
scilab/modules/ast/includes/types/types.hxx
scilab/modules/ast/includes/types/user.hxx
scilab/modules/ast/src/cpp/ast/debugvisitor.cpp
scilab/modules/ast/src/cpp/ast/macrovarvisitor.cpp
scilab/modules/ast/src/cpp/ast/run_AssignExp.hpp
scilab/modules/ast/src/cpp/ast/run_CallExp.hpp
scilab/modules/ast/src/cpp/ast/run_MatrixExp.hpp
scilab/modules/ast/src/cpp/ast/run_OpExp.hpp
scilab/modules/ast/src/cpp/ast/runvisitor.cpp
scilab/modules/ast/src/cpp/ast/treevisitor.cpp
scilab/modules/ast/src/cpp/ast/visitor_common.cpp
scilab/modules/ast/src/cpp/operations/types_addition.cpp
scilab/modules/ast/src/cpp/operations/types_finite.cpp
scilab/modules/ast/src/cpp/operations/types_power.cpp
scilab/modules/ast/src/cpp/parse/parser.cpp
scilab/modules/ast/src/cpp/parse/printerror.cpp
scilab/modules/ast/src/cpp/symbol/context.cpp
scilab/modules/ast/src/cpp/system_env/configvariable.cpp
scilab/modules/ast/src/cpp/system_env/sci_home.cpp
scilab/modules/ast/src/cpp/system_env/sci_path.cpp
scilab/modules/ast/src/cpp/system_env/setenvvar.cpp
scilab/modules/ast/src/cpp/types/addfunction.cpp
scilab/modules/ast/src/cpp/types/double.cpp
scilab/modules/ast/src/cpp/types/file.cpp
scilab/modules/ast/src/cpp/types/function.cpp
scilab/modules/ast/src/cpp/types/macrofile.cpp
scilab/modules/ast/src/cpp/types/overload.cpp
scilab/modules/ast/src/cpp/types/polynom.cpp
scilab/modules/ast/src/cpp/types/singlepoly.cpp
scilab/modules/ast/src/cpp/types/string.cpp
scilab/modules/ast/src/cpp/types/struct.cpp
scilab/modules/boolean/src/cpp/boolean_gw.cpp
scilab/modules/cacsd/sci_gateway/cpp/cacsd_gw.cpp
scilab/modules/core/includes/timer.hxx
scilab/modules/core/sci_gateway/cpp/core_gw.cpp
scilab/modules/core/sci_gateway/cpp/sci_analyzeroptions.cpp
scilab/modules/core/sci_gateway/cpp/sci_argn.cpp
scilab/modules/core/sci_gateway/cpp/sci_clear.cpp
scilab/modules/core/sci_gateway/cpp/sci_clearfun.cpp
scilab/modules/core/sci_gateway/cpp/sci_clearglobal.cpp
scilab/modules/core/sci_gateway/cpp/sci_error.cpp
scilab/modules/core/sci_gateway/cpp/sci_exit.cpp
scilab/modules/core/sci_gateway/cpp/sci_funptr.cpp
scilab/modules/core/sci_gateway/cpp/sci_getmd5.cpp
scilab/modules/core/sci_gateway/cpp/sci_getmodules.cpp
scilab/modules/core/sci_gateway/cpp/sci_getos.cpp
scilab/modules/core/sci_gateway/cpp/sci_getscilabmode.cpp
scilab/modules/core/sci_gateway/cpp/sci_getversion.cpp
scilab/modules/core/sci_gateway/cpp/sci_global.cpp
scilab/modules/core/sci_gateway/cpp/sci_isglobal.cpp
scilab/modules/core/sci_gateway/cpp/sci_lasterror.cpp
scilab/modules/core/sci_gateway/cpp/sci_macr2tree.cpp
scilab/modules/core/sci_gateway/cpp/sci_mode.cpp
scilab/modules/core/sci_gateway/cpp/sci_newfun.cpp
scilab/modules/core/sci_gateway/cpp/sci_warning.cpp
scilab/modules/core/sci_gateway/cpp/sci_with_module.cpp
scilab/modules/core/src/cpp/InitScilab.cpp
scilab/modules/core/src/cpp/runner.cpp
scilab/modules/core/src/cpp/storeCommand.cpp
scilab/modules/core/src/cpp/tasks.cpp
scilab/modules/differential_equations/sci_gateway/cpp/differential_equations_gw.cpp
scilab/modules/differential_equations/sci_gateway/cpp/sci_daskr.cpp
scilab/modules/differential_equations/sci_gateway/cpp/sci_ode.cpp
scilab/modules/differential_equations/sci_gateway/cpp/sci_odedc.cpp
scilab/modules/differential_equations/src/cpp/differentialequationfunctions.cpp
scilab/modules/elementary_functions/includes/gsort.hxx
scilab/modules/elementary_functions/sci_gateway/cpp/elem_func_gw.cpp
scilab/modules/elementary_functions/sci_gateway/cpp/sci_isequal.cpp
scilab/modules/elementary_functions/sci_gateway/cpp/sci_size.cpp
scilab/modules/elementary_functions/src/cpp/gsort.cpp
scilab/modules/elementary_functions/src/cpp/gsort.hxx
scilab/modules/external_objects/src/cpp/ScilabObjects.cpp
scilab/modules/fileio/includes/filemanager.hxx
scilab/modules/fileio/sci_gateway/cpp/fileio_gw.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_basename.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_createdir.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_deletefile.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_fileext.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_fileinfo.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_fileparts.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_filesep.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_get_absolute_file_path.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_getlongpathname.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_getrelativefilename.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_getshortpathname.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_isdir.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_isfile.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_mclearerr.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_meof.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_merror.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_mfprintf.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_mget.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_mgetl.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_mgetstr.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_mopen.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_mput.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_mputl.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_mputstr.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_mseek.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_mtell.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_pathconvert.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_removedir.cpp
scilab/modules/fileio/src/cpp/filemanager.cpp
scilab/modules/functions/sci_gateway/cpp/sci_exec.cpp
scilab/modules/functions/sci_gateway/cpp/sci_execstr.cpp
scilab/modules/functions/sci_gateway/cpp/sci_functionlist.cpp
scilab/modules/functions/sci_gateway/cpp/sci_getCurrentThreadId.cpp
scilab/modules/functions/sci_gateway/cpp/sci_getThreads.cpp
scilab/modules/functions/sci_gateway/cpp/sci_librarieslist.cpp
scilab/modules/functions/sci_gateway/cpp/sci_libraryinfo.cpp
scilab/modules/functions/sci_gateway/cpp/sci_macrovar.cpp
scilab/modules/functions/sci_gateway/cpp/sci_testAnalysis.cpp
scilab/modules/functions/sci_gateway/cpp/sci_testGVN.cpp
scilab/modules/functions/sci_gateway/cpp/sci_whereis.cpp
scilab/modules/functions_manager/includes/dynamic_modules.hxx
scilab/modules/functions_manager/includes/funcmanager.hxx
scilab/modules/functions_manager/src/cpp/dynamic_modules.cpp
scilab/modules/functions_manager/src/cpp/funcmanager.cpp
scilab/modules/graphics/includes/graphics_gw.hxx
scilab/modules/graphics/sci_gateway/cpp/graphics_gw.cpp
scilab/modules/graphics/src/cpp/configgraphicvariable.cpp
scilab/modules/graphics/src/cpp/configgraphicvariable.hxx
scilab/modules/gui/includes/gui_gw.hxx
scilab/modules/gui/sci_gateway/cpp/gui_gw.cpp
scilab/modules/gui/sci_gateway/cpp/sci_helpbrowser.cpp
scilab/modules/hdf5/sci_gateway/cpp/sci_hdf5_file_version.cpp
scilab/modules/integer/sci_gateway/cpp/integer_gw.cpp
scilab/modules/integer/sci_gateway/cpp/sci_inttype.cpp
scilab/modules/io/sci_gateway/cpp/sci_genlib.cpp
scilab/modules/io/sci_gateway/cpp/sci_host.cpp
scilab/modules/io/sci_gateway/cpp/sci_lib.cpp
scilab/modules/io/sci_gateway/cpp/sci_read.cpp
scilab/modules/io/sci_gateway/cpp/sci_write.cpp
scilab/modules/io/src/cpp/io_gw.cpp
scilab/modules/jvm/sci_gateway/cpp/sci_system_getproperty.cpp
scilab/modules/jvm/sci_gateway/cpp/sci_system_setproperty.cpp
scilab/modules/linear_algebra/src/cpp/scischur.cpp
scilab/modules/localization/sci_gateway/cpp/sci_getdefaultlanguage.cpp
scilab/modules/localization/sci_gateway/cpp/sci_getlanguage.cpp
scilab/modules/localization/sci_gateway/cpp/sci_setdefaultlanguage.cpp
scilab/modules/localization/sci_gateway/cpp/sci_setlanguage.cpp
scilab/modules/matio/src/cpp/ConvertSciVarToMatVar.cpp
scilab/modules/matio/src/cpp/ConvertSciVarToMatVar.hxx
scilab/modules/matio/src/cpp/CreateCellVariable.cpp
scilab/modules/matio/src/cpp/CreateHyperMatrixVariable.cpp
scilab/modules/matio/src/cpp/CreateMatlabTreeVariable.cpp
scilab/modules/matio/src/cpp/CreateMatlabTreeVariable.hxx
scilab/modules/matio/src/cpp/CreateStructVariable.cpp
scilab/modules/matio/src/cpp/GetCellVariable.cpp
scilab/modules/matio/src/cpp/GetStructVariable.cpp
scilab/modules/mexlib/src/cpp/mexlib.cpp
scilab/modules/optimization/includes/optimizationfunctions.hxx
scilab/modules/optimization/src/cpp/optimizationfunctions.cpp
scilab/modules/output_stream/src/cpp/DiaryList.cpp
scilab/modules/output_stream/src/cpp/DiaryList.hxx
scilab/modules/output_stream/src/cpp/scilab_sprintf.cpp
scilab/modules/polynomials/sci_gateway/cpp/sci_poly.cpp
scilab/modules/preferences/includes/preferences_gw.hxx
scilab/modules/preferences/sci_gateway/cpp/preferences_gw.cpp
scilab/modules/scicos/includes/view_scilab/Adapters.hxx
scilab/modules/scicos/src/cpp/sciblk4.cpp
scilab/modules/signal_processing/src/cpp/signalprocessingfunctions.cpp
scilab/modules/signal_processing/src/cpp/signalprocessingfunctions.hxx
scilab/modules/sparse/sci_gateway/cpp/sci_adj2sp.cpp
scilab/modules/sparse/sci_gateway/cpp/sci_nnz.cpp
scilab/modules/sparse/sci_gateway/cpp/sci_ordmmd.cpp
scilab/modules/sparse/sci_gateway/cpp/sci_sp2adj.cpp
scilab/modules/sparse/sci_gateway/cpp/sci_sparse.cpp
scilab/modules/sparse/sci_gateway/cpp/sci_spcompack.cpp
scilab/modules/sparse/sci_gateway/cpp/sci_spones.cpp
scilab/modules/string/sci_gateway/cpp/sci_ascii.cpp
scilab/modules/string/sci_gateway/cpp/sci_convstr.cpp
scilab/modules/string/sci_gateway/cpp/sci_grep.cpp
scilab/modules/string/sci_gateway/cpp/sci_length.cpp
scilab/modules/string/sci_gateway/cpp/sci_part.cpp
scilab/modules/string/sci_gateway/cpp/sci_regexp.cpp
scilab/modules/string/sci_gateway/cpp/sci_strcat.cpp
scilab/modules/string/sci_gateway/cpp/sci_strindex.cpp
scilab/modules/string/sci_gateway/cpp/sci_string.cpp
scilab/modules/string/sci_gateway/cpp/sci_strsubst.cpp
scilab/modules/types/Makefile.am
scilab/modules/types/Makefile.in
scilab/modules/types/includes/types_gw.hxx
scilab/modules/types/sci_gateway/cpp/sci_fieldnames.cpp
scilab/modules/types/sci_gateway/cpp/sci_insert.cpp
scilab/modules/types/sci_gateway/cpp/sci_inspectorDeleteUnreferencedItems.cpp
scilab/modules/types/sci_gateway/cpp/sci_inspectorGetFunctionList.cpp
scilab/modules/types/sci_gateway/cpp/sci_inspectorGetItem.cpp
scilab/modules/types/sci_gateway/cpp/sci_inspectorGetItemCount.cpp
scilab/modules/types/sci_gateway/cpp/sci_inspectorGetUnreferencedItem.cpp
scilab/modules/types/sci_gateway/cpp/sci_inspectorShowItem.cpp
scilab/modules/types/sci_gateway/cpp/sci_inspectorShowUnreferencedItem.cpp
scilab/modules/types/sci_gateway/cpp/sci_list.cpp
scilab/modules/types/sci_gateway/cpp/sci_mlist.cpp
scilab/modules/types/sci_gateway/cpp/sci_null.cpp
scilab/modules/types/sci_gateway/cpp/sci_struct.cpp
scilab/modules/types/sci_gateway/cpp/sci_tlist.cpp
scilab/modules/types/sci_gateway/cpp/sci_tlist_or_mlist.hxx
scilab/modules/types/sci_gateway/cpp/sci_usertype.cpp [deleted file]
scilab/modules/types/sci_gateway/cpp/types_gw.cpp
scilab/modules/types/sci_gateway/cpp/types_gw.vcxproj
scilab/modules/types/sci_gateway/cpp/types_gw.vcxproj.filters

index cde8a82..da81db9 100644 (file)
@@ -30,8 +30,6 @@ extern "C"
 #include "localization.h"
 }
 
-using namespace std;
-
 /********************************/
 /*   boolean matrix functions   */
 /********************************/
index 2440703..5001a90 100644 (file)
@@ -30,9 +30,6 @@ extern "C"
 #include "localization.h"
 }
 
-using namespace std;
-using namespace types;
-
 SciErr getBooleanSparseMatrix(void* _pvCtx, int* _piAddress, int* _piRows, int* _piCols, int* _piNbItem, int** _piNbItemRow, int** _piColPos)
 {
     SciErr sciErr = sciErrInit();
@@ -58,7 +55,7 @@ SciErr getBooleanSparseMatrix(void* _pvCtx, int* _piAddress, int* _piRows, int*
         return sciErr;
     }
 
-    SparseBool* pSpBool = ((InternalType*)_piAddress)->getAs<SparseBool>();
+    types::SparseBool* pSpBool = ((types::InternalType*)_piAddress)->getAs<types::SparseBool>();
     *_piNbItem = (int)pSpBool->nbTrue();
 
     if (_piNbItemRow == NULL)
@@ -100,7 +97,7 @@ SciErr fillBooleanSparseMatrix(void* _pvCtx, int* _piAddress, int _iRows, int _i
         return sciErr;
     }
 
-    SparseBool* pSparse = (SparseBool*)_piAddress;
+    types::SparseBool* pSparse = (types::SparseBool*)_piAddress;
 
     for (int i = 0; i < _iRows; i++)
     {
@@ -129,10 +126,10 @@ SciErr createBooleanSparseMatrix(void* _pvCtx, int _iVar, int _iRows, int _iCols
         return sciErr;
     }
 
-    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
-    InternalType** out = pStr->m_pOut;
+    types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
+    types::InternalType** out = pStr->m_pOut;
 
-    types::SparseBool* pSparse = new SparseBool(_iRows, _iCols);
+    types::SparseBool* pSparse = new types::SparseBool(_iRows, _iCols);
     if (pSparse == NULL)
     {
         addErrorMessage(&sciErr, API_ERROR_CREATE_BOOLEAN_SPARSE, _("%s: Unable to create variable in Scilab memory"), "createBooleanSparseMatrix");
@@ -175,7 +172,7 @@ SciErr createNamedBooleanSparseMatrix(void* _pvCtx, const char* _pstName, int _i
         return sciErr;
     }
 
-    types::SparseBool* pSparse = new SparseBool(_iRows, _iCols);
+    types::SparseBool* pSparse = new types::SparseBool(_iRows, _iCols);
     if (pSparse == NULL)
     {
         addErrorMessage(&sciErr, API_ERROR_CREATE_NAMED_BOOLEAN_SPARSE, _("%s: Unable to create %s named \"%s\""), "createNamedBooleanSparseMatrix", _("boolean sparse matrix"), _pstName);
index c255930..6705506 100644 (file)
@@ -20,7 +20,6 @@
 #include "gatewaystruct.hxx"
 #include "double.hxx"
 #include "polynom.hxx"
-#include "gatewaystruct.hxx"
 #include "overload.hxx"
 #include "context.hxx"
 #include "symbol.hxx"
@@ -45,7 +44,6 @@ extern "C"
     //StrCtx *pvApiCtx = NULL;
 }
 
-using namespace types;
 /*--------------------------------------------------------------------------*/
 static SciErr getinternalVarAddress(void* _pvCtx, int _iVar, int** _piAddress);
 
@@ -53,7 +51,7 @@ static SciErr getinternalVarAddress(void* _pvCtx, int _iVar, int** _piAddress);
 /* Replaces Rhs */
 int* getNbInputArgument(void* _pvCtx)
 {
-    GatewayStruct *pStr =  (GatewayStruct*)_pvCtx;
+    types::GatewayStruct *pStr = (types::GatewayStruct*)_pvCtx;
 
     if (pStr == NULL)
     {
@@ -73,7 +71,7 @@ int* getNbInputArgument(void* _pvCtx)
 /* Replaces Lhs */
 int* getNbOutputArgument(void* _pvCtx)
 {
-    GatewayStruct *pStr =  (GatewayStruct*)_pvCtx;
+    types::GatewayStruct *pStr =  (types::GatewayStruct*)_pvCtx;
 
     if (pStr == NULL)
     {
@@ -96,7 +94,7 @@ int* assignOutputVariable(void* _pvCtx, int _iVal)
         return &api_fake_int;
     }
 
-    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
+    types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
 
     //do nothing but don't crash
     if (_iVal > *pStr->m_piRetCount || (_iVal - 1) < 0)
@@ -117,7 +115,7 @@ int checkInputArgument(void* _pvCtx, int _iMin, int _iMax)
 {
     SciErr sciErr = sciErrInit();
 
-    GatewayStruct *pStr = (GatewayStruct*)_pvCtx;
+    types::GatewayStruct *pStr = (types::GatewayStruct*)_pvCtx;
     int iRhs            = *getNbInputArgument(_pvCtx);
 
     if (_iMin <= nbInputArgument(_pvCtx) && _iMax >= nbInputArgument(_pvCtx))
@@ -141,14 +139,14 @@ SciErr reshapeArray(void* _pvCtx, int* _piAddress, int* _iDimsArray, int _iDims)
 {
     SciErr sciErr = sciErrInit();
 
-    InternalType* pIT = ((InternalType*)_piAddress);
+    types::InternalType* pIT = (types::InternalType*)_piAddress;
     if (pIT->isGenericType() == false)
     {
         addErrorMessage(&sciErr, API_ERROR_INVALID_TYPE, _("%s: Invalid argument type, %s expected"), "resizeArray", _("matrix"));
         return sciErr;
     }
 
-    pIT->getAs<GenericType>()->reshape(_iDimsArray, _iDims);
+    pIT->getAs<types::GenericType>()->reshape(_iDimsArray, _iDims);
 
     return sciErr;
 }
@@ -163,7 +161,7 @@ int checkInputArgumentAtLeast(void* _pvCtx, int _iMin)
         return 1;
     }
 
-    Scierror(77, _("%s: Wrong number of input argument(s): at least %d expected.\n"), ((GatewayStruct*)_pvCtx)->m_pstName, _iMin);
+    Scierror(77, _("%s: Wrong number of input argument(s): at least %d expected.\n"), ((types::GatewayStruct*)_pvCtx)->m_pstName, _iMin);
     return 0;
 }
 
@@ -177,7 +175,7 @@ int checkInputArgumentAtMost(void* _pvCtx, int _iMax)
         return 1;
     }
 
-    Scierror(77, _("%s: Wrong number of input argument(s): at most %d expected.\n"), ((GatewayStruct*)_pvCtx)->m_pstName, _iMax);
+    Scierror(77, _("%s: Wrong number of input argument(s): at most %d expected.\n"), ((types::GatewayStruct*)_pvCtx)->m_pstName, _iMax);
     return 0;
 }
 
@@ -193,11 +191,11 @@ int checkOutputArgument(void* _pvCtx, int _iMin, int _iMax)
 
     if (_iMax == _iMin)
     {
-        Scierror(78, _("%s: Wrong number of output argument(s): %d expected.\n"), ((GatewayStruct*)_pvCtx)->m_pstName, _iMax);
+        Scierror(78, _("%s: Wrong number of output argument(s): %d expected.\n"), ((types::GatewayStruct*)_pvCtx)->m_pstName, _iMax);
     }
     else
     {
-        Scierror(78, _("%s: Wrong number of output argument(s): %d to %d expected.\n"), ((GatewayStruct*)_pvCtx)->m_pstName, _iMin, _iMax);
+        Scierror(78, _("%s: Wrong number of output argument(s): %d to %d expected.\n"), ((types::GatewayStruct*)_pvCtx)->m_pstName, _iMin, _iMax);
     }
 
     return 0;
@@ -213,7 +211,7 @@ int checkOutputArgumentAtLeast(void* _pvCtx, int _iMin)
         return 1;
     }
 
-    Scierror(78, _("%s: Wrong number of output argument(s): at least %d expected.\n"), ((GatewayStruct*)_pvCtx)->m_pstName, _iMin);
+    Scierror(78, _("%s: Wrong number of output argument(s): at least %d expected.\n"), ((types::GatewayStruct*)_pvCtx)->m_pstName, _iMin);
     return 0;
 }
 
@@ -227,21 +225,21 @@ int checkOutputArgumentAtMost(void* _pvCtx, int _iMax)
         return 1;
     }
 
-    Scierror(78, _("%s: Wrong number of output argument(s): at most %d expected.\n"), ((GatewayStruct*)_pvCtx)->m_pstName, _iMax);
+    Scierror(78, _("%s: Wrong number of output argument(s): at most %d expected.\n"), ((types::GatewayStruct*)_pvCtx)->m_pstName, _iMax);
     return 0;
 }
 
 /*--------------------------------------------------------------------------*/
 int callScilabFunction(void* _pvCtx, char const* _pstName, int _iStart, int _iLhs, int _iRhs)
 {
-    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
-    Function::ReturnValue callResult;
+    types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
+    types::Function::ReturnValue callResult;
 
     wchar_t* pwstName = to_wide_string(_pstName);
     std::wstring wsFunName(pwstName);
 
-    typed_list in;
-    typed_list out;
+    types::typed_list in;
+    types::typed_list out;
 
 
     for (int i = 0 ; i < _iRhs ; i++)
@@ -258,7 +256,7 @@ int callScilabFunction(void* _pvCtx, char const* _pstName, int _iStart, int _iLh
         in[i]->DecreaseRef();
     }
 
-    if (callResult == Function::OK)
+    if (callResult == types::Function::OK)
     {
         int iCallerRhs = (int)pStr->m_pIn->size();
         pStr->m_pIn->resize(iCallerRhs + _iRhs + _iLhs, NULL);
@@ -275,9 +273,9 @@ int callScilabFunction(void* _pvCtx, char const* _pstName, int _iStart, int _iLh
 
 int callOverloadFunction(void* _pvCtx, int _iVar, char* _pstName, unsigned int _iNameLen)
 {
-    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
-    Function::ReturnValue callResult;
-    typed_list tlReturnedValues;
+    types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
+    types::Function::ReturnValue callResult;
+    types::typed_list tlReturnedValues;
 
     wchar_t* pwstName = NULL;
     if (_pstName == NULL || strlen(_pstName) == 0)
@@ -313,10 +311,10 @@ int callOverloadFunction(void* _pvCtx, int _iVar, char* _pstName, unsigned int _
         (*pStr->m_pIn)[i]->DecreaseRef();
     }
 
-    if (callResult == Function::OK)
+    if (callResult == types::Function::OK)
     {
         int i = 0;
-        typed_list::iterator it;
+        types::typed_list::iterator it;
         for (it = tlReturnedValues.begin() ; it != tlReturnedValues.end() ; ++it, ++i)
         {
             (pStr->m_pOut)[i] = *it;
@@ -335,8 +333,8 @@ SciErr getVarDimension(void *_pvCtx, int *_piAddress, int *_piRows, int *_piCols
 
     if (_piAddress != NULL && isVarMatrixType(_pvCtx, _piAddress))
     {
-        *_piRows = ((InternalType*)_piAddress)->getAs<GenericType>()->getRows();
-        *_piCols = ((InternalType*)_piAddress)->getAs<GenericType>()->getCols();
+        *_piRows = ((types::InternalType*)_piAddress)->getAs<types::GenericType>()->getRows();
+        *_piCols = ((types::InternalType*)_piAddress)->getAs<types::GenericType>()->getCols();
     }
     else
     {
@@ -398,9 +396,9 @@ static SciErr getinternalVarAddress(void *_pvCtx, int _iVar, int **_piAddress)
         return sciErr;
     }
 
-    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
-    typed_list in = *pStr->m_pIn;
-    optional_list opt = *pStr->m_pOpt;
+    types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
+    types::typed_list in = *pStr->m_pIn;
+    types::optional_list opt = *pStr->m_pOpt;
     int* piRetCount = pStr->m_piRetCount;
     int iInputSize = static_cast<int>(in.size()) + static_cast<int>(opt.size());
 
@@ -438,8 +436,8 @@ SciErr getVarNameFromPosition(void *_pvCtx, int _iVar, char *_pstName)
         return sciErr;
     }
 
-    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
-    typed_list in = *pStr->m_pIn;
+    types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
+    types::typed_list in = *pStr->m_pIn;
 
     if (in[_iVar - 1]->isCallable())
     {
@@ -466,7 +464,7 @@ SciErr getVarAddressFromName(void *_pvCtx, const char *_pstName, int **_piAddres
 
     wchar_t* pwstName = to_wide_string(_pstName);
     symbol::Context* pCtx = symbol::Context::getInstance();
-    InternalType* pVar = pCtx->get(symbol::Symbol(pwstName));
+    types::InternalType* pVar = pCtx->get(symbol::Symbol(pwstName));
     FREE(pwstName);
 
     if (pVar == NULL)
@@ -492,75 +490,75 @@ SciErr getVarType(void *_pvCtx, int *_piAddress, int *_piType)
         return sciErr;
     }
 
-    switch (((InternalType*)_piAddress)->getType())
+    switch (((types::InternalType*)_piAddress)->getType())
     {
-        case GenericType::ScilabDouble :
+        case types::InternalType::ScilabDouble :
             *_piType = sci_matrix;
             break;
-        case GenericType::ScilabPolynom :
+        case types::InternalType::ScilabPolynom :
             *_piType = sci_poly;
             break;
-        case GenericType::ScilabBool :
+        case types::InternalType::ScilabBool :
             *_piType = sci_boolean;
             break;
-        case GenericType::ScilabSparse :
+        case types::InternalType::ScilabSparse :
             *_piType = sci_sparse;
             break;
-        case GenericType::ScilabSparseBool :
+        case types::InternalType::ScilabSparseBool :
             *_piType = sci_boolean_sparse;
             break;
-        //case GenericType::RealMatlabSparse :
+        //case types::InternalType::RealMatlabSparse :
         //    *_piType = sci_matlab_sparse;
         //    break;
-        case GenericType::ScilabInt8 :
-        case GenericType::ScilabUInt8 :
-        case GenericType::ScilabInt16 :
-        case GenericType::ScilabUInt16 :
-        case GenericType::ScilabInt32 :
-        case GenericType::ScilabUInt32 :
-        case GenericType::ScilabInt64 :
-        case GenericType::ScilabUInt64 :
+        case types::InternalType::ScilabInt8 :
+        case types::InternalType::ScilabUInt8 :
+        case types::InternalType::ScilabInt16 :
+        case types::InternalType::ScilabUInt16 :
+        case types::InternalType::ScilabInt32 :
+        case types::InternalType::ScilabUInt32 :
+        case types::InternalType::ScilabInt64 :
+        case types::InternalType::ScilabUInt64 :
             *_piType = sci_ints;
             break;
-        case GenericType::ScilabHandle :
+        case types::InternalType::ScilabHandle :
             *_piType = sci_handles;
             break;
-        case GenericType::ScilabString :
+        case types::InternalType::ScilabString :
             *_piType = sci_strings;
             break;
-        case GenericType::ScilabMacroFile :
+        case types::InternalType::ScilabMacroFile :
             *_piType = sci_u_function;
             break;
-        case GenericType::ScilabMacro :
+        case types::InternalType::ScilabMacro :
             *_piType = sci_c_function;
             break;
-        case GenericType::ScilabList :
+        case types::InternalType::ScilabList :
             *_piType = sci_list;
             break;
-        case GenericType::ScilabCell :
+        case types::InternalType::ScilabCell :
             *_piType = sci_mlist;
             break;
-        case GenericType::ScilabTList :
+        case types::InternalType::ScilabTList :
             *_piType = sci_tlist;
             break;
-        case GenericType::ScilabMList :
+        case types::InternalType::ScilabMList :
             *_piType = sci_mlist;
             break;
-        case GenericType::ScilabStruct :
+        case types::InternalType::ScilabStruct :
             // Scilab < 6 compatibility... Struct have type 17;
             *_piType = sci_mlist;
             break;
-        case GenericType::ScilabUserType :
+        case types::InternalType::ScilabUserType :
             *_piType = sci_pointer;
             break;
-        case GenericType::ScilabColon :
-        case GenericType::ScilabImplicitList :
+        case types::InternalType::ScilabColon :
+        case types::InternalType::ScilabImplicitList :
             *_piType = sci_implicit_poly;
             break;
-        case GenericType::ScilabFunction:
+        case types::InternalType::ScilabFunction:
             *_piType = sci_intrinsic_function;
             break;
-        case GenericType::ScilabLibrary:
+        case types::InternalType::ScilabLibrary:
             *_piType = sci_lib;
             break;
         default:
@@ -606,8 +604,8 @@ int isVarComplex(void *_pvCtx, int *_piAddress)
         return 0;
     }
 
-    InternalType* pIT = (InternalType*)_piAddress;
-    GenericType* pGT = dynamic_cast<GenericType*>(pIT);
+    types::InternalType* pIT = (types::InternalType*)_piAddress;
+    types::GenericType* pGT = dynamic_cast<types::GenericType*>(pIT);
     if (pGT == NULL)
     {
         addErrorMessage(&sciErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "isVarComplex");
@@ -1024,8 +1022,8 @@ SciErr getDimFromNamedVar(void *_pvCtx, const char *_pstName, int *_piVal)
 int getRhsFromAddress(void *_pvCtx, int *_piAddress)
 {
     int i = 0;
-    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
-    typed_list in = *pStr->m_pIn;
+    types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
+    types::typed_list in = *pStr->m_pIn;
 
     for (i = 0 ; i < in.size() ; i++)
     {
@@ -1172,7 +1170,7 @@ int isNamedVector(void *_pvCtx, const char *_pstName)
 /*--------------------------------------------------------------------------*/
 int isStruct(void *_pvCtx, int *_piAddress)
 {
-    if (((InternalType*)_piAddress)->getType() == GenericType::ScilabStruct)
+    if (((types::InternalType*)_piAddress)->getType() == types::InternalType::ScilabStruct)
     {
         return 1;
     }
@@ -1181,7 +1179,7 @@ int isStruct(void *_pvCtx, int *_piAddress)
 /*--------------------------------------------------------------------------*/
 int isCell(void *_pvCtx, int *_piAddress)
 {
-    if (((InternalType*)_piAddress)->getType() == GenericType::ScilabCell)
+    if (((types::InternalType*)_piAddress)->getType() == types::InternalType::ScilabCell)
     {
         return 1;
     }
@@ -1621,4 +1619,4 @@ void sciErrClean(SciErr* _psciErr)
     }
 
     _psciErr->iMsgCount = 0;
-}
\ No newline at end of file
+}
index 02251e1..05f2cc4 100644 (file)
@@ -33,8 +33,6 @@ extern "C"
     extern int C2F(icopy)(int *, int *, int *, int *, int *);
 }
 
-using namespace types;
-
 /*******************************/
 /*   double matrix functions   */
 /*******************************/
@@ -68,7 +66,7 @@ SciErr getComplexZMatrixOfDouble(void* _pvCtx, int* _piAddress, int* _piRows, in
         return sciErr;
     }
 
-    Double* pDbl = (Double*)_piAddress;
+    types::Double* pDbl = (types::Double*)_piAddress;
     pDbl->convertToZComplex();
     *_pdblZ    = (doublecomplex*)(pDbl->get());
     return sciErr;
@@ -90,7 +88,7 @@ SciErr getMatrixOfDoubleAsInteger(void* _pvCtx, int* _piAddress, int* _piRows, i
     //Warning we overwrite double by int !!!!
     C2F(entier)(&iSize, pdblReal, *_piReal);
 
-    Double* pD = (Double*)_piAddress;
+    types::Double* pD = (types::Double*)_piAddress;
     pD->setViewAsInteger();
 
     return sciErr;
@@ -107,7 +105,7 @@ SciErr getComplexMatrixOfDoubleAsInteger(void* _pvCtx, int* _piAddress, int* _pi
         return sciErr;
     }
 
-    Double* pD = (Double*)_piAddress;
+    types::Double* pD = (types::Double*)_piAddress;
     //convert values and view of data to int and int*
     pD->convertToInteger();
 
@@ -143,12 +141,12 @@ SciErr getCommonMatrixOfDouble(void* _pvCtx, int* _piAddress, char _cType, int _
 
     if (_pdblReal != NULL)
     {
-        *_pdblReal = ((InternalType*)_piAddress)->getAs<Double>()->getReal();
+        *_pdblReal = ((types::InternalType*)_piAddress)->getAs<types::Double>()->getReal();
     }
 
     if (_iComplex && _pdblImg != NULL)
     {
-        *_pdblImg = ((InternalType*)_piAddress)->getAs<Double>()->getImg();
+        *_pdblImg = ((types::InternalType*)_piAddress)->getAs<types::Double>()->getImg();
     }
 
     return sciErr;
@@ -229,19 +227,19 @@ SciErr allocCommonMatrixOfDouble(void* _pvCtx, int _iVar, char _cType, int _iCom
         return sciErr;
     }
 
-    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
-    InternalType** out = pStr->m_pOut;
+    types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
+    types::InternalType** out = pStr->m_pOut;
 
-    Double* pDbl = NULL;
+    types::Double* pDbl = NULL;
     try
     {
         if (_cType == 'z')
         {
-            pDbl = new Double(_iRows, _iCols, _iComplex == 1, true);
+            pDbl = new types::Double(_iRows, _iCols, _iComplex == 1, true);
         }
         else
         {
-            pDbl = new Double(_iRows, _iCols, _iComplex == 1);
+            pDbl = new types::Double(_iRows, _iCols, _iComplex == 1);
             if (_cType == 'i')
             {
                 pDbl->setViewAsInteger();
@@ -415,7 +413,7 @@ SciErr createNamedComplexZMatrixOfDouble(void* _pvCtx, const char* _pstName, int
         return sciErr;
     }
 
-    Double* pDbl = new Double(_iRows, _iCols, true);
+    types::Double* pDbl = new types::Double(_iRows, _iCols, true);
 
     double* pdblReal = pDbl->get();
     double* pdblImg = pDbl->getImg();
@@ -452,7 +450,7 @@ SciErr createCommonNamedMatrixOfDouble(void* _pvCtx, const char* _pstName, int _
     int iOne                                   = 1;
     int iSize                                  = _iRows * _iCols;
 
-    Double* pDbl = new Double(_iRows, _iCols, _iComplex == 1);
+    types::Double* pDbl = new types::Double(_iRows, _iCols, _iComplex == 1);
 
     double* pdblReal = pDbl->get();
     C2F(dcopy)(&iSize, const_cast<double*>(_pdblReal), &iOne, pdblReal, &iOne);
index 45cc27f..0bdf9e2 100644 (file)
@@ -27,10 +27,6 @@ extern "C"
 #include "call_scilab.h"
 }
 
-using namespace std;
-using namespace types;
-
-
 SciErr getMatrixOfHandle(void* _pvCtx, int* _piAddress, int* _piRows, int* _piCols, long long** _pllHandle)
 {
     SciErr sciErr = sciErrInit();
@@ -58,7 +54,7 @@ SciErr getMatrixOfHandle(void* _pvCtx, int* _piAddress, int* _piRows, int* _piCo
 
     if (_pllHandle)
     {
-        *_pllHandle = ((InternalType*)_piAddress)->getAs<types::GraphicHandle>()->get();
+        *_pllHandle = ((types::InternalType*)_piAddress)->getAs<types::GraphicHandle>()->get();
     }
     return sciErr;
 }
@@ -73,11 +69,11 @@ SciErr allocMatrixOfHandle(void* _pvCtx, int _iVar, int _iRows, int _iCols, long
         return sciErr;
     }
 
-    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
-    typed_list in = *pStr->m_pIn;
-    InternalType** out = pStr->m_pOut;
+    types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
+    types::typed_list in = *pStr->m_pIn;
+    types::InternalType** out = pStr->m_pOut;
 
-    GraphicHandle *pHandle = new GraphicHandle(_iRows, _iCols);
+    types::GraphicHandle *pHandle = new types::GraphicHandle(_iRows, _iCols);
     if (pHandle == NULL)
     {
         addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: No more memory to allocated variable"), "allocMatrixOfHandle");
index c2f3556..f49cdba 100644 (file)
@@ -27,7 +27,6 @@ extern "C"
 #include "api_internal_common.h"
 }
 
-using namespace types;
 static int getCommonScalarInteger(void* _pvCtx, int* _piAddress, int _iPrec, void** _pvData);
 static int getCommonNamedScalarInteger(void* _pvCtx, const char* _pstName, int _iPrec, void** _pvData);
 
@@ -41,36 +40,36 @@ SciErr getMatrixOfIntegerPrecision(void* _pvCtx, int* _piAddress, int* _piPrecis
         return sciErr;
     }
 
-    if (!((InternalType*)_piAddress)->isInt())
+    if (!((types::InternalType*)_piAddress)->isInt())
     {
         addErrorMessage(&sciErr, API_ERROR_INVALID_TYPE, _("%s: Invalid argument type, %s expected"), "getMatrixOfIntegerPrecision", _("int matrix"));
         return sciErr;
     }
 
-    switch (((InternalType*)_piAddress)->getType())
+    switch (((types::InternalType*)_piAddress)->getType())
     {
-        case GenericType::ScilabInt8 :
+        case types::InternalType::ScilabInt8 :
             *_piPrecision = SCI_INT8;
             break;
-        case GenericType::ScilabUInt8 :
+        case types::InternalType::ScilabUInt8 :
             *_piPrecision = SCI_UINT8;
             break;
-        case GenericType::ScilabInt16 :
+        case types::InternalType::ScilabInt16 :
             *_piPrecision = SCI_INT16;
             break;
-        case GenericType::ScilabUInt16 :
+        case types::InternalType::ScilabUInt16 :
             *_piPrecision = SCI_UINT16;
             break;
-        case GenericType::ScilabInt32 :
+        case types::InternalType::ScilabInt32 :
             *_piPrecision = SCI_INT32;
             break;
-        case GenericType::ScilabUInt32 :
+        case types::InternalType::ScilabUInt32 :
             *_piPrecision = SCI_UINT32;
             break;
-        case GenericType::ScilabInt64 :
+        case types::InternalType::ScilabInt64 :
             *_piPrecision = SCI_INT64;
             break;
-        case GenericType::ScilabUInt64 :
+        case types::InternalType::ScilabUInt64 :
             *_piPrecision = SCI_UINT64;
             break;
         default:
@@ -154,31 +153,31 @@ SciErr getCommonMatrixOfInteger(void* _pvCtx, int* _piAddress, int _iPrecision,
         return sciErr;
     }
 
-    switch (((InternalType*)_piAddress)->getType())
+    switch (((types::InternalType*)_piAddress)->getType())
     {
-        case GenericType::ScilabInt8 :
-            *_piData   = (void*)((InternalType*)_piAddress)->getAs<types::Int8>()->get();
+        case types::InternalType::ScilabInt8 :
+            *_piData = (void*)((types::InternalType*)_piAddress)->getAs<types::Int8>()->get();
             break;
-        case GenericType::ScilabUInt8 :
-            *_piData   = (void*)((InternalType*)_piAddress)->getAs<types::UInt8>()->get();
+        case types::InternalType::ScilabUInt8 :
+            *_piData = (void*)((types::InternalType*)_piAddress)->getAs<types::UInt8>()->get();
             break;
-        case GenericType::ScilabInt16 :
-            *_piData   = (void*)((InternalType*)_piAddress)->getAs<types::Int16>()->get();
+        case types::InternalType::ScilabInt16 :
+            *_piData = (void*)((types::InternalType*)_piAddress)->getAs<types::Int16>()->get();
             break;
-        case GenericType::ScilabUInt16 :
-            *_piData   = (void*)((InternalType*)_piAddress)->getAs<types::UInt16>()->get();
+        case types::InternalType::ScilabUInt16 :
+            *_piData   = (void*)((types::InternalType*)_piAddress)->getAs<types::UInt16>()->get();
             break;
-        case GenericType::ScilabInt32 :
-            *_piData   = (void*)((InternalType*)_piAddress)->getAs<types::Int32>()->get();
+        case types::InternalType::ScilabInt32 :
+            *_piData   = (void*)((types::InternalType*)_piAddress)->getAs<types::Int32>()->get();
             break;
-        case GenericType::ScilabUInt32 :
-            *_piData   = (void*)((InternalType*)_piAddress)->getAs<types::UInt32>()->get();
+        case types::InternalType::ScilabUInt32 :
+            *_piData   = (void*)((types::InternalType*)_piAddress)->getAs<types::UInt32>()->get();
             break;
-        case GenericType::ScilabInt64 :
-            *_piData   = (void*)((InternalType*)_piAddress)->getAs<types::Int64>()->get();
+        case types::InternalType::ScilabInt64 :
+            *_piData   = (void*)((types::InternalType*)_piAddress)->getAs<types::Int64>()->get();
             break;
-        case GenericType::ScilabUInt64 :
-            *_piData   = (void*)((InternalType*)_piAddress)->getAs<types::UInt64>()->get();
+        case types::InternalType::ScilabUInt64 :
+            *_piData   = (void*)((types::InternalType*)_piAddress)->getAs<types::UInt64>()->get();
             break;
         default:
             return sciErr;
@@ -666,35 +665,35 @@ SciErr allocCommonMatrixOfInteger(void* _pvCtx, int _iVar, int *_piAddress, int
         return sciErr;
     }
 
-    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
-    InternalType** out = pStr->m_pOut;
+    types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
+    types::InternalType** out = pStr->m_pOut;
 
-    InternalType *pIT;
+    types::InternalType *pIT = nullptr;
     switch (_iPrecision)
     {
         case SCI_INT8 :
-            pIT = new Int8(_iRows, _iCols, (char**)_pvData);
+            pIT = new types::Int8(_iRows, _iCols, (char**)_pvData);
             break;
         case SCI_UINT8 :
-            pIT = new UInt8(_iRows, _iCols, (unsigned char**)_pvData);
+            pIT = new types::UInt8(_iRows, _iCols, (unsigned char**)_pvData);
             break;
         case SCI_INT16 :
-            pIT = new Int16(_iRows, _iCols, (short**)_pvData);
+            pIT = new types::Int16(_iRows, _iCols, (short**)_pvData);
             break;
         case SCI_UINT16 :
-            pIT = new UInt16(_iRows, _iCols, (unsigned short**)_pvData);
+            pIT = new types::UInt16(_iRows, _iCols, (unsigned short**)_pvData);
             break;
         case SCI_INT32 :
-            pIT = new Int32(_iRows, _iCols, (int**)_pvData);
+            pIT = new types::Int32(_iRows, _iCols, (int**)_pvData);
             break;
         case SCI_UINT32 :
-            pIT = new UInt32(_iRows, _iCols, (unsigned int**)_pvData);
+            pIT = new types::UInt32(_iRows, _iCols, (unsigned int**)_pvData);
             break;
         case SCI_INT64 :
-            pIT = new Int64(_iRows, _iCols, (long long**)_pvData);
+            pIT = new types::Int64(_iRows, _iCols, (long long**)_pvData);
             break;
         case SCI_UINT64 :
-            pIT = new UInt64(_iRows, _iCols, (unsigned long long**)_pvData);
+            pIT = new types::UInt64(_iRows, _iCols, (unsigned long long**)_pvData);
             break;
     }
 
@@ -775,58 +774,66 @@ SciErr createCommonNamedMatrixOfInteger(void* _pvCtx, const char* _pstName, int
         return sciErr;
     }
 
-    InternalType *pIT;
+    types::InternalType *pIT = nullptr;
     switch (_iPrecision)
     {
         case SCI_INT8 :
-            Int8 *pInt8;
-            pInt8 = new Int8(_iRows, _iCols);
+        {
+            types::Int8 *pInt8 = new types::Int8(_iRows, _iCols);
             pInt8->set((char*)_pvData);
             pIT = pInt8;
             break;
-        case SCI_UINT8 :
-            UInt8 *pUInt8;
-            pUInt8 = new UInt8(_iRows, _iCols);
+        }
+        case SCI_UINT8:
+        {
+            types::UInt8 *pUInt8 = new types::UInt8(_iRows, _iCols);
             pUInt8->set((unsigned char*)_pvData);
             pIT = pUInt8;
             break;
+        }
         case SCI_INT16 :
-            Int16 *pInt16;
-            pInt16 = new Int16(_iRows, _iCols);
+        {
+            types::Int16 *pInt16 = new types::Int16(_iRows, _iCols);
             pInt16->set((short*)_pvData);
             pIT = pInt16;
             break;
-        case SCI_UINT16 :
-            UInt16 *pUInt16;
-            pUInt16 = new UInt16(_iRows, _iCols);
+        }
+        case SCI_UINT16:
+        {
+            types::UInt16 *pUInt16 = new types::UInt16(_iRows, _iCols);
             pUInt16->set((unsigned short*)_pvData);
             pIT = pUInt16;
             break;
-        case SCI_INT32 :
-            Int32 *pInt32;
-            pInt32 = new Int32(_iRows, _iCols);
+        }
+        case SCI_INT32:
+        {
+            types::Int32 *pInt32 = new types::Int32(_iRows, _iCols);
             pInt32->set((int*)_pvData);
             pIT = pInt32;
             break;
-        case SCI_UINT32 :
-            UInt32 *pUInt32;
-            pUInt32 = new UInt32(_iRows, _iCols);
+        }
+        case SCI_UINT32:
+        {
+            types::UInt32 *pUInt32 = new types::UInt32(_iRows, _iCols);
             pUInt32->set((unsigned int*)_pvData);
             pIT = pUInt32;
             break;
-        case SCI_INT64 :
-            Int64 *pInt64;
-            pInt64 = new Int64(_iRows, _iCols);
+        }
+        case SCI_INT64:
+        {
+            types::Int64 *pInt64 = new types::Int64(_iRows, _iCols);
             pInt64->set((long long*)_pvData);
             pIT = pInt64;
             break;
-        case SCI_UINT64 :
-            UInt64 *pUInt64;
-            pUInt64 = new UInt64(_iRows, _iCols);
+        }
+        case SCI_UINT64:
+        {
+            types::UInt64 *pUInt64 = new types::UInt64(_iRows, _iCols);
             pUInt64->set((unsigned long long*)_pvData);
             pIT = pUInt64;
             break;
     }
+}
 
     if (pIT == NULL)
     {
@@ -861,7 +868,7 @@ SciErr getNamedMatrixOfIntegerPrecision(void* _pvCtx, const char* _pstName, int*
         return sciErr;
     }
 
-    InternalType* pIT = (InternalType*)piAddr;
+    types::InternalType* pIT = (types::InternalType*)piAddr;
 
     //check variable type
     if (pIT->isInt() == false)
@@ -872,28 +879,28 @@ SciErr getNamedMatrixOfIntegerPrecision(void* _pvCtx, const char* _pstName, int*
 
     switch (pIT->getType())
     {
-        case InternalType::ScilabInt8 :
+        case types::InternalType::ScilabInt8 :
             *_piPrecision = sci_int8;
             break;
-        case InternalType::ScilabUInt8 :
+        case types::InternalType::ScilabUInt8 :
             *_piPrecision = sci_uint8;
             break;
-        case InternalType::ScilabInt16 :
+        case types::InternalType::ScilabInt16 :
             *_piPrecision = sci_int16;
             break;
-        case InternalType::ScilabUInt16 :
+        case types::InternalType::ScilabUInt16 :
             *_piPrecision = sci_uint16;
             break;
-        case InternalType::ScilabInt32 :
+        case types::InternalType::ScilabInt32 :
             *_piPrecision = sci_int32;
             break;
-        case InternalType::ScilabUInt32 :
+        case types::InternalType::ScilabUInt32 :
             *_piPrecision = sci_uint32;
             break;
-        case InternalType::ScilabInt64 :
+        case types::InternalType::ScilabInt64 :
             *_piPrecision = sci_int64;
             break;
-        case InternalType::ScilabUInt64 :
+        case types::InternalType::ScilabUInt64 :
             *_piPrecision = sci_uint64;
             break;
         default :
index b2e657e..a4e3ef9 100644 (file)
@@ -47,8 +47,6 @@ extern "C"
 #include "localization.h"
 }
 
-using namespace types;
-
 //internal functions
 static SciErr checkListItemPosition(void* _pvCtx, int* _piParent, int _iItemPos, int _apiError, const char* _functionName);
 static SciErr createCommonList(void* _pvCtx, int _iVar, int _iListType, int _iNbItem, int** _piAddress);
@@ -101,7 +99,7 @@ SciErr getListItemNumber(void* _pvCtx, int* _piAddress, int* _piNbItem)
         return sciErr;
     }
 
-    List* pL = (List*)_piAddress;
+    types::List* pL = (types::List*)_piAddress;
     switch (iType)
     {
         case sci_list :
@@ -130,9 +128,9 @@ SciErr getListItemAddress(void* _pvCtx, int* _piAddress, int _iItemNum, int** _p
         return sciErr;
     }
 
-    List* pL = (List*)_piAddress;
+    types::List* pL = (types::List*)_piAddress;
     //get offset of item array
-    InternalType* pIT = pL->get(_iItemNum - 1);
+    types::InternalType* pIT = pL->get(_iItemNum - 1);
     if (pIT->isListUndefined())
     {
         *_piItemAddress = NULL;
@@ -222,20 +220,20 @@ static SciErr createCommonNamedList(void* _pvCtx, const char* _pstName, int _iLi
         return sciErr;
     }
 
-    List* pL = NULL;
+    types::List* pL = NULL;
     try
     {
         if (_iListType == sci_list)
         {
-            pL = new List();
+            pL = new types::List();
         }
         else if (_iListType == sci_mlist)
         {
-            pL = new MList();
+            pL = new types::MList();
         }
         else if (_iListType == sci_tlist)
         {
-            pL = new TList();
+            pL = new types::TList();
         }
         else
         {
@@ -258,7 +256,7 @@ static SciErr createCommonNamedList(void* _pvCtx, const char* _pstName, int _iLi
     *_piAddress = (int*)pL;
     // create a list with the user number of items
     // it helps to check a wrong item, for example in createCommonListInList
-    pL->set(_iNbItem - 1, new ListUndefined());
+    pL->set(_iNbItem - 1, new types::ListUndefined());
 
     wchar_t* pwstName = to_wide_string(_pstName);
     symbol::Context* ctx = symbol::Context::getInstance();
@@ -285,23 +283,23 @@ static SciErr createCommonList(void* _pvCtx, int _iVar, int _iListType, int _iNb
         return sciErr;
     }
 
-    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
-    InternalType** out = pStr->m_pOut;
+    types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
+    types::InternalType** out = pStr->m_pOut;
 
-    List* pL = NULL;
+    types::List* pL = NULL;
     try
     {
         if (_iListType == sci_list)
         {
-            pL = new List();
+            pL = new types::List();
         }
         else if (_iListType == sci_mlist)
         {
-            pL = new MList();
+            pL = new types::MList();
         }
         else if (_iListType == sci_tlist)
         {
-            pL = new TList();
+            pL = new types::TList();
         }
         else
         {
@@ -323,7 +321,7 @@ static SciErr createCommonList(void* _pvCtx, int _iVar, int _iListType, int _iNb
 
     // create a list with the user number of items
     // it helps to check a wrong item, for example in createCommonListInList
-    pL->set(_iNbItem - 1, new ListUndefined());
+    pL->set(_iNbItem - 1, new types::ListUndefined());
 
     int rhs = _iVar - *getNbInputArgument(_pvCtx);
     out[rhs - 1] = pL;
@@ -498,20 +496,20 @@ static SciErr createCommonListInList(void* _pvCtx, const char* _pstName, int* _p
         return sciErr;
     }
 
-    List* pChild = NULL;
+    types::List* pChild = NULL;
     try
     {
         if (_iListType == sci_list)
         {
-            pChild = new List();
+            pChild = new types::List();
         }
         else if (_iListType == sci_mlist)
         {
-            pChild = new MList();
+            pChild = new types::MList();
         }
         else if (_iListType == sci_tlist)
         {
-            pChild = new TList();
+            pChild = new types::TList();
         }
         else
         {
@@ -531,9 +529,9 @@ static SciErr createCommonListInList(void* _pvCtx, const char* _pstName, int* _p
         return sciErr;
     }
     // create a list in the list with a user number of items
-    pChild->set(_iNbItem - 1, new ListUndefined());
+    pChild->set(_iNbItem - 1, new types::ListUndefined());
 
-    List* pParent = (List*)_piParent;
+    types::List* pParent = (types::List*)_piParent;
     pParent->set(_iItemPos - 1, pChild);
     *_piAddress = (int*)pChild;
     return sciErr;
@@ -552,14 +550,14 @@ SciErr createVoidInNamedList(void* _pvCtx, const char* _pstName, int* _piParent,
         return sciErr;
     }
 
-    List* pL = (List*)_piParent;
+    types::List* pL = (types::List*)_piParent;
     if (pL == NULL)
     {
         addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: No more memory to allocate variable"), "createVoidInNamedList");
         return sciErr;
     }
 
-    pL->set(_iItemPos - 1, new Void());
+    pL->set(_iItemPos - 1, new types::Void());
     return sciErr;
 }
 
@@ -573,14 +571,14 @@ SciErr createUndefinedInNamedList(void* _pvCtx, const char* _pstName, int* _piPa
         return sciErr;
     }
 
-    List* pL = (List*)_piParent;
+    types::List* pL = (types::List*)_piParent;
     if (pL == NULL)
     {
         addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: No more memory to allocate variable"), "createUndefinedInNamedList");
         return sciErr;
     }
 
-    pL->set(_iItemPos - 1, new ListUndefined());
+    pL->set(_iItemPos - 1, new types::ListUndefined());
     return sciErr;
 }
 
@@ -639,10 +637,10 @@ static SciErr allocCommonMatrixOfDoubleInList(void* _pvCtx, int _iVar, int* _piP
         return sciErr;
     }
 
-    List* pParent = (List*)_piParent;
+    types::List* pParent = (types::List*)_piParent;
     if (_iRows == 0 || _iCols == 0)
     {
-        Double *pDbl = Double::Empty();
+        types::Double *pDbl = types::Double::Empty();
         if (pDbl == NULL)
         {
             addErrorMessage(&sciErr, API_ERROR_CREATE_EMPTY_MATRIX, _("%s: Unable to create variable in Scilab memory"), "createEmptyMatrix");
@@ -652,10 +650,10 @@ static SciErr allocCommonMatrixOfDoubleInList(void* _pvCtx, int _iVar, int* _piP
         return sciErr;
     }
 
-    Double* pDbl = NULL;
+    types::Double* pDbl = NULL;
     try
     {
-        pDbl = new Double(_iRows, _iCols, _iComplex == 1);
+        pDbl = new types::Double(_iRows, _iCols, _iComplex == 1);
     }
     catch (const ast::InternalError& ie)
     {
@@ -924,10 +922,10 @@ SciErr createCommonMatrixOfStringInList(void* _pvCtx, const char* _pstName, int*
         return sciErr;
     }
 
-    List* pParent = (List*)_piParent;
+    types::List* pParent = (types::List*)_piParent;
     if (_iRows == 0 || _iCols == 0)
     {
-        Double *pDbl = Double::Empty();
+        types::Double *pDbl = types::Double::Empty();
         if (pDbl == NULL)
         {
             addErrorMessage(&sciErr, API_ERROR_CREATE_EMPTY_MATRIX, _("%s: Unable to create variable in Scilab memory"), "createEmptyMatrix");
@@ -937,10 +935,10 @@ SciErr createCommonMatrixOfStringInList(void* _pvCtx, const char* _pstName, int*
         return sciErr;
     }
 
-    String* pS = NULL;
+    types::String* pS = NULL;
     try
     {
-        pS = new String(_iRows, _iCols);
+        pS = new types::String(_iRows, _iCols);
     }
     catch (const ast::InternalError& ie)
     {
@@ -1060,10 +1058,10 @@ SciErr allocMatrixOfBooleanInList(void* _pvCtx, int _iVar, int* _piParent, int _
         return sciErr;
     }
 
-    List* pParent = (List*)_piParent;
+    types::List* pParent = (types::List*)_piParent;
     if (_iRows == 0 || _iCols == 0)
     {
-        Double *pDbl = Double::Empty();
+        types::Double *pDbl = types::Double::Empty();
         if (pDbl == NULL)
         {
             addErrorMessage(&sciErr, API_ERROR_CREATE_EMPTY_MATRIX, _("%s: Unable to create variable in Scilab memory"), "createEmptyMatrix");
@@ -1073,10 +1071,10 @@ SciErr allocMatrixOfBooleanInList(void* _pvCtx, int _iVar, int* _piParent, int _
         return sciErr;
     }
 
-    Bool* pBool = NULL;
+    types::Bool* pBool = NULL;
     try
     {
-        pBool = new Bool(_iRows, _iCols);
+        pBool = new types::Bool(_iRows, _iCols);
     }
     catch (const ast::InternalError& ie)
     {
@@ -1247,11 +1245,11 @@ SciErr createCommonMatrixOfPolyInList(void* _pvCtx, const char* _pstName, int* _
         return sciErr;
     }
 
-    List* pParent = (List*)_piParent;
+    types::List* pParent = (types::List*)_piParent;
     //return empty matrix
     if (_iRows == 0 || _iCols == 0)
     {
-        Double *pDbl = Double::Empty();
+        types::Double *pDbl = types::Double::Empty();
         if (pDbl == NULL)
         {
             addErrorMessage(&sciErr, API_ERROR_CREATE_EMPTY_MATRIX, _("%s: Unable to create variable in Scilab memory"), "createEmptyMatrix");
@@ -1263,7 +1261,7 @@ SciErr createCommonMatrixOfPolyInList(void* _pvCtx, const char* _pstName, int* _
 
     wchar_t* pstTemp = to_wide_string(_pstVarName);
     std::wstring wstTemp(pstTemp);
-    Polynom* pP = new Polynom(wstTemp, _iRows, _iCols, _piNbCoef);
+    types::Polynom* pP = new types::Polynom(wstTemp, _iRows, _iCols, _piNbCoef);
     FREE(pstTemp);
     if (pP == NULL)
     {
@@ -1278,7 +1276,7 @@ SciErr createCommonMatrixOfPolyInList(void* _pvCtx, const char* _pstName, int* _
 
     for (int i = 0; i < pP->getSize(); i++)
     {
-        Double* pD = new Double(_piNbCoef[i], 1, _iComplex == 1);
+        types::Double* pD = new types::Double(_piNbCoef[i], 1, _iComplex == 1);
         pD->set(_pdblReal[i]);
         if (_iComplex)
         {
@@ -1355,10 +1353,10 @@ static SciErr allocCommonMatrixOfIntegerInList(void* _pvCtx, int _iVar, const ch
         return sciErr;
     }
 
-    List* pParent = (List*)_piParent;
+    types::List* pParent = (types::List*)_piParent;
     if (_iRows == 0 || _iCols == 0)
     {
-        Double *pDbl = Double::Empty();
+        types::Double *pDbl = types::Double::Empty();
         if (pDbl == NULL)
         {
             addErrorMessage(&sciErr, API_ERROR_CREATE_EMPTY_MATRIX, _("%s: Unable to create variable in Scilab memory"), "createEmptyMatrix");
@@ -1368,63 +1366,63 @@ static SciErr allocCommonMatrixOfIntegerInList(void* _pvCtx, int _iVar, const ch
         return sciErr;
     }
 
-    InternalType* pIT = NULL;
+    types::InternalType* pIT = NULL;
     try
     {
         switch (_iPrecision)
         {
             case SCI_INT8 :
             {
-                Int8* pi = new Int8(_iRows, _iCols);
+                types::Int8* pi = new types::Int8(_iRows, _iCols);
                 *_pvData = pi->get();
                 pIT = pi;
             }
             break;
             case SCI_UINT8 :
             {
-                UInt8* pi = new UInt8(_iRows, _iCols);
+                types::UInt8* pi = new types::UInt8(_iRows, _iCols);
                 *_pvData = pi->get();
                 pIT = pi;
             }
             break;
             case SCI_INT16 :
             {
-                Int16* pi = new Int16(_iRows, _iCols);
+                types::Int16* pi = new types::Int16(_iRows, _iCols);
                 *_pvData = pi->get();
                 pIT = pi;
             }
             break;
             case SCI_UINT16 :
             {
-                UInt16* pi = new UInt16(_iRows, _iCols);
+                types::UInt16* pi = new types::UInt16(_iRows, _iCols);
                 *_pvData = pi->get();
                 pIT = pi;
             }
             break;
             case SCI_INT32 :
             {
-                Int32* pi = new Int32(_iRows, _iCols);
+                types::Int32* pi = new types::Int32(_iRows, _iCols);
                 *_pvData = pi->get();
                 pIT = pi;
             }
             break;
             case SCI_UINT32 :
             {
-                UInt32* pi = new UInt32(_iRows, _iCols);
+                types::UInt32* pi = new types::UInt32(_iRows, _iCols);
                 *_pvData = pi->get();
                 pIT = pi;
             }
             break;
             case SCI_INT64 :
             {
-                Int64* pi = new Int64(_iRows, _iCols);
+                types::Int64* pi = new types::Int64(_iRows, _iCols);
                 *_pvData = pi->get();
                 pIT = pi;
             }
             break;
             case SCI_UINT64 :
             {
-                UInt64* pi = new UInt64(_iRows, _iCols);
+                types::UInt64* pi = new types::UInt64(_iRows, _iCols);
                 *_pvData = pi->get();
                 pIT = pi;
             }
@@ -1781,7 +1779,7 @@ static SciErr fillCommonSparseMatrixInList(void* _pvCtx, int _iVar, int* _piPare
 {
     SciErr sciErr = sciErrInit();
 
-    Sparse* pSparse = (Sparse*)_piParent;
+    types::Sparse* pSparse = (types::Sparse*)_piParent;
 
     if (_iComplex)
     {
@@ -1832,10 +1830,10 @@ static SciErr createCommonSparseMatrixInList(void* _pvCtx, int _iVar, const char
         return sciErr;
     }
 
-    Sparse* pSparse = NULL;
+    types::Sparse* pSparse = NULL;
     try
     {
-        pSparse = new Sparse(_iRows, _iCols, _iComplex == 1);
+        pSparse = new types::Sparse(_iRows, _iCols, _iComplex == 1);
     }
     catch (const ast::InternalError& ie)
     {
@@ -1856,7 +1854,7 @@ static SciErr createCommonSparseMatrixInList(void* _pvCtx, int _iVar, const char
         return sciErr;
     }
 
-    List* pParent = (List*)_piParent;
+    types::List* pParent = (types::List*)_piParent;
     pParent->set(_iItemPos - 1, pSparse);
 
     return sciErr;
@@ -1996,7 +1994,7 @@ SciErr readComplexSparseMatrixInNamedList(void* _pvCtx, const char* _pstName, in
 static SciErr fillBooleanSparseMatrixInList(void* _pvCtx, int _iVar, const char* _pstName, int* _piParent, int _iItemPos, int _iRows, int _iCols, int _iNbItem, const int* _piNbItemRow, const int* _piColPos)
 {
     SciErr sciErr = sciErrInit();
-    SparseBool* pSparse = (SparseBool*)_piParent;
+    types::SparseBool* pSparse = (types::SparseBool*)_piParent;
 
     for (int i = 0; i < _iRows; i++)
     {
@@ -2032,10 +2030,10 @@ SciErr createCommonBooleanSparseMatrixInList(void* _pvCtx, const char* _pstName,
         return sciErr;
     }
 
-    SparseBool* pSparse = NULL;
+    types::SparseBool* pSparse = NULL;
     try
     {
-        pSparse = new SparseBool(_iRows, _iCols);
+        pSparse = new types::SparseBool(_iRows, _iCols);
     }
     catch (const ast::InternalError& ie)
     {
@@ -2056,7 +2054,7 @@ SciErr createCommonBooleanSparseMatrixInList(void* _pvCtx, const char* _pstName,
         return sciErr;
     }
 
-    List* piParent = (List*)_piParent;
+    types::List* piParent = (types::List*)_piParent;
     piParent->set(_iItemPos - 1, pSparse);
 
     return sciErr;
@@ -2202,10 +2200,10 @@ SciErr createCommonPointerInList(void* _pvCtx, const char* _pstName, int* _piPar
         return sciErr;
     }
 
-    Pointer* pP = NULL;
+    types::Pointer* pP = NULL;
     try
     {
-        pP = new Pointer(_pvPtr);
+        pP = new types::Pointer(_pvPtr);
         if (pP == NULL)
         {
             addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: No more memory to allocate variable"), "createPointerInList");
@@ -2218,7 +2216,7 @@ SciErr createCommonPointerInList(void* _pvCtx, const char* _pstName, int* _piPar
         return sciErr;
     }
 
-    List* pParent   = (List*)_piParent;
+    types::List* pParent   = (types::List*)_piParent;
     pParent->set(_iItemPos - 1, pP);
 
     return sciErr;
index d5847f8..eff28b1 100644 (file)
@@ -25,8 +25,6 @@ extern "C"
 }
 
 
-using namespace types;
-
 static int findOptional(void* _pvCtx, char *fname, rhs_opts opts[]);
 static void printOptionalNames(void* _pvCtx, rhs_opts opts[]);
 
@@ -35,7 +33,7 @@ static void printOptionalNames(void* _pvCtx, rhs_opts opts[]);
 /**************************/
 int getOptionals(void* _pvCtx, char* pstFuncName, rhs_opts opts[])
 {
-    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
+    types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
     types::optional_list opt = *pStr->m_pOpt;
     int i = 0;
 
@@ -62,16 +60,16 @@ int getOptionals(void* _pvCtx, char* pstFuncName, rhs_opts opts[])
         }
 
         opts[index].iPos = i + 1;
-        GenericType* pGT = (GenericType*)opt[i].second;
+        types::GenericType* pGT = (types::GenericType*)opt[i].second;
         getVarType(_pvCtx, (int*)pGT, &typeOfOpt);
         opts[index].iType = typeOfOpt;
 
         if (typeOfOpt == sci_implicit_poly)
         {
-            InternalType* pIT = NULL;
-            ImplicitList* pIL = pGT->getAs<ImplicitList>();
+            types::InternalType* pIT = NULL;
+            types::ImplicitList* pIL = pGT->getAs<types::ImplicitList>();
             pIT = pIL->extractFullMatrix();
-            Double* impResult = (Double*)pIT;
+            types::Double* impResult = (types::Double*)pIT;
             opts[index].iRows = impResult->getRows();
             opts[index].iCols = impResult->getCols();
             opts[index].piAddr = (int*)impResult;
@@ -106,13 +104,13 @@ int getOptionals(void* _pvCtx, char* pstFuncName, rhs_opts opts[])
 
 int FirstOpt(void* _pvCtx)
 {
-    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
+    types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
     return (int)pStr->m_pIn->size() + 1;
 }
 
 int NumOpt(void* _pvCtx)
 {
-    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
+    types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
     return (int)pStr->m_pOpt->size();
 }
 
index dd30513..b26b517 100644 (file)
@@ -24,8 +24,6 @@ extern "C"
 #include "localization.h"
 }
 
-using namespace types;
-
 SciErr getPointer(void* _pvCtx, int* _piAddress, void** _pvPtr)
 {
     SciErr sciErr = sciErrInit();
@@ -50,7 +48,7 @@ SciErr getPointer(void* _pvCtx, int* _piAddress, void** _pvPtr)
         return sciErr;
     }
 
-    *_pvPtr = ((InternalType*)_piAddress)->getAs<Pointer>()->get();
+    *_pvPtr = ((types::InternalType*)_piAddress)->getAs<types::Pointer>()->get();
     return sciErr;
 }
 
@@ -64,14 +62,14 @@ SciErr createPointer(void* _pvCtx, int _iVar, void* _pvPtr)
         return sciErr;
     }
 
-    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
-    InternalType** out = pStr->m_pOut;
+    types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
+    types::InternalType** out = pStr->m_pOut;
 
-    Pointer* pP = NULL;
+    types::Pointer* pP = NULL;
 
     try
     {
-        pP = new Pointer(_pvPtr);
+        pP = new types::Pointer(_pvPtr);
         if (pP == NULL)
         {
             addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: No more memory to allocate variable"), "createPointer");
@@ -103,7 +101,7 @@ SciErr createNamedPointer(void* _pvCtx, const char* _pstName, void* _pvPtr)
 
     wchar_t* pwstName = to_wide_string(_pstName);
 
-    Pointer* pP = new Pointer(_pvPtr);
+    types::Pointer* pP = new types::Pointer(_pvPtr);
     symbol::Context* ctx = symbol::Context::getInstance();
     symbol::Symbol sym = symbol::Symbol(pwstName);
     FREE(pwstName);
index d064c8f..261c969 100644 (file)
@@ -30,7 +30,6 @@ extern "C"
 #include "sci_malloc.h"
 #include "charEncoding.h"
 }
-using namespace types;
 
 static int getCommonAllocatedSinglePoly(void* _pvCtx, int* _piAddress, int _iComplex, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
 static int getCommonAllocatedNamedSinglePoly(void* _pvCtx, const char* _pstName, int _iComplex, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
@@ -48,7 +47,7 @@ SciErr getPolyVariableName(void* _pvCtx, int* _piAddress, char* _pstVarName, int
         return sciErr;
     }
 
-    if (!((InternalType*)_piAddress)->isPoly())
+    if (!((types::InternalType*)_piAddress)->isPoly())
     {
         addErrorMessage(&sciErr, API_ERROR_INVALID_TYPE, _("%s: Invalid argument type, %s expected"), "getPolyVariableName", _("polynomial matrix"));
         return sciErr;
@@ -56,7 +55,7 @@ SciErr getPolyVariableName(void* _pvCtx, int* _piAddress, char* _pstVarName, int
 
     if (*_piVarNameLen == 0)
     {
-        *_piVarNameLen = (int)((InternalType*)_piAddress)->getAs<types::Polynom>()->getVariableName().size();
+        *_piVarNameLen = (int)((types::InternalType*)_piAddress)->getAs<types::Polynom>()->getVariableName().size();
         //No error
     }
 
@@ -65,7 +64,7 @@ SciErr getPolyVariableName(void* _pvCtx, int* _piAddress, char* _pstVarName, int
         return sciErr;
     }
 
-    char* pstTemp = wide_string_to_UTF8(((InternalType*)_piAddress)->getAs<types::Polynom>()->getVariableName().c_str());
+    char* pstTemp = wide_string_to_UTF8(((types::InternalType*)_piAddress)->getAs<types::Polynom>()->getVariableName().c_str());
     strcpy(_pstVarName, pstTemp);
     FREE(pstTemp);
     *_piVarNameLen = static_cast<int>(strlen(_pstVarName));
@@ -130,7 +129,7 @@ SciErr getCommonMatrixOfPoly(void* _pvCtx, int* _piAddress, int _iComplex, int*
         return sciErr;
     }
 
-    Polynom *pMP = ((InternalType*)_piAddress)->getAs<types::Polynom>();
+    types::Polynom *pMP = ((types::InternalType*)_piAddress)->getAs<types::Polynom>();
     pMP->getSizes(_piNbCoef);
 
     if (_pdblReal == NULL)
@@ -138,7 +137,7 @@ SciErr getCommonMatrixOfPoly(void* _pvCtx, int* _piAddress, int _iComplex, int*
         return sciErr;
     }
 
-    SinglePoly** pSP = pMP->get();
+    types::SinglePoly** pSP = pMP->get();
     if (_iComplex == 1)
     {
         for (int i = 0 ; i < iSize ; i++)
@@ -177,14 +176,14 @@ SciErr createCommonMatrixOfPoly(void* _pvCtx, int _iVar, int _iComplex, char* _p
         return sciErr;
     }
 
-    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
-    InternalType** out = pStr->m_pOut;
+    types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
+    types::InternalType** out = pStr->m_pOut;
     int rhs = _iVar - *getNbInputArgument(_pvCtx);
 
     //return empty matrix
     if (_iRows == 0 && _iCols == 0)
     {
-        Double *pDbl = new Double(_iRows, _iCols);
+        types::Double *pDbl = new types::Double(_iRows, _iCols);
         if (pDbl == NULL)
         {
             addErrorMessage(&sciErr, API_ERROR_CREATE_EMPTY_MATRIX, _("%s: Unable to create variable in Scilab memory"), "createEmptyMatrix");
@@ -197,7 +196,7 @@ SciErr createCommonMatrixOfPoly(void* _pvCtx, int _iVar, int _iComplex, char* _p
 
     wchar_t* pstTemp = to_wide_string(_pstVarName);
     std::wstring wstTemp(pstTemp);
-    Polynom* pP = new Polynom(wstTemp, _iRows, _iCols, _piNbCoef);
+    types::Polynom* pP = new types::Polynom(wstTemp, _iRows, _iCols, _piNbCoef);
     FREE(pstTemp);
     if (pP == NULL)
     {
@@ -214,7 +213,7 @@ SciErr createCommonMatrixOfPoly(void* _pvCtx, int _iVar, int _iComplex, char* _p
 
     for (int i = 0 ; i < pP->getSize() ; i++)
     {
-        Double* pD = new Double(_piNbCoef[i], 1, _iComplex == 1);
+        types::Double* pD = new types::Double(_piNbCoef[i], 1, _iComplex == 1);
         pD->set(_pdblReal[i]);
         if (_iComplex)
         {
@@ -262,7 +261,7 @@ SciErr createCommonNamedMatrixOfPoly(void* _pvCtx, const char* _pstName, char* _
 
     wchar_t* pstTemp = to_wide_string(_pstVarName);
     std::wstring wstTemp(pstTemp);
-    Polynom* pP = new Polynom(wstTemp, _iRows, _iCols, _piNbCoef);
+    types::Polynom* pP = new types::Polynom(wstTemp, _iRows, _iCols, _piNbCoef);
     FREE(pstTemp);
     if (pP == NULL)
     {
@@ -277,7 +276,7 @@ SciErr createCommonNamedMatrixOfPoly(void* _pvCtx, const char* _pstName, char* _
 
     for (int i = 0 ; i < pP->getSize() ; i++)
     {
-        Double* pD = new Double(_piNbCoef[i], 1, _iComplex == 1);
+        types::Double* pD = new types::Double(_piNbCoef[i], 1, _iComplex == 1);
         pD->set(_pdblReal[i]);
         if (_iComplex)
         {
index d847239..7626bf7 100644 (file)
@@ -28,8 +28,6 @@ extern "C"
 #include "call_scilab.h"
 }
 
-using namespace types;
-
 static int getCommonAllocatedSparseMatrix(void* _pvCtx, int* _piAddress, int _iComplex, int* _piRows, int* _piCols, int* _piNbItem, int** _piNbItemRow, int** _piColPos, double** _pdblReal, double** _pdblImg);
 static int getCommonNamedAllocatedSparseMatrix(void* _pvCtx, const char* _pstName, int _iComplex, int* _piRows, int* _piCols, int* _piNbItem, int** _piNbItemRow, int** _piColPos, double** _pdblReal, double** _pdblImg);
 
@@ -84,7 +82,7 @@ SciErr getCommonSparseMatrix(void* _pvCtx, int* _piAddress, int _iComplex, int*
         return sciErr;
     }
 
-    Sparse* pS = ((InternalType*)_piAddress)->getAs<Sparse>();
+    types::Sparse* pS = ((types::InternalType*)_piAddress)->getAs<types::Sparse>();
 
     *_piNbItem = (int)pS->nonZeros();
 
@@ -163,12 +161,12 @@ SciErr fillCommonSparseMatrix(void* _pvCtx, int **_piAddress, int _iComplex, int
     //convert to ij, val, dims format to call sparse constructor
 
     //dims
-    Double* dims = new Double(1, 2, false);
+    types::Double* dims = new types::Double(1, 2, false);
     dims->get()[0] = (double)_iRows;
     dims->get()[1] = (double)_iCols;
 
     //ij
-    Double* ij = new Double(_iNbItem, 2);
+    types::Double* ij = new types::Double(_iNbItem, 2);
     double* pI = ij->get();
     double* pJ = ij->get() + _iNbItem;
 
@@ -183,7 +181,7 @@ SciErr fillCommonSparseMatrix(void* _pvCtx, int **_piAddress, int _iComplex, int
         }
     }
 
-    Double* val = new Double(_iNbItem, 1, _iComplex == 1);
+    types::Double* val = new types::Double(_iNbItem, 1, _iComplex == 1);
     double* pR = val->get();
     if (_iComplex)
     {
@@ -202,7 +200,7 @@ SciErr fillCommonSparseMatrix(void* _pvCtx, int **_piAddress, int _iComplex, int
         }
     }
 
-    Sparse* pSparse = new Sparse(*val, *ij, *dims);
+    types::Sparse* pSparse = new types::Sparse(*val, *ij, *dims);
     delete dims;
     delete val;
     delete ij;
@@ -238,8 +236,8 @@ SciErr createCommonSparseMatrix(void* _pvCtx, int _iVar, int _iComplex, int _iRo
         return sciErr;
     }
 
-    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
-    InternalType** out = pStr->m_pOut;
+    types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
+    types::InternalType** out = pStr->m_pOut;
 
     int iTotalSize = 0;
     types::Sparse* pSparse = NULL;
index 4ec70ed..e73649a 100644 (file)
@@ -37,7 +37,6 @@ extern "C"
 #include "os_string.h"
 }
 
-using namespace types;
 /*--------------------------------------------------------------------------*/
 
 /*******************************/
@@ -82,7 +81,7 @@ SciErr getMatrixOfString(void* _pvCtx, int* _piAddress, int* _piRows, int* _piCo
         return sciErr;
     }
 
-    String *pS = ((InternalType*)_piAddress)->getAs<types::String>();
+    types::String *pS = ((types::InternalType*)_piAddress)->getAs<types::String>();
 
     //non cummulative length
     int iSize = pS->getSize();
@@ -119,13 +118,13 @@ SciErr createMatrixOfString(void* _pvCtx, int _iVar, int _iRows, int _iCols, con
     SciErr sciErr = sciErrInit();
 
     int rhs = _iVar - *getNbInputArgument(_pvCtx);
-    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
-    InternalType** out = pStr->m_pOut;
+    types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
+    types::InternalType** out = pStr->m_pOut;
 
     //return empty matrix
     if (_iRows == 0 && _iCols == 0)
     {
-        Double *pDbl = new Double(_iRows, _iCols);
+        types::Double *pDbl = new types::Double(_iRows, _iCols);
         if (pDbl == NULL)
         {
             addErrorMessage(&sciErr, API_ERROR_CREATE_EMPTY_MATRIX, _("%s: Unable to create variable in Scilab memory"), "createEmptyMatrix");
@@ -136,7 +135,7 @@ SciErr createMatrixOfString(void* _pvCtx, int _iVar, int _iRows, int _iCols, con
         return sciErr;
     }
 
-    String* pS = new String(_iRows, _iCols);
+    types::String* pS = new types::String(_iRows, _iCols);
     if (pS == NULL)
     {
         addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: No more memory to allocated variable"), "createMatrixOfString");
@@ -180,7 +179,7 @@ SciErr createNamedMatrixOfString(void* _pvCtx, const char* _pstName, int _iRows,
         return sciErr;
     }
 
-    String* pS = new String(_iRows, _iCols);
+    types::String* pS = new types::String(_iRows, _iCols);
     if (pS == NULL)
     {
         addErrorMessage(&sciErr, API_ERROR_INVALID_NAME, _("%s: Invalid variable name: %s."), "createNamedMatrixOfString", _pstName);
@@ -270,7 +269,7 @@ SciErr getMatrixOfWideString(void* _pvCtx, int* _piAddress, int* _piRows, int* _
         return sciErr;
     }
 
-    String *pS = ((InternalType*)_piAddress)->getAs<types::String>();
+    types::String *pS = ((types::InternalType*)_piAddress)->getAs<types::String>();
 
     int iSize = pS->getSize();
     if (_pwstStrings == NULL || *_pwstStrings == NULL)
@@ -355,7 +354,7 @@ SciErr createNamedMatrixOfWideString(void* _pvCtx, const char* _pstName, int _iR
         return sciErr;
     }
 
-    String* pS = new String(_iRows, _iCols);
+    types::String* pS = new types::String(_iRows, _iCols);
     if (pS == NULL)
     {
         addErrorMessage(&sciErr, API_ERROR_INVALID_NAME, _("%s: Invalid variable name: %s."), "createNamedMatrixOfWideString", _pstName);
@@ -773,10 +772,10 @@ int allocSingleString(void* _pvCtx, int _iVar, int _iLen, const char** _pstStrin
 {
     SciErr sciErr = sciErrInit();
 
-    GatewayStruct* pGstr = (GatewayStruct*)_pvCtx;
-    typed_list in = *pGstr->m_pIn;
-    InternalType** out = pGstr->m_pOut;
-    String *pStr = NULL;
+    types::GatewayStruct* pGstr = (types::GatewayStruct*)_pvCtx;
+    types::typed_list in = *pGstr->m_pIn;
+    types::InternalType** out = pGstr->m_pOut;
+    types::String *pStr = NULL;
 
 
     char* pstStrings = new char[_iLen];
@@ -789,7 +788,7 @@ int allocSingleString(void* _pvCtx, int _iVar, int _iLen, const char** _pstStrin
         return sciErr.iErr;
     }
 
-    pStr = new String(pstStrings);
+    pStr = new types::String(pstStrings);
 
     if (pStr == NULL)
     {
index 3169917..cfef88d 100644 (file)
@@ -49,7 +49,7 @@ class EXTERN_AST AnalysisVisitor : public ast::Visitor, public Chrono
 
 public:
 
-    typedef unordered_map<std::wstring, std::shared_ptr<CallAnalyzer>> MapSymCall;
+    typedef std::unordered_map<std::wstring, std::shared_ptr<CallAnalyzer>> MapSymCall;
     typedef std::vector<Call *> Calls;
 
 private:
index bd764c7..dd594be 100644 (file)
@@ -109,7 +109,7 @@ public:
     /** \} */
 
     template<typename T>
-    inline void printInternalType(wostringstream & stream, types::InternalType * pIT)
+    inline void printInternalType(std::wostringstream & stream, types::InternalType * pIT)
     {
         T * pT = static_cast<T *>(pIT);
         if (pT)
@@ -151,8 +151,8 @@ private:
     
     void DEBUG_START_NODE(const ast::Ast & e);
     void DEBUG_END_NODE(void);
-    void DEBUG(wstring str);
-    void DEBUG(wstring str, const Exp & e);
+    void DEBUG(const std::wstring& str);
+    void DEBUG(const std::wstring& str, const Exp & e);
 };
 }
 #endif // !AST_DEBUGVISITOR_HXX
index e21a411..b8cfc98 100644 (file)
@@ -57,12 +57,12 @@ public:
     bool isAlreadyIn(std::list<std::wstring>& lst);
     bool isAlreadyUsed();
 
-    void addIn(std::wstring st)
+    void addIn(const std::wstring& st)
     {
         m_in.push_back(st);
     }
 
-    void addOut(std::wstring st)
+    void addOut(const std::wstring& st)
     {
         m_out.push_back(st);
     }
index b94e4c6..47cd148 100644 (file)
@@ -32,8 +32,6 @@ extern "C" {
 #include "sci_malloc.h"
 }
 
-using namespace types;
-
 namespace ast
 {
 class EXTERN_AST RunVisitor : public ConstVisitor
@@ -57,7 +55,7 @@ public:
     {
         if (!isSingleResult() && _resultVect.size() > 1)
         {
-            for (vector<types::InternalType*>::iterator rv = _resultVect.begin() + 1, end = _resultVect.end(); rv != end; ++rv)
+            for (std::vector<types::InternalType*>::iterator rv = _resultVect.begin() + 1, end = _resultVect.end(); rv != end; ++rv)
             {
                 if (*rv != nullptr)
                 {
@@ -81,7 +79,7 @@ public:
         }
         else
         {
-            for (vector<types::InternalType*>::iterator rv = _resultVect.begin(); rv != _resultVect.end(); rv++)
+            for (std::vector<types::InternalType*>::iterator rv = _resultVect.begin(); rv != _resultVect.end(); rv++)
             {
                 if (*rv != nullptr)
                 {
@@ -150,13 +148,13 @@ public:
         return _resultVect[_iPos];
     }
 
-    vector<types::InternalType*>* getResultList()
+    std::vector<types::InternalType*>* getResultList()
     {
         // TODO: this function is not used but it could lead to a memleak
         // (in the first case the vector is allocated and so must be freed)
         if (getResultSize() == 1)
         {
-            vector<types::InternalType*>* pList = new vector<types::InternalType*>;
+            std::vector<types::InternalType*>* pList = new std::vector<types::InternalType*>;
             pList->push_back(_result);
             return pList;
         }
@@ -282,7 +280,7 @@ public:
     | Attributes.  |
     `-------------*/
 protected:
-    vector<types::InternalType*>    _resultVect;
+    std::vector<types::InternalType*>    _resultVect;
     types::InternalType*    _result;
     bool m_bSingleResult;
     int _excepted_result;
@@ -369,7 +367,7 @@ public :
     {
         if (e.getConstant() == nullptr)
         {
-            Double *pdbl = new Double(e.getValue());
+            types::Double *pdbl = new types::Double(e.getValue());
             (const_cast<DoubleExp *>(&e))->setConstant(pdbl);
 
         }
@@ -381,7 +379,7 @@ public :
     {
         if (e.getConstant() == nullptr)
         {
-            Bool *pB = new Bool(e.getValue());
+            types::Bool *pB = new types::Bool(e.getValue());
             (const_cast<BoolExp *>(&e))->setConstant(pB);
 
         }
@@ -399,7 +397,7 @@ public :
     {
         symbol::Context* ctx = symbol::Context::getInstance();
         symbol::Variable* var = ((SimpleVar&)e).getStack();
-        InternalType *pI = ctx->get(var);
+        types::InternalType *pI = ctx->get(var);
         setResult(pI);
         if (pI != nullptr)
         {
@@ -452,14 +450,14 @@ public :
 
     void visitprivate(const ColonVar &/*e*/)
     {
-        Colon *pC = new Colon();
+        types::Colon *pC = new types::Colon();
         setResult(pC);
     }
 
 
     void visitprivate(const DollarVar &/*e*/)
     {
-        setResult(Polynom::Dollar());
+        setResult(types::Polynom::Dollar());
     }
 
     void visitprivate(const TryCatchExp  &e)
@@ -502,7 +500,7 @@ public :
         int iNbExpSize = this->getExpectedSize();
         this->setExpectedSize(1);
 
-        typed_list lstIT;
+        types::typed_list lstIT;
         for (it = e.getExps().begin() ; it != e.getExps().end() ; it++)
         {
             (*it)->accept(*this);
@@ -532,7 +530,7 @@ public :
     }
 
     types::InternalType* callOverloadOpExp(OpExp::Oper _oper, types::InternalType* _paramL, types::InternalType* _paramR);
-    types::InternalType* callOverloadMatrixExp(std::wstring strType, types::InternalType* _paramL, types::InternalType* _paramR);
+    types::InternalType* callOverloadMatrixExp(const std::wstring& strType, types::InternalType* _paramL, types::InternalType* _paramR);
 };
 }
 
index cc828de..6558bac 100644 (file)
@@ -125,7 +125,7 @@ protected :
 class InternalError : public ScilabException
 {
 public :
-    InternalError(std::wstring _wstErrorMesssage) : ScilabException(_wstErrorMesssage)
+    InternalError(const std::wstring& _wstErrorMesssage) : ScilabException(_wstErrorMesssage)
     {
         m_type = TYPE_ERROR;
         setLastError(999, _wstErrorMesssage.c_str(), 0, NULL);
@@ -137,7 +137,7 @@ public :
         setLastError(999, m_wstErrorMessage.c_str(), 0, NULL);
     }
 
-    InternalError(std::wstring _wstErrorMesssage, int _iErrorNumber, const Location& _ErrorLocation) : ScilabException(_wstErrorMesssage, _iErrorNumber, _ErrorLocation)
+    InternalError(const std::wstring& _wstErrorMesssage, int _iErrorNumber, const Location& _ErrorLocation) : ScilabException(_wstErrorMesssage, _iErrorNumber, _ErrorLocation)
     {
         m_type = TYPE_ERROR;
         setLastError(_iErrorNumber, _wstErrorMesssage.c_str(), _ErrorLocation.first_line, NULL);
index ec613b7..db7236d 100644 (file)
@@ -50,12 +50,12 @@ bool getFieldsFromExp(ast::Exp* _pExp, std::list<ExpHistory*>& fields);
 types::InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fields, types::InternalType* pIT);
 
 types::InternalType* callOverload(const ast::Exp& e,
-                                  std::wstring _strType,
+                                  const std::wstring& _strType,
                                   types::typed_list* _pArgs,
                                   types::InternalType* _source,
                                   types::InternalType* _dest);
 
-types::InternalType* callOverload(std::wstring strType, types::InternalType* _paramL, types::InternalType* _paramR);
+types::InternalType* callOverload(const std::wstring& strType, types::InternalType* _paramL, types::InternalType* _paramR);
 
 types::InternalType* insertionCall(const ast::Exp& e, types::typed_list* _pArgs, types::InternalType* _pVar, types::InternalType* _pInsert);
 
index 5813409..75e5c89 100644 (file)
@@ -16,8 +16,6 @@
 
 #include "constexp.hxx"
 
-using namespace types;
-
 namespace ast
 {
 /** \brief Abstract an Boolean Expression node.
index 6f87cbf..35623ae 100644 (file)
@@ -25,8 +25,6 @@
 #include "arraylistvar.hxx"
 #include "seqexp.hxx"
 
-using namespace std;
-
 namespace ast
 {
 /*
index fc58dac..db0bac9 100644 (file)
@@ -23,7 +23,7 @@ namespace ast
 class StringExp : public ConstExp
 {
 public:
-    StringExp (const Location& location, const std::wstring & value)
+    StringExp (const Location& location, const std::wstring& value)
         : ConstExp (location),
           _value (value)
     {
@@ -74,7 +74,7 @@ public:
 
 public:
     /** \brief Return the name of the type name (read only). */
-    const std::wstring & getValue() const
+    const std::wstring& getValue() const
     {
         return _value;
     }
index 2f5000e..df1cdb3 100644 (file)
@@ -20,9 +20,6 @@ extern "C"
 #include "matrix_finite.h"
 }
 
-// FIXME : Remove using namespace.
-using namespace types;
-
-bool isDoubleFinite(Double *_pDouble);
+bool isDoubleFinite(types::Double *_pDouble);
 
 #endif /* __TYPES_FINITE__ */
index 957e002..89a3d6b 100644 (file)
 #include "polynom.hxx"
 #include "sparse.hxx"
 
-// FIXME : remove using namespace.
-using namespace types;
-
 //power operations
-int PowerDoubleByDouble(Double* _pDouble1, Double* _pDouble2, Double** _pDoubleOut);
-int PowerPolyByDouble(Polynom* _pPoly, Double* _pDouble, InternalType** _pOut);
+int PowerDoubleByDouble(types::Double* _pDouble1, types::Double* _pDouble2, types::Double** _pDoubleOut);
+int PowerPolyByDouble(types::Polynom* _pPoly, types::Double* _pDouble, types::InternalType** _pOut);
 
 //dot power operations
-int DotPowerDoubleByDouble(Double* _pDouble1, Double* _pDouble2, Double** _pDoubleOut);
-int DotPowerPolyByDouble(Polynom* _pPoly, Double* _pDouble, InternalType** _pOut);
-int DotPowerSpaseByDouble(Sparse* _pSp, Double* _pDouble, InternalType** _pOut);
+int DotPowerDoubleByDouble(types::Double* _pDouble1, types::Double* _pDouble2, types::Double** _pDoubleOut);
+int DotPowerPolyByDouble(types::Polynom* _pPoly, types::Double* _pDouble, types::InternalType** _pOut);
+int DotPowerSpaseByDouble(types::Sparse* _pSp, types::Double* _pDouble, types::InternalType** _pOut);
 
 extern "C"
 {
index d1bbfda..f3efa3d 100644 (file)
@@ -128,7 +128,7 @@ public:
     {
         return const_cast<wchar_t *>(_error_message.c_str());
     }
-    void setErrorMessage(std::wstring& errorMessage)
+    void setErrorMessage(const std::wstring& errorMessage)
     {
         _error_message = errorMessage;
     }
index 0f7c339..487fc96 100644 (file)
@@ -138,7 +138,7 @@ public :
     ** Error Message management
     */
     static std::wstring& getErrorMessage(void);
-    static void appendErrorMessage(std::wstring ostr);
+    static void appendErrorMessage(const std::wstring& ostr);
     static void resetErrorMessage(void)
     {
         _error_message.clear();
@@ -153,7 +153,7 @@ public :
     */
     static char* getCodeLine(int line, char **codeLine);
 
-    static void PrintError(std::wstring msg);
+    static void PrintError(const std::wstring& msg);
 
 private :
     static std::wstring _file_name;
index aa04cb8..433d3d6 100644 (file)
@@ -74,7 +74,7 @@ public:
     types::InternalType* getFunction(const Symbol& key);
 
     /*return function list in the module _stModuleName*/
-    int getFunctionList(std::list<Symbol>& lst, std::wstring _stModuleName);
+    int getFunctionList(std::list<Symbol>& lst, const std::wstring& _stModuleName);
 
     int getConsoleVarsName(std::list<std::wstring>& lst);
     int getVarsName(std::list<std::wstring>& lst);
index ded5bf5..97640b2 100644 (file)
@@ -303,9 +303,9 @@ public :
 private :
     static std::map<std::wstring, DynLibHandle> m_DynModules;
 public :
-    static void addDynModule(std::wstring _name, DynLibHandle _lib);
-    static void removeDynModule(std::wstring _name);
-    static DynLibHandle getDynModule(std::wstring _name);
+    static void addDynModule(const std::wstring& _name, DynLibHandle _lib);
+    static void removeDynModule(const std::wstring& _name);
+    static DynLibHandle getDynModule(const std::wstring& _name);
     static int getDynModuleCount();
     static DynLibHandle* getAllDynModule();
     static void cleanDynModule();
index 96346bd..b7a33e4 100644 (file)
@@ -71,7 +71,7 @@ public :
         return getNbOutputArgument();
     }
 
-    void                  setName(std::wstring _wstName)
+    void                  setName(const std::wstring& _wstName)
     {
         m_wstName = _wstName;
     }
@@ -79,7 +79,7 @@ public :
     {
         return m_wstName;
     }
-    void                  setModule(std::wstring _wstModule)
+    void                  setModule(const std::wstring& _wstModule)
     {
         m_wstModule = _wstModule;
     }
index a1c0adf..99883ef 100644 (file)
@@ -23,7 +23,7 @@ public :
     File();
     ~File();
 
-    void                        setFileMode(std::wstring _pstMode);
+    void                        setFileMode(const std::wstring& _pstMode);
     std::wstring&               getFileMode();
     void                        setFileModeAsInt(int _iMode);
     int                         getFileModeAsInt();
@@ -40,7 +40,7 @@ public :
     int                         getFileType();
     std::wstring                getFileTypeAsString();
 
-    void                        setFilename(std::wstring _stFilename);
+    void                        setFilename(const std::wstring& _stFilename);
     std::wstring&               getFilename();
 
     int                         getCountLines();
index c4ac7e4..63f4896 100644 (file)
@@ -44,30 +44,30 @@ public :
         EntryPointCPPOpt    = 3,
     };
 
-    typedef int (*LOAD_DEPS)(std::wstring);
+    typedef int(*LOAD_DEPS)(const std::wstring&);
     typedef int (*INIT_MODULE)(void);
     typedef ReturnValue (*GW_FUNC)(typed_list &in, int _iRetCount, typed_list &out);
     typedef ReturnValue (*GW_FUNC_OPT)(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out);
 
     Function() : Callable() {};
-    Function(std::wstring _wstName, GW_FUNC _pFunc, LOAD_DEPS _pLoadDeps, std::wstring _wstModule);
+    Function(const std::wstring& _wstName, GW_FUNC _pFunc, LOAD_DEPS _pLoadDeps, const std::wstring& _wstModule);
     ~Function();
 
     //FIXME : Should not return NULL
     InternalType*           clone();
 
-    static Function*        createFunction(std::wstring _wstName, GW_FUNC _pFunc, std::wstring _wstModule);
-    static Function*        createFunction(std::wstring _wstName, GW_FUNC_OPT _pFunc, std::wstring _wstModule);
-    static Function*        createFunction(std::wstring _wstName, OLDGW_FUNC _pFunc, std::wstring _wstModule);
-    static Function*        createFunction(std::wstring _wstName, MEXGW_FUNC _pFunc, std::wstring _wstModule);
-    static Function*        createFunction(std::wstring _wstName, GW_FUNC _pFunc, LOAD_DEPS _pLoadDeps, std::wstring _wstModule);
-    static Function*        createFunction(std::wstring _wstName, GW_FUNC_OPT _pFunc, LOAD_DEPS _pLoadDeps, std::wstring _wstModule);
-    static Function*        createFunction(std::wstring _wstName, OLDGW_FUNC _pFunc, LOAD_DEPS _pLoadDeps, std::wstring _wstModule);
-    static Function*        createFunction(std::wstring _wstName, MEXGW_FUNC _pFunc, LOAD_DEPS _pLoadDeps, std::wstring _wstModule);
+    static Function*        createFunction(const std::wstring& _wstName, GW_FUNC _pFunc, const std::wstring& _wstModule);
+    static Function*        createFunction(const std::wstring& _wstName, GW_FUNC_OPT _pFunc, const std::wstring& _wstModule);
+    static Function*        createFunction(const std::wstring& _wstName, OLDGW_FUNC _pFunc, const std::wstring& _wstModule);
+    static Function*        createFunction(const std::wstring& _wstName, MEXGW_FUNC _pFunc, const std::wstring& _wstModule);
+    static Function*        createFunction(const std::wstring& _wstName, GW_FUNC _pFunc, LOAD_DEPS _pLoadDeps, const std::wstring& _wstModule);
+    static Function*        createFunction(const std::wstring& _wstName, GW_FUNC_OPT _pFunc, LOAD_DEPS _pLoadDeps, const std::wstring& _wstModule);
+    static Function*        createFunction(const std::wstring& _wstName, OLDGW_FUNC _pFunc, LOAD_DEPS _pLoadDeps, const std::wstring& _wstModule);
+    static Function*        createFunction(const std::wstring& _wstName, MEXGW_FUNC _pFunc, LOAD_DEPS _pLoadDeps, const std::wstring& _wstModule);
 
     /*dynamic gateways*/
-    static Function*        createFunction(std::wstring _wstFunctionName, std::wstring _wstEntryPointName, std::wstring _wstLibName, FunctionType _iType, LOAD_DEPS _pLoadDeps, std::wstring _wstModule, bool _bCloseLibAfterCall = false);
-    static Function*        createFunction(std::wstring _wstFunctionName, std::wstring _wstEntryPointName, std::wstring _wstLibName, FunctionType _iType, std::wstring _wstLoadDepsName, std::wstring _wstModule, bool _bCloseLibAfterCall = false);
+    static Function*        createFunction(const std::wstring& _wstFunctionName, const std::wstring& _wstEntryPointName, const std::wstring& _wstLibName, FunctionType _iType, LOAD_DEPS _pLoadDeps, const std::wstring& _wstModule, bool _bCloseLibAfterCall = false);
+    static Function*        createFunction(const std::wstring& _wstFunctionName, const std::wstring& _wstEntryPointName, const std::wstring& _wstLibName, FunctionType _iType, const std::wstring& _wstLoadDepsName, const std::wstring& _wstModule, bool _bCloseLibAfterCall = false);
 
     inline ScilabType       getType(void)
     {
@@ -122,7 +122,7 @@ class OptFunction : public Function
 private :
     OptFunction(OptFunction* _Function);
 public :
-    OptFunction(std::wstring _wstName, GW_FUNC_OPT _pFunc, LOAD_DEPS _pLoadDeps, std::wstring _wstModule);
+    OptFunction(const std::wstring& _wstName, GW_FUNC_OPT _pFunc, LOAD_DEPS _pLoadDeps, const std::wstring& _wstModule);
 
     Callable::ReturnValue call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc);
     InternalType*           clone();
@@ -142,7 +142,7 @@ class WrapFunction : public Function
 private :
     WrapFunction(WrapFunction* _pWrapFunction);
 public :
-    WrapFunction(std::wstring _wstName, OLDGW_FUNC _pFunc, LOAD_DEPS _pLoadDeps, std::wstring _wstModule);
+    WrapFunction(const std::wstring& _wstName, OLDGW_FUNC _pFunc, LOAD_DEPS _pLoadDeps, const std::wstring& _wstModule);
 
     Callable::ReturnValue call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc);
     InternalType*           clone();
@@ -161,7 +161,7 @@ class WrapMexFunction : public Function
 private :
     WrapMexFunction(WrapMexFunction* _pWrapFunction);
 public :
-    WrapMexFunction(std::wstring _wstName, MEXGW_FUNC _pFunc, LOAD_DEPS _pLoadDeps, std::wstring _wstModule);
+    WrapMexFunction(const std::wstring& _wstName, MEXGW_FUNC _pFunc, LOAD_DEPS _pLoadDeps, const std::wstring& _wstModule);
 
     Callable::ReturnValue call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc);
     InternalType*           clone();
@@ -180,11 +180,11 @@ class DynamicFunction : public Function
 private :
     DynamicFunction(DynamicFunction* _pDynamicFunction);
 public :
-    DynamicFunction(std::wstring _wstName, std::wstring _wstEntryPointName, std::wstring _wstLibName, FunctionType _iType, LOAD_DEPS _pLoadDeps, std::wstring _wstModule, bool _bCloseLibAfterCall = false);
+    DynamicFunction(const std::wstring& _wstName, const std::wstring& _wstEntryPointName, const std::wstring& _wstLibName, FunctionType _iType, LOAD_DEPS _pLoadDeps, const std::wstring& _wstModule, bool _bCloseLibAfterCall = false);
 
     virtual ~DynamicFunction();
 
-    DynamicFunction(std::wstring _wstName, std::wstring _wstEntryPointName, std::wstring _wstLibName, FunctionType _iType, std::wstring _wstLoadDepsName, std::wstring _wstModule, bool _bCloseLibAfterCall = false);
+    DynamicFunction(const std::wstring& _wstName, const std::wstring& _wstEntryPointName, const std::wstring& _wstLibName, FunctionType _iType, const std::wstring& _wstLoadDepsName, const std::wstring& _wstModule, bool _bCloseLibAfterCall = false);
     Callable::ReturnValue   call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc);
 private :
     Callable::ReturnValue   Init();
index a5e2805..1025ced 100644 (file)
@@ -58,7 +58,7 @@ public :
         return true;
     }
 
-    bool extract(const std::wstring & name, InternalType *& out);
+    bool extract(const std::wstring& name, InternalType *& out);
 
     void add(const std::wstring& _wstName, MacroFile* _macro);
     MacroFile* get(const std::wstring& _wstName);
index 9720905..ca5fb15 100644 (file)
@@ -24,7 +24,7 @@ class EXTERN_AST MacroFile : public Callable
 {
 public :
     MacroFile(): Callable() {};
-    MacroFile(std::wstring _stName, std::wstring _stPath, std::wstring _stModule);
+    MacroFile(const std::wstring& _stName, const std::wstring& _stPath, const std::wstring& _stModule);
     virtual                 ~MacroFile();
 
     //FIXME : Should not return NULL
index 4081694..00bbd0a 100644 (file)
@@ -25,16 +25,16 @@ public:
      ** depending on input parameters
      ** and maybe on number of result expected <further implementation>
      */
-    static std::wstring buildOverloadName(std::wstring _stFunctionName, types::typed_list &in, int _iRetCount, bool _isOperator = false, bool _truncated = false);
+    static std::wstring buildOverloadName(const std::wstring& _stFunctionName, types::typed_list &in, int _iRetCount, bool _isOperator = false, bool _truncated = false);
 
     /**
      */
-    static types::Function::ReturnValue generateNameAndCall(std::wstring _stFunctionName, types::typed_list &in, int _iRetCount,
+    static types::Function::ReturnValue generateNameAndCall(const std::wstring& _stFunctionName, types::typed_list &in, int _iRetCount,
             types::typed_list &out, ast::ConstVisitor *_execMe = nullptr, bool _isOperator = false);
 
     /**
      */
-    static types::Function::ReturnValue call(std::wstring _stFunctionName, types::typed_list &in, int _iRetCount,
+    static types::Function::ReturnValue call(const std::wstring& _stFunctionName, types::typed_list &in, int _iRetCount,
             types::typed_list &out, ast::ConstVisitor *_execMe = nullptr, bool _isOperator = false);
 
     static std::wstring getNameFromOper(const int);
index dc72145..90a45a6 100644 (file)
@@ -75,7 +75,7 @@ public :
 
     void                    whoAmI(void);
     std::wstring&           getVariableName();
-    void                    setVariableName(std::wstring);
+    void                    setVariableName(const std::wstring&);
     bool                    getSizes(int *_piSizes);
     bool                    getRank(int *_piRank);
     int                     getMaxRank(void);
index ff3b282..fdd1b16 100644 (file)
@@ -55,8 +55,8 @@ public :
     bool                    evaluate(double _dblInR, double _dblInI, double *_pdblOutR, double *_pdblOutI);
     void                    updateRank(void);
 
-    void                    toStringReal(std::wstring _szVar, std::list<std::wstring>* _pListExp , std::list<std::wstring>* _pListCoef);
-    void                    toStringImg(std::wstring _szVar, std::list<std::wstring>* _pListExp , std::list<std::wstring>* _pListCoef);
+    void                    toStringReal(const std::wstring& _szVar, std::list<std::wstring>* _pListExp , std::list<std::wstring>* _pListCoef);
+    void                    toStringImg(const std::wstring& _szVar, std::list<std::wstring>* _pListExp , std::list<std::wstring>* _pListCoef);
 
     bool                    toString(std::wostringstream& ostr);
 
@@ -84,7 +84,7 @@ protected :
     }
 
 private :
-    void                    toStringInternal(double *_pdblVal, std::wstring _szVar, std::list<std::wstring>* _pListExp , std::list<std::wstring>* _pListCoef);
+    void                    toStringInternal(double *_pdblVal, const std::wstring& _szVar, std::list<std::wstring>* _pListExp , std::list<std::wstring>* _pListCoef);
 
 };
 
index 38bdd3e..72f0439 100644 (file)
@@ -107,10 +107,10 @@ public :
     bool                        addFieldFront(const std::wstring& _sKey);
     bool                        removeField(const std::wstring& _sKey);
     bool                        toString(std::wostringstream& ostr);
-    List*                       extractFieldWithoutClone(std::wstring _wstField);
+    List*                       extractFieldWithoutClone(const std::wstring& _wstField);
     std::vector<InternalType*>  extractFields(std::vector<std::wstring> _wstFields);
     std::vector<InternalType*>  extractFields(typed_list* _pArgs);
-    inline InternalType *       extractField(const std::wstring & wstField);
+    inline InternalType *       extractField(const std::wstring& wstField);
 
     bool                        resize(int* _piDims, int _iDims);
     bool                        resize(int _iNewRows, int _iNewCols);
@@ -121,7 +121,7 @@ public :
     void                        setCloneInCopyValue(bool _val);
 
     using ArrayOf<SingleStruct *>::extract;
-    bool extract(const std::wstring & name, InternalType *& out);
+    bool extract(const std::wstring& name, InternalType *& out);
 
     virtual bool invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, ast::ConstVisitor & execFunc, const ast::Exp & e);
 
index 176b6a1..b58bc7f 100644 (file)
@@ -52,7 +52,7 @@ public :
     bool                            set(const int _iIndex, InternalType* _pIT);
 
     using List::extract; // to avoid this extract to hide extract in list
-    bool                            extract(const std::wstring & name, InternalType *& out);
+    bool                            extract(const std::wstring& name, InternalType *& out);
 
     virtual bool invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, ast::ConstVisitor & execFunc, const ast::Exp & e);
 
index 8ea3d08..420a8ee 100644 (file)
@@ -152,7 +152,7 @@ public :
         return NULL;
     }
 
-    virtual bool                extract(const std::wstring & /*name*/, InternalType *& /*out*/)
+    virtual bool                extract(const std::wstring& /*name*/, InternalType *& /*out*/)
     {
         return false;
     }
index 5ecd220..53bd48f 100644 (file)
@@ -90,7 +90,7 @@ public :
     // this method is called to perform an extraction by field. ie : a = myUserType.myfield
     // name is the field name
     // out contain extraction of field
-    virtual bool          extract(const std::wstring & /*name*/, InternalType *& /*out*/)
+    virtual bool          extract(const std::wstring& /*name*/, InternalType *& /*out*/)
     {
         return false;
     }
index ed49e4a..a195d16 100644 (file)
@@ -28,7 +28,7 @@ void DebugVisitor::DEBUG_END_NODE(void)
     --level;
 }
 
-void DebugVisitor::DEBUG(wstring str)
+void DebugVisitor::DEBUG(const std::wstring& str)
 {
     for (int i = 0 ; i < level; ++i)
     {
@@ -38,10 +38,10 @@ void DebugVisitor::DEBUG(wstring str)
     {
         *ostr << L"     ";
     }
-    *ostr << str << endl;
+    *ostr << str << std::endl;
 }
 
-void DebugVisitor::DEBUG(wstring str, const Exp &e)
+void DebugVisitor::DEBUG(const std::wstring& str, const Exp &e)
 {
     for (int i = 0 ; i < level; ++i)
     {
@@ -99,7 +99,7 @@ void DebugVisitor::visit (const CellExp &e)
 void DebugVisitor::visit (const StringExp &e)
 {
     DEBUG_START_NODE(e);
-    wostringstream stream;
+    std::wostringstream stream;
     if (e.getConstant())
     {
         printInternalType<types::String>(stream, e.getConstant());
@@ -122,7 +122,7 @@ void DebugVisitor::visit (const CommentExp &e)
 void DebugVisitor::visit (const DoubleExp  &e)
 {
     DEBUG_START_NODE(e);
-    wostringstream stream;
+    std::wostringstream stream;
     types::InternalType * pIT = e.getConstant();
     if (pIT)
     {
@@ -149,7 +149,7 @@ void DebugVisitor::visit (const DoubleExp  &e)
 void DebugVisitor::visit (const BoolExp  &e)
 {
     DEBUG_START_NODE(e);
-    wostringstream stream;
+    std::wostringstream stream;
     if (e.getConstant())
     {
         printInternalType<types::Bool>(stream, e.getConstant());
index c692688..cd92387 100644 (file)
@@ -13,9 +13,6 @@
 #include "macrovarvisitor.hxx"
 #include "context.hxx"
 
-using namespace std;
-using namespace ast;
-using namespace symbol;
 namespace ast
 {
 
@@ -169,7 +166,7 @@ void MacrovarVisitor::add(std::list<std::wstring>& lst)
 
 void MacrovarVisitor::add()
 {
-    InternalType* pVar = Context::getInstance()->get(Symbol(m_current));
+    types::InternalType* pVar = symbol::Context::getInstance()->get(symbol::Symbol(m_current));
     if (pVar)
     {
         if (pVar->isCallable())
index e275e8d..1532522 100644 (file)
@@ -31,7 +31,7 @@ namespace ast {
             {
                 // x = ?
                 /*getting what to assign*/
-                InternalType *pIT = e.getRightVal();
+                types::InternalType *pIT = e.getRightVal();
                 if (pIT == NULL)
                 {
                     setExpectedSize(1);
@@ -52,9 +52,9 @@ namespace ast {
 
                 if (pIT->isImplicitList())
                 {
-                    if (pIT->getAs<ImplicitList>()->isComputable())
+                    if (pIT->getAs<types::ImplicitList>()->isComputable())
                     {
-                        InternalType *pTemp = pIT->getAs<ImplicitList>()->extractFullMatrix();
+                        types::InternalType *pTemp = pIT->getAs<types::ImplicitList>()->extractFullMatrix();
                         delete pIT;
                         pIT = pTemp;
                     }
@@ -127,10 +127,10 @@ namespace ast {
             if (e.getLeftExp().isCellCallExp())
             {
                 CellCallExp *pCell = static_cast<CellCallExp*>(&e.getLeftExp());
-                InternalType *pOut = NULL;
+                types::InternalType *pOut = NULL;
 
                 /*getting what to assign*/
-                InternalType* pITR = e.getRightVal();
+                types::InternalType* pITR = e.getRightVal();
                 if (pITR == NULL)
                 {
                     e.getRightExp().accept(*this);
@@ -217,10 +217,10 @@ namespace ast {
             {
                 CallExp *pCall = static_cast<CallExp*>(&e.getLeftExp());
                 //x(?) = ?
-                InternalType *pOut = NULL;
+                types::InternalType *pOut = NULL;
 
                 /*getting what to assign*/
-                InternalType* pITR = e.getRightVal();
+                types::InternalType* pITR = e.getRightVal();
                 if (pITR == NULL)
                 {
                     e.getRightExp().accept(*this);
@@ -242,7 +242,7 @@ namespace ast {
                 if (pCall->getName().isSimpleVar())
                 {
                     ast::SimpleVar* var = pCall->getName().getAs<ast::SimpleVar>();
-                    InternalType* pIT = ctx->getCurrentLevel(var->getStack());
+                    types::InternalType* pIT = ctx->getCurrentLevel(var->getStack());
                     if (pIT && pIT->isArrayOf())
                     {
                         if (ctx->isprotected(var->getStack()))
@@ -256,7 +256,7 @@ namespace ast {
                         // called in insertionCall when pITR is an ImplicitList
                         pITR->IncreaseRef();
 
-                        typed_list* currentArgs = GetArgumentList(pCall->getArgs());
+                        types::typed_list* currentArgs = GetArgumentList(pCall->getArgs());
 
                         try
                         {
@@ -427,7 +427,7 @@ namespace ast {
             if (e.getLeftExp().isFieldExp())
             {
                 FieldExp *pField = static_cast<FieldExp*>(&e.getLeftExp());
-                InternalType *pIT = e.getRightVal();
+                types::InternalType *pIT = e.getRightVal();
                 if (pIT == NULL)
                 {
                     //a.b = x
@@ -441,9 +441,9 @@ namespace ast {
 
                 if (pIT->isImplicitList())
                 {
-                    if (pIT->getAs<ImplicitList>()->isComputable())
+                    if (pIT->getAs<types::ImplicitList>()->isComputable())
                     {
-                        InternalType *pTemp = pIT->getAs<ImplicitList>()->extractFullMatrix();
+                        types::InternalType *pTemp = pIT->getAs<types::ImplicitList>()->extractFullMatrix();
                         delete pIT;
                         setResult(NULL);
                         pIT = pTemp;
@@ -492,7 +492,7 @@ namespace ast {
 
                 if (e.isVerbose() && ConfigVariable::isPromptShow())
                 {
-                    const wstring *pstName = getStructNameFromExp(pField);
+                    const std::wstring *pstName = getStructNameFromExp(pField);
 
                     types::InternalType* pPrint = ctx->get(symbol::Symbol(*pstName));
                     std::wostringstream ostr;
index 2697538..d0eedcc 100644 (file)
@@ -59,14 +59,14 @@ void RunVisitorT<T>::visitprivate(const CallExp &e)
                     SimpleVar* pVar = pL->getAs<SimpleVar>();
                     Exp* pR = &pAssign->getRightExp();
                     pR->accept(*this);
-                    InternalType* pITR = getResult();
+                    types::InternalType* pITR = getResult();
                     // IncreaseRef to protect opt argument of scope_end delete
                     // It will be deleted by clear_opt
                     pITR->IncreaseRef();
 
                     if (pIT->hasInvokeOption())
                     {
-                        opt.push_back(std::pair<std::wstring, InternalType*>(pVar->getSymbol().getName(), pITR));
+                        opt.push_back(std::pair<std::wstring, types::InternalType*>(pVar->getSymbol().getName(), pITR));
                         //in case of macro/macrofile, we have to shift input param
                         //so add NULL item in in list to keep initial order
                         if (pIT->isMacro() || pIT->isMacroFile())
@@ -97,7 +97,7 @@ void RunVisitorT<T>::visitprivate(const CallExp &e)
                 //extract implicit list for call()
                 if (pIT->isCallable() || pIT->isUserType())
                 {
-                    InternalType * pITArg = getResult();
+                    types::InternalType * pITArg = getResult();
                     if (pITArg->isImplicitList())
                     {
                         types::ImplicitList* pIL = pITArg->getAs<types::ImplicitList>();
@@ -119,7 +119,7 @@ void RunVisitorT<T>::visitprivate(const CallExp &e)
                 {
                     for (int i = 0 ; i < getResultSize() ; i++)
                     {
-                        InternalType * pITArg = getResult(i);
+                        types::InternalType * pITArg = getResult(i);
                         pITArg->IncreaseRef();
                         in.push_back(pITArg);
                     }
@@ -212,7 +212,7 @@ void RunVisitorT<T>::visitprivate(const CallExp &e)
                         char szError[bsiz];
                         if(pIT->isCallable())
                         {
-                            char* strFName = wide_string_to_UTF8(pIT->getAs<Callable>()->getName().c_str());
+                            char* strFName = wide_string_to_UTF8(pIT->getAs<types::Callable>()->getName().c_str());
                             os_sprintf(szError,  _("%s: Wrong number of output argument(s): %d expected.\n"), strFName, out.size());
                             FREE(strFName);
                         }
@@ -351,7 +351,7 @@ void RunVisitorT<T>::visitprivate(const CellCallExp &e)
 
             if (pList->getSize() == 1)
             {
-                InternalType* ret = pList->get(0);
+                types::InternalType* ret = pList->get(0);
                 setResult(ret);
 
                 ret->IncreaseRef();
index e1b2739..eb8d235 100644 (file)
@@ -23,13 +23,13 @@ void RunVisitorT<T>::visitprivate(const MatrixExp &e)
     {
         exps_t::const_iterator row;
         exps_t::const_iterator col;
-        InternalType *poResult = NULL;
-        list<InternalType*> rowList;
+        types::InternalType *poResult = NULL;
+        std::list<types::InternalType*> rowList;
 
         exps_t lines = e.getLines();
         if (lines.size() == 0)
         {
-            setResult(Double::Empty());
+            setResult(types::Double::Empty());
             return;
         }
 
@@ -45,7 +45,7 @@ void RunVisitorT<T>::visitprivate(const MatrixExp &e)
                 //manage evstr('//xxx') for example
                 if (getResult() == NULL)
                 {
-                    setResult(Double::Empty());
+                    setResult(types::Double::Empty());
                 }
                 return;
             }
@@ -54,7 +54,7 @@ void RunVisitorT<T>::visitprivate(const MatrixExp &e)
         //do all [x,x]
         for (row = lines.begin() ; row != lines.end() ; row++)
         {
-            InternalType* poRow = NULL;
+            types::InternalType* poRow = NULL;
             exps_t cols = (*row)->getAs<MatrixLineExp>()->getColumns();
             for (col = cols.begin() ; col != cols.end() ; col++)
             {
@@ -78,7 +78,7 @@ void RunVisitorT<T>::visitprivate(const MatrixExp &e)
                     throw error;
                 }
 
-                InternalType *pIT = getResult();
+                types::InternalType *pIT = getResult();
                 if (pIT == NULL)
                 {
                     continue;
@@ -89,10 +89,10 @@ void RunVisitorT<T>::visitprivate(const MatrixExp &e)
 
                 if (pIT->isImplicitList())
                 {
-                    ImplicitList *pIL = pIT->getAs<ImplicitList>();
+                    types::ImplicitList *pIL = pIT->getAs<types::ImplicitList>();
                     if (pIL->isComputable())
                     {
-                        InternalType* pIT2 = pIL->extractFullMatrix();
+                        types::InternalType* pIT2 = pIL->extractFullMatrix();
                         pIT->killMe();
                         pIT = pIT2;
                     }
@@ -131,8 +131,8 @@ void RunVisitorT<T>::visitprivate(const MatrixExp &e)
                     throw ast::InternalError(os.str(), 999, (*col)->getLocation());
                 }
 
-                GenericType* pGT = pIT->getAs<GenericType>();
-                if (pGT->isDouble() && pGT->getAs<Double>()->isEmpty())
+                types::GenericType* pGT = pIT->getAs<types::GenericType>();
+                if (pGT->isDouble() && pGT->getAs<types::Double>()->isEmpty())
                 {
                     pGT->killMe();
                     continue;
@@ -166,7 +166,7 @@ void RunVisitorT<T>::visitprivate(const MatrixExp &e)
                     continue;
                 }
 
-                GenericType* pGTResult = poRow->getAs<GenericType>();
+                types::GenericType* pGTResult = poRow->getAs<types::GenericType>();
 
                 //check dimension
                 if (pGT->getDims() != 2 || pGT->getRows() != pGTResult->getRows())
@@ -202,8 +202,8 @@ void RunVisitorT<T>::visitprivate(const MatrixExp &e)
                     int* piRank = new int[_iRows * _iCols];
                     memset(piRank, 0x00, _iRows * _iCols * sizeof(int));
                     poRow = new types::Polynom(pGT->getAs<types::Polynom>()->getVariableName(), _iRows, _iCols, piRank);
-                    Polynom* pP = poRow->getAs<types::Polynom>();
-                    SinglePoly** pSS = pP->get();
+                    types::Polynom* pP = poRow->getAs<types::Polynom>();
+                    types::SinglePoly** pSS = pP->get();
                     types::Double* pDb = pGTResult->getAs<types::Double>();
                     double* pdblR = pDb->get();
                     if (pDb->isComplex())
@@ -228,8 +228,8 @@ void RunVisitorT<T>::visitprivate(const MatrixExp &e)
                     delete[] piRank;
                 }
 
-                InternalType *pNewSize = AddElementToVariable(NULL, poRow, pGTResult->getRows(), pGTResult->getCols() + pGT->getCols());
-                InternalType* p = AddElementToVariable(pNewSize, pGT, 0, pGTResult->getCols());
+                types::InternalType *pNewSize = AddElementToVariable(NULL, poRow, pGTResult->getRows(), pGTResult->getCols() + pGT->getCols());
+                types::InternalType* p = AddElementToVariable(pNewSize, pGT, 0, pGTResult->getCols());
                 if (p != pNewSize)
                 {
                     pNewSize->killMe();
@@ -289,10 +289,10 @@ void RunVisitorT<T>::visitprivate(const MatrixExp &e)
                 continue;
             }
 
-            GenericType* pGT = poRow->getAs<GenericType>();
+            types::GenericType* pGT = poRow->getAs<types::GenericType>();
 
             //check dimension
-            GenericType* pGTResult = poResult->getAs<GenericType>();
+            types::GenericType* pGTResult = poResult->getAs<types::GenericType>();
 
             if (pGT->isList() || pGTResult->isList() ||
                     pGT->isStruct() || pGTResult->isStruct())
@@ -342,17 +342,17 @@ void RunVisitorT<T>::visitprivate(const MatrixExp &e)
             {
                 poResult = new types::Sparse(*pGTResult->getAs<types::Double>());
                 pGTResult->killMe();
-                pGTResult = poResult->getAs<GenericType>();
+                pGTResult = poResult->getAs<types::GenericType>();
             }
             else if (pGT->isSparseBool() && pGTResult->isBool()) // [Bool SparseBool] => [SparseBool SparseBool]
             {
                 poResult = new types::SparseBool(*pGTResult->getAs<types::Bool>());
                 pGTResult->killMe();
-                pGTResult = poResult->getAs<GenericType>();
+                pGTResult = poResult->getAs<types::GenericType>();
             }
 
-            InternalType* pNewSize = AddElementToVariable(NULL, poResult, pGTResult->getRows() + pGT->getRows(), pGT->getCols());
-            InternalType* p = AddElementToVariable(pNewSize, pGT, pGTResult->getRows(), 0);
+            types::InternalType* pNewSize = AddElementToVariable(NULL, poResult, pGTResult->getRows() + pGT->getRows(), pGT->getCols());
+            types::InternalType* p = AddElementToVariable(pNewSize, pGT, pGTResult->getRows(), 0);
             if (p != pNewSize)
             {
                 pNewSize->killMe();
@@ -390,7 +390,7 @@ void RunVisitorT<T>::visitprivate(const MatrixExp &e)
         }
         else
         {
-            setResult(Double::Empty());
+            setResult(types::Double::Empty());
         }
     }
     catch (const InternalError& error)
@@ -401,11 +401,11 @@ void RunVisitorT<T>::visitprivate(const MatrixExp &e)
 }
 
 template<class T>
-types::InternalType* RunVisitorT<T>::callOverloadMatrixExp(std::wstring strType, types::InternalType* _paramL, types::InternalType* _paramR)
+types::InternalType* RunVisitorT<T>::callOverloadMatrixExp(const std::wstring& strType, types::InternalType* _paramL, types::InternalType* _paramR)
 {
     types::typed_list in;
     types::typed_list out;
-    Callable::ReturnValue Ret;
+    types::Callable::ReturnValue Ret;
 
     _paramL->IncreaseRef();
     _paramR->IncreaseRef();
@@ -421,7 +421,7 @@ types::InternalType* RunVisitorT<T>::callOverloadMatrixExp(std::wstring strType,
         }
         else
         {
-            Ret = Overload::call(L"%" + _paramL->getAs<List>()->getShortTypeStr() + L"_" + strType + L"_" + _paramR->getAs<List>()->getShortTypeStr(), in, 1, out, this, true);
+            Ret = Overload::call(L"%" + _paramL->getAs<types::List>()->getShortTypeStr() + L"_" + strType + L"_" + _paramR->getAs<types::List>()->getShortTypeStr(), in, 1, out, this, true);
         }
     }
     catch (const InternalError& error)
@@ -430,7 +430,7 @@ types::InternalType* RunVisitorT<T>::callOverloadMatrixExp(std::wstring strType,
         throw error;
     }
 
-    if (Ret != Callable::OK)
+    if (Ret != types::Callable::OK)
     {
         cleanInOut(in, out);
         throw InternalError(ConfigVariable::getLastErrorMessage());
index e62473d..cfdfbec 100644 (file)
@@ -16,7 +16,7 @@ namespace ast {
 template<class T>
 void RunVisitorT<T>::visitprivate(const OpExp &e)
 {
-    InternalType * pITL = NULL, * pITR = NULL, * pResult = NULL;
+    types::InternalType * pITL = NULL, *pITR = NULL, *pResult = NULL;
     try
     {
         /*getting what to assign*/
@@ -43,9 +43,9 @@ void RunVisitorT<T>::visitprivate(const OpExp &e)
         }
         pITR = getResult();
 
-        if (pITL->getType() == GenericType::ScilabImplicitList)
+        if (pITL->getType() == types::InternalType::ScilabImplicitList)
         {
-            ImplicitList* pIL = pITL->getAs<ImplicitList>();
+            types::ImplicitList* pIL = pITL->getAs<types::ImplicitList>();
             if (pIL->isComputable())
             {
                 pITL = pIL->extractFullMatrix();
@@ -53,9 +53,9 @@ void RunVisitorT<T>::visitprivate(const OpExp &e)
             }
         }
 
-        if (pITR->getType() == GenericType::ScilabImplicitList)
+        if (pITR->getType() == types::InternalType::ScilabImplicitList)
         {
-            ImplicitList* pIR = pITR->getAs<ImplicitList>();
+            types::ImplicitList* pIR = pITR->getAs<types::ImplicitList>();
             if (pIR->isComputable())
             {
                 pITR = pIR->extractFullMatrix();
@@ -220,11 +220,11 @@ void RunVisitorT<T>::visitprivate(const LogicalOpExp &e)
 {
     try
     {
-        InternalType *pITR = NULL; //assign only in non shortcut operations.
+        types::InternalType *pITR = NULL; //assign only in non shortcut operations.
 
         /*getting what to assign*/
         e.getLeft().accept(*this);
-        InternalType *pITL = getResult();
+        types::InternalType *pITL = getResult();
         if (isSingleResult() == false)
         {
             std::wostringstream os;
@@ -235,9 +235,9 @@ void RunVisitorT<T>::visitprivate(const LogicalOpExp &e)
 
         setResult(NULL);
 
-        if (pITL->getType() == GenericType::ScilabImplicitList)
+        if (pITL->getType() == types::InternalType::ScilabImplicitList)
         {
-            ImplicitList* pIL = pITL->getAs<ImplicitList>();
+            types::ImplicitList* pIL = pITL->getAs<types::ImplicitList>();
             if (pIL->isComputable())
             {
                 pITL = pIL->extractFullMatrix();
@@ -245,7 +245,7 @@ void RunVisitorT<T>::visitprivate(const LogicalOpExp &e)
             }
         }
 
-        InternalType *pResult   = NULL;
+        types::InternalType *pResult = NULL;
 
         switch (e.getOper())
         {
@@ -272,9 +272,9 @@ void RunVisitorT<T>::visitprivate(const LogicalOpExp &e)
                     throw ast::InternalError(os.str(), 999, e.getRight().getLocation());
                 }
 
-                if (pITR->getType() == GenericType::ScilabImplicitList)
+                if (pITR->getType() == types::InternalType::ScilabImplicitList)
                 {
-                    ImplicitList* pIR = pITR->getAs<ImplicitList>();
+                    types::ImplicitList* pIR = pITR->getAs<types::ImplicitList>();
                     if (pIR->isComputable())
                     {
                         pITR = pIR->extractFullMatrix();
@@ -307,9 +307,9 @@ void RunVisitorT<T>::visitprivate(const LogicalOpExp &e)
                     throw ast::InternalError(os.str(), 999, e.getRight().getLocation());
                 }
 
-                if (pITR->getType() == GenericType::ScilabImplicitList)
+                if (pITR->getType() == types::InternalType::ScilabImplicitList)
                 {
-                    ImplicitList* pIR = pITR->getAs<ImplicitList>();
+                    types::ImplicitList* pIR = pITR->getAs<types::ImplicitList>();
                     if (pIR->isComputable())
                     {
                         pITR = pIR->extractFullMatrix();
index 15d3580..f80a304 100644 (file)
@@ -90,10 +90,10 @@ void RunVisitorT<T>::visitprivate(const CellExp &e)
         for (j = 0, col = cols.begin() ; col != cols.end() ; ++col, ++j)
         {
             (*col)->accept(*this);
-            InternalType *pIT = getResult();
+            types::InternalType *pIT = getResult();
             if (pIT->isImplicitList())
             {
-                InternalType * _pIT = pIT->getAs<ImplicitList>()->extractFullMatrix();
+                types::InternalType * _pIT = pIT->getAs<types::ImplicitList>()->extractFullMatrix();
                 pC->set(i, j, _pIT);
                 _pIT->killMe();
             }
@@ -152,15 +152,15 @@ void RunVisitorT<T>::visitprivate(const FieldExp &e)
 
     SimpleVar * psvRightMember = static_cast<SimpleVar *>(const_cast<Exp *>(e.getTail()));
     std::wstring wstField = psvRightMember->getSymbol().getName();
-    InternalType * pValue = getResult();
-    InternalType * pReturn = NULL;
+    types::InternalType * pValue = getResult();
+    types::InternalType * pReturn = NULL;
     bool ok = false;
 
     try
     {
         if (pValue->isGenericType() || pValue->isUserType())
         {
-            ok = pValue->getAs<GenericType>()->extract(wstField, pReturn);
+            ok = pValue->getAs<types::GenericType>()->extract(wstField, pReturn);
         }
     }
     catch (std::wstring & err)
@@ -200,7 +200,7 @@ void RunVisitorT<T>::visitprivate(const FieldExp &e)
         types::typed_list in;
         types::typed_list out;
 
-        String* pS = new String(wstField.c_str());
+        types::String* pS = new types::String(wstField.c_str());
 
         //TODO: in the case where overload is a macro there is no need to incref in
         // because args will be put in context, removed and killed if required.
@@ -211,7 +211,7 @@ void RunVisitorT<T>::visitprivate(const FieldExp &e)
 
         in.push_back(pS);
         in.push_back(pValue);
-        Callable::ReturnValue Ret = Callable::Error;
+        types::Callable::ReturnValue Ret = types::Callable::Error;
         std::wstring stType = pValue->getShortTypeStr();
 
         try
@@ -247,7 +247,7 @@ void RunVisitorT<T>::visitprivate(const FieldExp &e)
             }
         }
 
-        if (Ret != Callable::OK)
+        if (Ret != types::Callable::OK)
         {
             cleanInOut(in, out);
             setResult(NULL);
@@ -328,7 +328,7 @@ void RunVisitorT<T>::visitprivate(const WhileExp  &e)
     //condition
     e.getTest().accept(*this);
 
-    InternalType* pIT = getResult();
+    types::InternalType* pIT = getResult();
 
     while (pIT->isTrue())
     {
@@ -374,14 +374,14 @@ void RunVisitorT<T>::visitprivate(const ForExp  &e)
     symbol::Context* ctx = symbol::Context::getInstance();
     //vardec visit increase its result reference
     e.getVardec().accept(*this);
-    InternalType* pIT = getResult();
+    types::InternalType* pIT = getResult();
 
     if (pIT->isImplicitList())
     {
         //get IL
-        ImplicitList* pVar = pIT->getAs<ImplicitList>();
+        types::ImplicitList* pVar = pIT->getAs<types::ImplicitList>();
         //get IL initial Type
-        InternalType * pIL = pVar->getInitalType();
+        types::InternalType * pIL = pVar->getInitalType();
         //std::cout << "for IL: " << pIL << std::endl;
         //std::cout << "  for IV: " << pIT << std::endl;
         //get index stack
@@ -480,12 +480,12 @@ void RunVisitorT<T>::visitprivate(const ForExp  &e)
     }
     else if (pIT->isList())
     {
-        List* pL = pIT->getAs<List>();
+        types::List* pL = pIT->getAs<types::List>();
         const int size = pL->getSize();
         symbol::Variable* var = e.getVardec().getAs<VarDec>()->getStack();
         for (int i = 0; i < size; ++i)
         {
-            InternalType* pNew = pL->get(i);
+            types::InternalType* pNew = pL->get(i);
 
             if (ctx->isprotected(var))
             {
@@ -531,7 +531,7 @@ void RunVisitorT<T>::visitprivate(const ForExp  &e)
     else if (pIT->isGenericType())
     {
         //Matrix i = [1,3,2,6] or other type
-        GenericType* pVar = pIT->getAs<GenericType>();
+        types::GenericType* pVar = pIT->getAs<types::GenericType>();
         if (pVar->getDims() > 2)
         {
             pIT->DecreaseRef();
@@ -542,7 +542,7 @@ void RunVisitorT<T>::visitprivate(const ForExp  &e)
         symbol::Variable* var = e.getVardec().getAs<VarDec>()->getStack();
         for (int i = 0; i < pVar->getCols(); i++)
         {
-            GenericType* pNew = pVar->getColumnValues(i);
+            types::GenericType* pNew = pVar->getColumnValues(i);
             if (pNew == NULL)
             {
                 pIT->DecreaseRef();
@@ -714,12 +714,12 @@ template <class T>
 void RunVisitorT<T>::visitprivate(const StringSelectExp &e)
 {
     e.getSelect()->accept(*this);
-    InternalType* pIT = getResult();
+    types::InternalType* pIT = getResult();
     setResult(nullptr);
     bool found = false;
     if (pIT && pIT->isString())
     {
-        String * pStr = static_cast<String *>(pIT);
+        types::String * pStr = static_cast<types::String *>(pIT);
         if (pStr->getSize() == 1)
         {
             if (wchar_t * s = pStr->get(0))
@@ -794,7 +794,7 @@ void RunVisitorT<T>::visitprivate(const SelectExp &e)
     e.getSelect()->accept(*this);
     bool bCase = false;
 
-    InternalType* pIT = getResult();
+    types::InternalType* pIT = getResult();
     setResult(NULL);
     if (pIT)
     {
@@ -808,7 +808,7 @@ void RunVisitorT<T>::visitprivate(const SelectExp &e)
         {
             CaseExp* pCase = exp->getAs<CaseExp>();
             pCase->getTest()->accept(*this);
-            InternalType *pITCase = getResult();
+            types::InternalType *pITCase = getResult();
             setResult(NULL);
             if (pITCase)
             {
@@ -928,13 +928,13 @@ void RunVisitorT<T>::visitprivate(const SeqExp  &e)
             setExpectedSize(-1);
             exp->accept(*this);
             setExpectedSize(iExpectedSize);
-            InternalType * pIT = getResult();
+            types::InternalType * pIT = getResult();
 
             // In case of exec file, set the file name in the Macro to store where it is defined.
             int iFileID = ConfigVariable::getExecutedFileID();
             if (iFileID && exp->isFunctionDec())
             {
-                InternalType* pITMacro = symbol::Context::getInstance()->get(exp->getAs<FunctionDec>()->getSymbol());
+                types::InternalType* pITMacro = symbol::Context::getInstance()->get(exp->getAs<FunctionDec>()->getSymbol());
                 if (pITMacro)
                 {
                     types::Macro* pMacro = pITMacro->getAs<types::Macro>();
@@ -953,10 +953,10 @@ void RunVisitorT<T>::visitprivate(const SeqExp  &e)
                 bool bImplicitCall = false;
                 if (pIT->isCallable()) //to manage call without ()
                 {
-                    Callable *pCall = pIT->getAs<Callable>();
-                    typed_list out;
-                    typed_list in;
-                    optional_list opt;
+                    types::Callable *pCall = pIT->getAs<types::Callable>();
+                    types::typed_list out;
+                    types::typed_list in;
+                    types::optional_list opt;
 
                     try
                     {
@@ -994,7 +994,7 @@ void RunVisitorT<T>::visitprivate(const SeqExp  &e)
                 if (getResult() != NULL && (!exp->isSimpleVar() || bImplicitCall))
                 {
                     //symbol::Context::getInstance()->put(symbol::Symbol(L"ans"), *execMe.getResult());
-                    InternalType* pITAns = getResult();
+                    types::InternalType* pITAns = getResult();
                     symbol::Context::getInstance()->put(m_pAns, pITAns);
                     if (exp->isVerbose() && ConfigVariable::isPromptShow())
                     {
@@ -1050,8 +1050,8 @@ void RunVisitorT<T>::visitprivate(const NotExp &e)
     */
     e.getExp().accept(*this);
 
-    InternalType * pValue = getResult();
-    InternalType * pReturn = NULL;
+    types::InternalType * pValue = getResult();
+    types::InternalType * pReturn = NULL;
     if (pValue->neg(pReturn))
     {
         if (pValue != pReturn)
@@ -1070,9 +1070,9 @@ void RunVisitorT<T>::visitprivate(const NotExp &e)
         pValue->IncreaseRef();
         in.push_back(pValue);
 
-        Callable::ReturnValue Ret = Overload::call(L"%" + pValue->getShortTypeStr() + L"_5", in, 1, out, this);
+        types::Callable::ReturnValue Ret = Overload::call(L"%" + pValue->getShortTypeStr() + L"_5", in, 1, out, this);
 
-        if (Ret != Callable::OK)
+        if (Ret != types::Callable::OK)
         {
             cleanInOut(in, out);
             throw InternalError(ConfigVariable::getLastErrorMessage(), ConfigVariable::getLastErrorNumber(), e.getLocation());
@@ -1096,8 +1096,8 @@ void RunVisitorT<T>::visitprivate(const TransposeExp &e)
         throw InternalError(szError, 999, e.getLocation());
     }
 
-    InternalType * pValue = getResult();
-    InternalType * pReturn = NULL;
+    types::InternalType * pValue = getResult();
+    types::InternalType * pReturn = NULL;
     const bool bConjug = e.getConjugate() == TransposeExp::_Conjugate_;
 
     if ((bConjug && pValue->adjoint(pReturn)) || (!bConjug && pValue->transpose(pReturn)))
@@ -1120,7 +1120,7 @@ void RunVisitorT<T>::visitprivate(const TransposeExp &e)
         pValue->IncreaseRef();
         in.push_back(pValue);
 
-        Callable::ReturnValue Ret;
+        types::Callable::ReturnValue Ret;
         if (bConjug)
         {
             Ret = Overload::call(L"%" + getResult()->getShortTypeStr() + L"_t", in, 1, out, this);
@@ -1130,7 +1130,7 @@ void RunVisitorT<T>::visitprivate(const TransposeExp &e)
             Ret = Overload::call(L"%" + getResult()->getShortTypeStr() + L"_0", in, 1, out, this);
         }
 
-        if (Ret != Callable::OK)
+        if (Ret != types::Callable::OK)
         {
             cleanInOut(in, out);
             throw InternalError(ConfigVariable::getLastErrorMessage(), ConfigVariable::getLastErrorNumber(), e.getLocation());
@@ -1237,8 +1237,8 @@ template <class T>
 void RunVisitorT<T>::visitprivate(const ListExp &e)
 {
     e.getStart().accept(*this);
-    GenericType* pITStart = static_cast<GenericType*>(getResult());
-    if ((pITStart->getSize() != 1 || (pITStart->isDouble() && pITStart->getAs<Double>()->isComplex())) &&
+    types::GenericType* pITStart = static_cast<types::GenericType*>(getResult());
+    if ((pITStart->getSize() != 1 || (pITStart->isDouble() && pITStart->getAs<types::Double>()->isComplex())) &&
             pITStart->isList() == false) // list case => call overload
     {
         pITStart->killMe();
@@ -1246,11 +1246,11 @@ void RunVisitorT<T>::visitprivate(const ListExp &e)
         os_swprintf(szError, bsiz, _W("%ls: Wrong type for argument %d: Real scalar expected.\n").c_str(), L"':'", 1);
         throw InternalError(szError, 999, e.getLocation());
     }
-    InternalType * piStart = pITStart;
+    types::InternalType * piStart = pITStart;
 
     e.getStep().accept(*this);
-    GenericType* pITStep = static_cast<GenericType*>(getResult());
-    if ((pITStep->getSize() != 1 || (pITStep->isDouble() && pITStep->getAs<Double>()->isComplex())) &&
+    types::GenericType* pITStep = static_cast<types::GenericType*>(getResult());
+    if ((pITStep->getSize() != 1 || (pITStep->isDouble() && pITStep->getAs<types::Double>()->isComplex())) &&
             pITStep->isList() == false) // list case => call overload
     {
         pITStart->killMe();
@@ -1259,11 +1259,11 @@ void RunVisitorT<T>::visitprivate(const ListExp &e)
         os_swprintf(szError, bsiz, _W("%ls: Wrong type for argument %d: Real scalar expected.\n").c_str(), L"':'", 2);
         throw InternalError(szError, 999, e.getLocation());
     }
-    InternalType* piStep = pITStep;
+    types::InternalType* piStep = pITStep;
 
     e.getEnd().accept(*this);
-    GenericType* pITEnd = static_cast<GenericType*>(getResult());
-    if ((pITEnd->getSize() != 1 || (pITEnd->isDouble() && pITEnd->getAs<Double>()->isComplex())) &&
+    types::GenericType* pITEnd = static_cast<types::GenericType*>(getResult());
+    if ((pITEnd->getSize() != 1 || (pITEnd->isDouble() && pITEnd->getAs<types::Double>()->isComplex())) &&
             pITEnd->isList() == false) // list case => call overload
     {
         pITStart->killMe();
@@ -1273,7 +1273,7 @@ void RunVisitorT<T>::visitprivate(const ListExp &e)
         os_swprintf(szError, bsiz, _W("%ls: Wrong type for argument %d: Real scalar expected.\n").c_str(), L"':'", 3);
         throw InternalError(szError, 999, e.getLocation());
     }
-    InternalType* piEnd = pITEnd;
+    types::InternalType* piEnd = pITEnd;
 
     ////check if implicitlist is 1:$ to replace by ':'
     //if (piStart->isDouble() && piStep->isDouble() && piEnd->isPoly())
@@ -1296,7 +1296,7 @@ void RunVisitorT<T>::visitprivate(const ListExp &e)
             (piEnd->isPoly()   || piEnd->isDouble()))
     {
         // No need to kill piStart, ... because Implicit list ctor will incref them
-        setResult(new ImplicitList(piStart, piStep, piEnd));
+        setResult(new types::ImplicitList(piStart, piStep, piEnd));
         return;
     }
 
@@ -1311,13 +1311,13 @@ void RunVisitorT<T>::visitprivate(const ListExp &e)
                  piStep->isDouble()))
         {
             // No need to kill piStart, ... because Implicit list ctor will incref them
-            setResult(new ImplicitList(piStart, piStep, piEnd));
+            setResult(new types::ImplicitList(piStart, piStep, piEnd));
             return;
         }
     }
 
     // Call Overload
-    Callable::ReturnValue Ret;
+    types::Callable::ReturnValue Ret;
     types::typed_list in;
     types::typed_list out;
 
@@ -1352,7 +1352,7 @@ void RunVisitorT<T>::visitprivate(const ListExp &e)
         throw error;
     }
 
-    if (Ret != Callable::OK)
+    if (Ret != types::Callable::OK)
     {
         cleanInOut(in, out);
         throw InternalError(ConfigVariable::getLastErrorMessage(), ConfigVariable::getLastErrorNumber(), e.getLocation());
@@ -1376,16 +1376,16 @@ void RunVisitorT<T>::visitprivate(const MemfillExp &e)
 template <class T>
 void RunVisitorT<T>::visitprivate(const DAXPYExp &e)
 {
-    InternalType* pIT = NULL;
-    Double* ad = NULL;
+    types::InternalType* pIT = NULL;
+    types::Double* ad = NULL;
     int ar = 0;
     int ac = 0;
 
-    Double* xd = NULL;
+    types::Double* xd = NULL;
     int xr = 0;
     int xc = 0;
 
-    Double* yd = NULL;
+    types::Double* yd = NULL;
     int yr = 0;
     int yc = 0;
 
@@ -1397,7 +1397,7 @@ void RunVisitorT<T>::visitprivate(const DAXPYExp &e)
     pIT = getResult();
     if (pIT->isDouble())
     {
-        yd = pIT->getAs<Double>();
+        yd = pIT->getAs<types::Double>();
         if (yd->getDims() == 2 && yd->isComplex() == false)
         {
             yr = yd->getRows();
@@ -1424,7 +1424,7 @@ void RunVisitorT<T>::visitprivate(const DAXPYExp &e)
 
     if (pIT->isDouble())
     {
-        xd = pIT->getAs<Double>();
+        xd = pIT->getAs<types::Double>();
         if (xd->isScalar() && xd->isComplex() == false)
         {
             // x become a
@@ -1461,7 +1461,7 @@ void RunVisitorT<T>::visitprivate(const DAXPYExp &e)
     {
         if (ad)
         {
-            xd = pIT->getAs<Double>();
+            xd = pIT->getAs<types::Double>();
             //X is scalar it become A
             //now use A as X
             if (xd->getDims() == 2 && xd->isComplex() == false)
@@ -1481,7 +1481,7 @@ void RunVisitorT<T>::visitprivate(const DAXPYExp &e)
         else
         {
             //a is a and it must be scalar
-            ad = pIT->getAs<Double>();
+            ad = pIT->getAs<types::Double>();
             if (/*ad->isScalar() && */ad->isComplex() == false)
             {
                 ar = ad->getRows(); //1;
index 7872d6f..1cab97a 100644 (file)
@@ -140,7 +140,7 @@ void TreeVisitor::visit(const MatrixExp &e)
 
     if (lines.size() == 0)
     {
-        l = createConst(Double::Empty());
+        l = createConst(types::Double::Empty());
         return;
     }
 
@@ -949,7 +949,7 @@ void TreeVisitor::visit(const TransposeExp  &e)
 void TreeVisitor::visit(const FunctionDec  &e)
 {
     wchar_t* pwstState;
-    wostringstream wostr;
+    std::wostringstream wostr;
     PrintVisitor pv(wostr, false, false);
 
     types::TList* function = new types::TList();
@@ -992,7 +992,7 @@ void TreeVisitor::visit(const FunctionDec  &e)
     FREE(pwstFun);
 
     // Now print function body
-    wostringstream wostrBody;
+    std::wostringstream wostrBody;
     PrintVisitor pvBody(wostrBody, false, true);
     std::vector<wchar_t*> allTokens;
     e.getBody().getOriginal()->accept(pvBody);
index b99c1ed..c999734 100644 (file)
@@ -37,54 +37,54 @@ size_t ast::Ast::globalNodeNumber = 0;
 /*
  * Generate destination variable from _poSource type and size parameters
  */
-InternalType* allocDest(InternalType* _poSource, int _iRows, int _iCols)
+types::InternalType* allocDest(types::InternalType* _poSource, int _iRows, int _iCols)
 {
-    InternalType* poResult = NULL;
+    types::InternalType* poResult = NULL;
     switch (_poSource->getType())
     {
-        case GenericType::ScilabDouble :
-            poResult = new Double(_iRows, _iCols, false);
+        case types::InternalType::ScilabDouble :
+            poResult = new types::Double(_iRows, _iCols, false);
             break;
-        case GenericType::ScilabBool :
-            poResult = new Bool(_iRows, _iCols);
+        case types::InternalType::ScilabBool :
+            poResult = new types::Bool(_iRows, _iCols);
             break;
-        case GenericType::ScilabInt8 :
-            poResult = new Int8(_iRows, _iCols);
+        case types::InternalType::ScilabInt8 :
+            poResult = new types::Int8(_iRows, _iCols);
             break;
-        case GenericType::ScilabUInt8 :
-            poResult = new UInt8(_iRows, _iCols);
+        case types::InternalType::ScilabUInt8 :
+            poResult = new types::UInt8(_iRows, _iCols);
             break;
-        case GenericType::ScilabInt16 :
-            poResult = new Int16(_iRows, _iCols);
+        case types::InternalType::ScilabInt16 :
+            poResult = new types::Int16(_iRows, _iCols);
             break;
-        case GenericType::ScilabUInt16 :
-            poResult = new UInt16(_iRows, _iCols);
+        case types::InternalType::ScilabUInt16 :
+            poResult = new types::UInt16(_iRows, _iCols);
             break;
-        case GenericType::ScilabInt32 :
-            poResult = new Int32(_iRows, _iCols);
+        case types::InternalType::ScilabInt32 :
+            poResult = new types::Int32(_iRows, _iCols);
             break;
-        case GenericType::ScilabUInt32 :
-            poResult = new UInt32(_iRows, _iCols);
+        case types::InternalType::ScilabUInt32 :
+            poResult = new types::UInt32(_iRows, _iCols);
             break;
-        case GenericType::ScilabInt64 :
-            poResult = new Int64(_iRows, _iCols);
+        case types::InternalType::ScilabInt64 :
+            poResult = new types::Int64(_iRows, _iCols);
             break;
-        case GenericType::ScilabUInt64 :
-            poResult = new UInt64(_iRows, _iCols);
+        case types::InternalType::ScilabUInt64 :
+            poResult = new types::UInt64(_iRows, _iCols);
             break;
-        case GenericType::ScilabString :
-            poResult = new String(_iRows, _iCols);
+        case types::InternalType::ScilabString :
+            poResult = new types::String(_iRows, _iCols);
             break;
-        case GenericType::ScilabPolynom :
+        case types::InternalType::ScilabPolynom :
         {
             int* piRank = new int[_iRows * _iCols];
             memset(piRank, 0x00, _iRows * _iCols * sizeof(int));
-            poResult = new Polynom(_poSource->getAs<Polynom>()->getVariableName(), _iRows, _iCols, piRank);
+            poResult = new types::Polynom(_poSource->getAs<types::Polynom>()->getVariableName(), _iRows, _iCols, piRank);
             delete[] piRank;
             break;
         }
-        case InternalType::ScilabImplicitList :
-            poResult = new ImplicitList();
+        case types::InternalType::ScilabImplicitList:
+            poResult = new types::ImplicitList();
             break;
         default :
             // FIXME : What should we do here ??
@@ -93,11 +93,11 @@ InternalType* allocDest(InternalType* _poSource, int _iRows, int _iCols)
     return poResult;
 }
 
-InternalType* AddElementToVariableFromCol(InternalType* _poDest, InternalType* _poSource, int _iRows, int _iCols, int *_piCols)
+types::InternalType* AddElementToVariableFromCol(types::InternalType* _poDest, types::InternalType* _poSource, int _iRows, int _iCols, int *_piCols)
 {
-    InternalType *poResult = NULL;
-    InternalType::ScilabType TypeSource = _poSource->getType();
-    InternalType::ScilabType TypeDest = InternalType::ScilabInternal;
+    types::InternalType *poResult = NULL;
+    types::InternalType::ScilabType TypeSource = _poSource->getType();
+    types::InternalType::ScilabType TypeDest = types::InternalType::ScilabInternal;
 
     if (_poDest == NULL)
     {
@@ -119,14 +119,14 @@ InternalType* AddElementToVariableFromCol(InternalType* _poDest, InternalType* _
     {
         switch (TypeDest)
         {
-            case GenericType::ScilabDouble :
-                if (poResult->getAs<Double>()->isComplex() == false && _poSource->getAs<Double>()->isComplex() == true)
+            case types::InternalType::ScilabDouble :
+                if (poResult->getAs<types::Double>()->isComplex() == false && _poSource->getAs<types::Double>()->isComplex() == true)
                 {
-                    poResult->getAs<Double>()->setComplex(true);
+                    poResult->getAs<types::Double>()->setComplex(true);
                 }
 
-                poResult->getAs<Double>()->fillFromCol(*_piCols, _poSource->getAs<Double>());
-                *_piCols += _poSource->getAs<Double>()->getCols();
+                poResult->getAs<types::Double>()->fillFromCol(*_piCols, _poSource->getAs<types::Double>());
+                *_piCols += _poSource->getAs<types::Double>()->getCols();
 
                 break;
             default:
@@ -137,11 +137,11 @@ InternalType* AddElementToVariableFromCol(InternalType* _poDest, InternalType* _
     return NULL;
 }
 
-InternalType* AddElementToVariableFromRow(InternalType* _poDest, InternalType* _poSource, int _iRows, int _iCols, int *_piRows)
+types::InternalType* AddElementToVariableFromRow(types::InternalType* _poDest, types::InternalType* _poSource, int _iRows, int _iCols, int *_piRows)
 {
-    InternalType *poResult = NULL;
-    InternalType::ScilabType TypeSource = _poSource->getType();
-    InternalType::ScilabType TypeDest = InternalType::ScilabInternal;
+    types::InternalType *poResult = NULL;
+    types::InternalType::ScilabType TypeSource = _poSource->getType();
+    types::InternalType::ScilabType TypeDest = types::InternalType::ScilabInternal;
 
     if (_poDest == NULL)
     {
@@ -164,14 +164,14 @@ InternalType* AddElementToVariableFromRow(InternalType* _poDest, InternalType* _
     {
         switch (TypeDest)
         {
-            case GenericType::ScilabDouble :
-                if (poResult->getAs<Double>()->isComplex() == false && _poSource->getAs<Double>()->isComplex() == true)
+            case types::InternalType::ScilabDouble :
+                if (poResult->getAs<types::Double>()->isComplex() == false && _poSource->getAs<types::Double>()->isComplex() == true)
                 {
-                    poResult->getAs<Double>()->setComplex(true);
+                    poResult->getAs<types::Double>()->setComplex(true);
                 }
 
-                poResult->getAs<Double>()->fillFromRow(*_piRows, _poSource->getAs<Double>());
-                *_piRows += _poSource->getAs<Double>()->getRows();
+                poResult->getAs<types::Double>()->fillFromRow(*_piRows, _poSource->getAs<types::Double>());
+                *_piRows += _poSource->getAs<types::Double>()->getRows();
 
                 break;
             default:
@@ -187,12 +187,12 @@ InternalType* AddElementToVariableFromRow(InternalType* _poDest, InternalType* _
 _iRows : Position if _poDest allready initialized else size of the matrix
 _iCols : Position if _poDest allready initialized else size of the matrix
 */
-InternalType* AddElementToVariable(InternalType* _poDest, InternalType* _poSource, int _iRows, int _iCols)
+types::InternalType* AddElementToVariable(types::InternalType* _poDest, types::InternalType* _poSource, int _iRows, int _iCols)
 {
-    InternalType *poResult = NULL;
+    types::InternalType *poResult = NULL;
     bool isNew = true;
-    InternalType::ScilabType TypeSource = _poSource->getType();
-    InternalType::ScilabType TypeDest = InternalType::ScilabInternal;
+    types::InternalType::ScilabType TypeSource = _poSource->getType();
+    types::InternalType::ScilabType TypeDest = types::InternalType::ScilabInternal;
     int iCurRow = _iRows;
     int iCurCol = _iCols;
 
@@ -200,58 +200,58 @@ InternalType* AddElementToVariable(InternalType* _poDest, InternalType* _poSourc
     {
         switch (TypeSource)
         {
-            case GenericType::ScilabDouble :
-                poResult = new Double(_iRows, _iCols);
+            case types::InternalType::ScilabDouble :
+                poResult = new types::Double(_iRows, _iCols);
                 break;
-            case GenericType::ScilabBool :
-                poResult = new Bool(_iRows, _iCols);
+            case types::InternalType::ScilabBool :
+                poResult = new types::Bool(_iRows, _iCols);
                 break;
-            case GenericType::ScilabInt8 :
-                poResult = new Int8(_iRows, _iCols);
+            case types::InternalType::ScilabInt8 :
+                poResult = new types::Int8(_iRows, _iCols);
                 break;
-            case GenericType::ScilabUInt8 :
-                poResult = new UInt8(_iRows, _iCols);
+            case types::InternalType::ScilabUInt8 :
+                poResult = new types::UInt8(_iRows, _iCols);
                 break;
-            case GenericType::ScilabInt16 :
-                poResult = new Int16(_iRows, _iCols);
+            case types::InternalType::ScilabInt16 :
+                poResult = new types::Int16(_iRows, _iCols);
                 break;
-            case GenericType::ScilabUInt16 :
-                poResult = new UInt16(_iRows, _iCols);
+            case types::InternalType::ScilabUInt16 :
+                poResult = new types::UInt16(_iRows, _iCols);
                 break;
-            case GenericType::ScilabInt32 :
-                poResult = new Int32(_iRows, _iCols);
+            case types::InternalType::ScilabInt32 :
+                poResult = new types::Int32(_iRows, _iCols);
                 break;
-            case GenericType::ScilabUInt32 :
-                poResult = new UInt32(_iRows, _iCols);
+            case types::InternalType::ScilabUInt32 :
+                poResult = new types::UInt32(_iRows, _iCols);
                 break;
-            case GenericType::ScilabInt64 :
-                poResult = new Int64(_iRows, _iCols);
+            case types::InternalType::ScilabInt64 :
+                poResult = new types::Int64(_iRows, _iCols);
                 break;
-            case GenericType::ScilabUInt64 :
-                poResult = new UInt64(_iRows, _iCols);
+            case types::InternalType::ScilabUInt64 :
+                poResult = new types::UInt64(_iRows, _iCols);
                 break;
-            case GenericType::ScilabString :
-                poResult = new String(_iRows, _iCols);
+            case types::InternalType::ScilabString :
+                poResult = new types::String(_iRows, _iCols);
                 break;
-            case GenericType::ScilabSparse :
-                poResult = new Sparse(_iRows, _iCols);
+            case types::InternalType::ScilabSparse :
+                poResult = new types::Sparse(_iRows, _iCols);
                 break;
-            case GenericType::ScilabSparseBool :
-                poResult = new SparseBool(_iRows, _iCols);
+            case types::InternalType::ScilabSparseBool :
+                poResult = new types::SparseBool(_iRows, _iCols);
                 break;
-            case GenericType::ScilabPolynom :
+            case types::InternalType::ScilabPolynom :
             {
                 int* piRank = new int[_iRows * _iCols];
                 memset(piRank, 0x00, _iRows * _iCols * sizeof(int));
-                poResult = new Polynom(_poSource->getAs<Polynom>()->getVariableName(), _iRows, _iCols, piRank);
+                poResult = new types::Polynom(_poSource->getAs<types::Polynom>()->getVariableName(), _iRows, _iCols, piRank);
                 delete[] piRank;
                 break;
             }
-            case InternalType::ScilabImplicitList :
-                poResult = new ImplicitList();
+            case types::InternalType::ScilabImplicitList :
+                poResult = new types::ImplicitList();
                 break;
-            case GenericType::ScilabHandle :
-                poResult = new GraphicHandle(_iRows, _iCols);
+            case types::InternalType::ScilabHandle :
+                poResult = new types::GraphicHandle(_iRows, _iCols);
                 break;
             default :
                 // FIXME What should we do here ...
@@ -274,11 +274,11 @@ InternalType* AddElementToVariable(InternalType* _poDest, InternalType* _poSourc
         //check if source type is compatible with dest type
         switch (TypeDest)
         {
-            case GenericType::ScilabDouble :
-                if (TypeSource == GenericType::ScilabPolynom)
+            case types::InternalType::ScilabDouble :
+                if (TypeSource == types::InternalType::ScilabPolynom)
                 {
-                    Double *poDest = _poDest->getAs<Double>();
-                    Polynom* pPSource = _poSource->getAs<Polynom>();
+                    types::Double *poDest = _poDest->getAs<types::Double>();
+                    types::Polynom* pPSource = _poSource->getAs<types::Polynom>();
 
                     //Convert Dest to ScilabPolynom
                     int iSize = poDest->getSize();
@@ -288,14 +288,14 @@ InternalType* AddElementToVariable(InternalType* _poDest, InternalType* _poSourc
                     {
                         poResult->killMe();
                     }
-                    poResult = new Polynom(pPSource->getVariableName(), poDest->getRows(), poDest->getCols(), piRank);
+                    poResult = new types::Polynom(pPSource->getVariableName(), poDest->getRows(), poDest->getCols(), piRank);
                     delete[] piRank;
 
-                    Polynom* pPResult = poResult->getAs<Polynom>();
+                    types::Polynom* pPResult = poResult->getAs<types::Polynom>();
                     pPResult->setComplex(poDest->isComplex());
 
                     double *pR = poDest->getReal();
-                    SinglePoly** pSP = pPResult->get();
+                    types::SinglePoly** pSP = pPResult->get();
 
                     if (poDest->isComplex())
                     {
@@ -325,12 +325,12 @@ InternalType* AddElementToVariable(InternalType* _poDest, InternalType* _poSourc
                     return poResult;
                 }
                 break;
-            case GenericType::ScilabPolynom :
-                if (TypeSource == GenericType::ScilabDouble)
+            case types::InternalType::ScilabPolynom :
+                if (TypeSource == types::InternalType::ScilabDouble)
                 {
                     //Add Source like coef of the new element
-                    Double* pD = _poSource->getAs<Double>();
-                    Polynom* pPolyOut = poResult->getAs<Polynom>();
+                    types::Double* pD = _poSource->getAs<types::Double>();
+                    types::Polynom* pPolyOut = poResult->getAs<types::Polynom>();
 
                     if (pD->isComplex())
                     {
@@ -339,7 +339,7 @@ InternalType* AddElementToVariable(InternalType* _poDest, InternalType* _poSourc
                         {
                             for (int j = 0 ; j < pD->getCols() ; j++)
                             {
-                                SinglePoly* pSPOut = pPolyOut->get(iCurRow + i, iCurCol + j);
+                                types::SinglePoly* pSPOut = pPolyOut->get(iCurRow + i, iCurCol + j);
 
                                 pSPOut->setRank(0);
                                 double pDblR = pD->get(i, j);
@@ -354,7 +354,7 @@ InternalType* AddElementToVariable(InternalType* _poDest, InternalType* _poSourc
                         {
                             for (int j = 0 ; j < pD->getCols() ; j++)
                             {
-                                SinglePoly* pSPOut = pPolyOut->get(iCurRow + i, iCurCol + j);
+                                types::SinglePoly* pSPOut = pPolyOut->get(iCurRow + i, iCurCol + j);
 
                                 pSPOut->setRank(0);
                                 double pDbl = pD->get(i, j);
@@ -366,11 +366,11 @@ InternalType* AddElementToVariable(InternalType* _poDest, InternalType* _poSourc
                     return poResult;
                 }
                 break;
-            case GenericType::ScilabSparse :
-                if (TypeSource == GenericType::ScilabDouble)
+            case types::InternalType::ScilabSparse :
+                if (TypeSource == types::InternalType::ScilabDouble)
                 {
-                    Double* poSource = _poSource->getAs<Double>();
-                    Sparse* spResult = poResult->getAs<Sparse>();
+                    types::Double* poSource = _poSource->getAs<types::Double>();
+                    types::Sparse* spResult = poResult->getAs<types::Sparse>();
 
                     // Set complex the result if one of inputs is complex
                     if (poSource->isComplex())
@@ -432,11 +432,11 @@ InternalType* AddElementToVariable(InternalType* _poDest, InternalType* _poSourc
                     return poResult;
                 }
                 break;
-            case GenericType::ScilabSparseBool :
-                if (TypeSource == GenericType::ScilabBool)
+            case types::InternalType::ScilabSparseBool :
+                if (TypeSource == types::InternalType::ScilabBool)
                 {
-                    Bool* poSource = _poSource->getAs<Bool>();
-                    SparseBool* spResult = poResult->getAs<SparseBool>();
+                    types::Bool* poSource = _poSource->getAs<types::Bool>();
+                    types::SparseBool* spResult = poResult->getAs<types::SparseBool>();
 
                     // Add poSource at the end of spResult
                     for (int i = 0; i < poSource->getRows(); i++)
@@ -465,61 +465,61 @@ InternalType* AddElementToVariable(InternalType* _poDest, InternalType* _poSourc
         //Just add the new value in the current item
         switch (TypeDest)
         {
-            case GenericType::ScilabDouble :
-                poResult->getAs<Double>()->append(iCurRow, iCurCol, _poSource);
+            case types::InternalType::ScilabDouble :
+                poResult->getAs<types::Double>()->append(iCurRow, iCurCol, _poSource);
                 break;
-            case GenericType::ScilabPolynom :
-                poResult->getAs<Polynom>()->append(iCurRow, iCurCol, _poSource);
+            case types::InternalType::ScilabPolynom :
+                poResult->getAs<types::Polynom>()->append(iCurRow, iCurCol, _poSource);
                 break;
-            case GenericType::ScilabBool:
-                poResult->getAs<Bool>()->append(iCurRow, iCurCol, _poSource);
+            case types::InternalType::ScilabBool:
+                poResult->getAs<types::Bool>()->append(iCurRow, iCurCol, _poSource);
                 break;
-            case GenericType::ScilabInt8 :
-                poResult->getAs<Int8>()->append(iCurRow, iCurCol, _poSource);
+            case types::InternalType::ScilabInt8 :
+                poResult->getAs<types::Int8>()->append(iCurRow, iCurCol, _poSource);
                 break;
-            case GenericType::ScilabUInt8 :
-                poResult->getAs<UInt8>()->append(iCurRow, iCurCol, _poSource);
+            case types::InternalType::ScilabUInt8 :
+                poResult->getAs<types::UInt8>()->append(iCurRow, iCurCol, _poSource);
                 break;
-            case GenericType::ScilabInt16 :
-                poResult->getAs<Int16>()->append(iCurRow, iCurCol, _poSource);
+            case types::InternalType::ScilabInt16 :
+                poResult->getAs<types::Int16>()->append(iCurRow, iCurCol, _poSource);
                 break;
-            case GenericType::ScilabUInt16 :
-                poResult->getAs<UInt16>()->append(iCurRow, iCurCol, _poSource);
+            case types::InternalType::ScilabUInt16 :
+                poResult->getAs<types::UInt16>()->append(iCurRow, iCurCol, _poSource);
                 break;
-            case GenericType::ScilabInt32 :
-                poResult->getAs<Int32>()->append(iCurRow, iCurCol, _poSource);
+            case types::InternalType::ScilabInt32 :
+                poResult->getAs<types::Int32>()->append(iCurRow, iCurCol, _poSource);
                 break;
-            case GenericType::ScilabUInt32 :
-                poResult->getAs<UInt32>()->append(iCurRow, iCurCol, _poSource);
+            case types::InternalType::ScilabUInt32 :
+                poResult->getAs<types::UInt32>()->append(iCurRow, iCurCol, _poSource);
                 break;
-            case GenericType::ScilabInt64 :
-                poResult->getAs<Int64>()->append(iCurRow, iCurCol, _poSource);
+            case types::InternalType::ScilabInt64 :
+                poResult->getAs<types::Int64>()->append(iCurRow, iCurCol, _poSource);
                 break;
-            case GenericType::ScilabUInt64 :
-                poResult->getAs<UInt64>()->append(iCurRow, iCurCol, _poSource);
+            case types::InternalType::ScilabUInt64 :
+                poResult->getAs<types::UInt64>()->append(iCurRow, iCurCol, _poSource);
                 break;
-            case GenericType::ScilabSparse :
-                poResult->getAs<Sparse>()->append(iCurRow, iCurCol, _poSource->getAs<Sparse>());
+            case types::InternalType::ScilabSparse :
+                poResult->getAs<types::Sparse>()->append(iCurRow, iCurCol, _poSource->getAs<types::Sparse>());
                 break;
-            case GenericType::ScilabSparseBool :
-                poResult->getAs<SparseBool>()->append(iCurRow, iCurCol, _poSource->getAs<SparseBool>());
+            case types::InternalType::ScilabSparseBool :
+                poResult->getAs<types::SparseBool>()->append(iCurRow, iCurCol, _poSource->getAs<types::SparseBool>());
                 break;
-            case GenericType::ScilabString :
+            case types::InternalType::ScilabString :
             {
-                poResult->getAs<String>()->append(iCurRow, iCurCol, _poSource);
+                poResult->getAs<types::String>()->append(iCurRow, iCurCol, _poSource);
             }
             break;
-            case GenericType::ScilabImplicitList :
+            case types::InternalType::ScilabImplicitList :
             {
-                ImplicitList* pIL = _poSource->getAs<ImplicitList>();
-                ImplicitList* pOL = poResult->getAs<ImplicitList>();
+                types::ImplicitList* pIL = _poSource->getAs<types::ImplicitList>();
+                types::ImplicitList* pOL = poResult->getAs<types::ImplicitList>();
                 pOL->setStart(pIL->getStart());
                 pOL->setStep(pIL->getStep());
                 pOL->setEnd(pIL->getEnd());
                 break;
             }
-            case GenericType::ScilabHandle :
-                poResult->getAs<GraphicHandle>()->append(iCurRow, iCurCol, _poSource);
+            case types::InternalType::ScilabHandle :
+                poResult->getAs<types::GraphicHandle>()->append(iCurRow, iCurCol, _poSource);
                 break;
             default:
                 // call overload
@@ -562,12 +562,12 @@ const std::wstring* getStructNameFromExp(const ast::Exp* _pExp)
 //i1, ..., in : indexes
 //dest : variable where insert data     || NULL
 //source : data to insert               || extract indexes from source
-InternalType* callOverload(const ast::Exp& e, std::wstring _strType, typed_list* _pArgs, InternalType* _source, InternalType* _dest)
+types::InternalType* callOverload(const ast::Exp& e, const std::wstring& _strType, types::typed_list* _pArgs, types::InternalType* _source, types::InternalType* _dest)
 {
-    Function::ReturnValue ret = Function::Error;
-    InternalType* pITOut = NULL;
-    typed_list in;
-    typed_list out;
+    types::Function::ReturnValue ret = types::Function::Error;
+    types::InternalType* pITOut = NULL;
+    types::typed_list in;
+    types::typed_list out;
 
     std::wstring function_name;
     function_name = L"%" + _source->getShortTypeStr() + L"_" + _strType;
@@ -589,7 +589,7 @@ InternalType* callOverload(const ast::Exp& e, std::wstring _strType, typed_list*
         function_name += L"_" + _dest->getShortTypeStr();
     }
 
-    InternalType* pFunc = symbol::Context::getInstance()->get(symbol::Symbol(function_name));
+    types::InternalType* pFunc = symbol::Context::getInstance()->get(symbol::Symbol(function_name));
     // if %type_6 doesn't exist, call %l_6
     if (_dest == NULL && pFunc == NULL)
     {
@@ -632,7 +632,7 @@ InternalType* callOverload(const ast::Exp& e, std::wstring _strType, typed_list*
             _dest->DecreaseRef();
         }
 
-        if (ret == Function::Error)
+        if (ret == types::Function::Error)
         {
             //manage error
             std::wostringstream os;
@@ -647,7 +647,7 @@ InternalType* callOverload(const ast::Exp& e, std::wstring _strType, typed_list*
     }
     else if (out.size() > 1)
     {
-        List* pListOut = new List();
+        types::List* pListOut = new types::List();
         for (int i = 0; i < (int)out.size(); i++)
         {
             pListOut->append(out[i]);
@@ -695,13 +695,13 @@ bool getFieldsFromExp(ast::Exp* _pExp, std::list<ExpHistory*>& fields)
     else if (pCall)
     {
         bool bArgList = false;
-        List* pList = NULL;
+        types::List* pList = NULL;
         int iListIncr = 0;
         int iListSize = 0;
 
         ast::ExecVisitor execMe;
         ast::exps_t args = pCall->getArgs();
-        typed_list* pCurrentArgs = execMe.GetArgumentList(args);
+        types::typed_list* pCurrentArgs = execMe.GetArgumentList(args);
 
         if (getFieldsFromExp(&pCall->getName(), fields) == false)
         {
@@ -716,7 +716,7 @@ bool getFieldsFromExp(ast::Exp* _pExp, std::list<ExpHistory*>& fields)
                 (*pCurrentArgs)[0]->isMList() == false)
         {
             bArgList = true;
-            pList = (*pCurrentArgs)[0]->getAs<List>();
+            pList = (*pCurrentArgs)[0]->getAs<types::List>();
             //pList->IncreaseRef();
             pCurrentArgs->clear();
             pCurrentArgs->push_back(pList->get(iListIncr));
@@ -729,11 +729,11 @@ bool getFieldsFromExp(ast::Exp* _pExp, std::list<ExpHistory*>& fields)
             if (pCurrentArgs &&
                     pCurrentArgs->size() == 1 &&
                     (*pCurrentArgs)[0]->isString() &&
-                    (*pCurrentArgs)[0]->getAs<String>()->getSize() == 1)
+                    (*pCurrentArgs)[0]->getAs<types::String>()->getSize() == 1)
             {
                 // a("b") => a.b or a(x)("b") => a(x).b
                 ExpHistory * pEHParent = fields.back();
-                ast::SimpleVar* pFieldVar = new ast::SimpleVar(pCall->getLocation(), symbol::Symbol((*pCurrentArgs)[0]->getAs<String>()->get(0)));
+                ast::SimpleVar* pFieldVar = new ast::SimpleVar(pCall->getLocation(), symbol::Symbol((*pCurrentArgs)[0]->getAs<types::String>()->get(0)));
                 ExpHistory * pEH = new ExpHistory(pEHParent, pFieldVar);
                 pEH->setLevel(pEHParent->getLevel() + 1);
                 pEH->setExpOwner(true);
@@ -766,7 +766,7 @@ bool getFieldsFromExp(ast::Exp* _pExp, std::list<ExpHistory*>& fields)
                 if (iListIncr < iListSize)
                 {
                     // create new args for next loop.
-                    pCurrentArgs = new typed_list();
+                    pCurrentArgs = new types::typed_list();
                     pCurrentArgs->push_back(pList->get(iListIncr)->clone());
                 }
             }
@@ -792,13 +792,13 @@ bool getFieldsFromExp(ast::Exp* _pExp, std::list<ExpHistory*>& fields)
     }
 }
 
-InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fields, InternalType* _pAssignValue)
+types::InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fields, types::InternalType* _pAssignValue)
 {
     std::list<ExpHistory*> evalFields;
     std::list<ExpHistory*> workFields;
 
     bool bPutInCtx = false;
-    InternalType* pITMain = NULL;
+    types::InternalType* pITMain = NULL;
 
     try
     {
@@ -832,7 +832,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
             if (pFirstField->isCellExp())
             {
                 // a{x}, where "a" doesn't exists
-                pITMain = new Cell(1, 1);
+                pITMain = new types::Cell(1, 1);
                 pITMain->IncreaseRef();
                 bPutInCtx = true;
             }
@@ -841,7 +841,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                 // is a field exp
                 //"a" does not exist or it is another type, create it with size 1,1 and return it
                 //create new structure variable
-                pITMain = new Struct(1, 1);
+                pITMain = new types::Struct(1, 1);
                 pITMain->IncreaseRef();
                 bPutInCtx = true;
             }
@@ -879,7 +879,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
             evalFields.push_back(pEH);
             workFields.pop_front();
 
-            InternalType* pITCurrent = pEH->getCurrent();
+            types::InternalType* pITCurrent = pEH->getCurrent();
 
             if (pEH->isCellExp() && pITCurrent->isCell() == false)
             {
@@ -890,7 +890,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
 
             if (pITCurrent->isStruct())
             {
-                Struct* pStruct = pITCurrent->getAs<Struct>();
+                types::Struct* pStruct = pITCurrent->getAs<types::Struct>();
                 std::wstring pwcsFieldname = (*iterFields)->getExpAsString();
 
                 if (pEH->needResize())
@@ -914,7 +914,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
 
                 if (pEH->getArgs())
                 {
-                    InternalType* pIT = pStruct->extractWithoutClone(pEH->getArgs());
+                    types::InternalType* pIT = pStruct->extractWithoutClone(pEH->getArgs());
                     workFields.push_front(new ExpHistory(pEH, pEH->getExp(), NULL, pEH->getLevel(), pEH->isCellExp(), pIT));
                 }
                 else
@@ -925,8 +925,8 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                     if (iterFieldsNext == fields.end() && (*iterFields)->getArgs() == NULL)
                     {
                         // create pArg with "x" and set it as argument of "a"
-                        typed_list* args = new typed_list();
-                        args->push_back(new String(pwcsFieldname.c_str()));
+                        types::typed_list* args = new types::typed_list();
+                        args->push_back(new types::String(pwcsFieldname.c_str()));
                         pEH->setArgs(args);
 
                         // a.x where x is the last field
@@ -950,10 +950,10 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                         }
 
                         // extract field x and append it to elements for next recursion.
-                        List* pLOut = pStruct->extractFieldWithoutClone(pwcsFieldname);
+                        types::List* pLOut = pStruct->extractFieldWithoutClone(pwcsFieldname);
 
                         // pStruct must be scalar because we cant insert most of one element in the same insertion
-                        InternalType* pIT = pLOut->get(0);
+                        types::InternalType* pIT = pLOut->get(0);
                         if (pIT->getRef() > 2) //One for my own ref + 1 for "extractFieldWithoutClone" artificial ref
                         {
                             // clone element before modify it.
@@ -978,14 +978,14 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
             }
             else if (pITCurrent->isTList() || pITCurrent->isMList())
             {
-                TList* pTL = pITCurrent->getAs<TList>();
-                typed_list* pArgs = pEH->getArgs();
+                types::TList* pTL = pITCurrent->getAs<types::TList>();
+                types::typed_list* pArgs = pEH->getArgs();
                 if (pArgs)
                 {
                     if (pArgs->size() > 1 || pITCurrent->isMList())
                     {
                         // call overload
-                        InternalType* pExtract = callOverload(*pEH->getExp(), L"6", pArgs, pTL, NULL);
+                        types::InternalType* pExtract = callOverload(*pEH->getExp(), L"6", pArgs, pTL, NULL);
                         if ((*iterFields)->getExp() == NULL)
                         {
                             // a(x)(y)
@@ -1007,14 +1007,14 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                         int iNewSize = pEH->getSizeFromArgs();
                         if (pTL->getSize() < iNewSize)
                         {
-                            pTL->set(iNewSize - 1, new ListUndefined());
+                            pTL->set(iNewSize - 1, new types::ListUndefined());
                         }
 
                         // update pArgs variables with new argument computed in getSizeFromArgs
                         pArgs = pEH->getArgs();
 
-                        InternalType* pIT = pTL->extract(pArgs);
-                        List* pList = pIT->getAs<List>();
+                        types::InternalType* pIT = pTL->extract(pArgs);
+                        types::List* pList = pIT->getAs<types::List>();
 
                         if (pList->getSize() > 1)
                         {
@@ -1024,7 +1024,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                             throw ast::InternalError(os.str(), 999, _pExp->getLocation());
                         }
 
-                        double* pdblArgs = (*pArgs)[0]->getAs<Double>()->get();
+                        double* pdblArgs = (*pArgs)[0]->getAs<types::Double>()->get();
                         if ((*iterFields)->getExp() == NULL)
                         {
                             // a(x)(y)
@@ -1049,7 +1049,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                 else
                 {
                     // get string "x" of a.x
-                    InternalType* pExtract = NULL;
+                    types::InternalType* pExtract = NULL;
                     std::wstring pwcsFieldname = L"";
                     bool bReinsert = false;
                     ExpHistory* pEHChield = NULL;
@@ -1062,8 +1062,8 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                     if (iterFieldsNext == fields.end() && (*iterFields)->getArgs() == NULL)
                     {
                         // create pArg with "x" and set it as argument of "a"
-                        typed_list* args = new typed_list();
-                        args->push_back(new String(pwcsFieldname.c_str()));
+                        types::typed_list* args = new types::typed_list();
+                        args->push_back(new types::String(pwcsFieldname.c_str()));
                         pEH->setArgs(args);
 
                         // a.x where x is the last field
@@ -1088,8 +1088,8 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                             {
                                 // M=mlist(['MType','x','y'], ...
                                 // M.rows1 = "somthing"
-                                pArgs = new typed_list();
-                                pArgs->push_back(new String(pwcsFieldname.c_str()));
+                                pArgs = new types::typed_list();
+                                pArgs->push_back(new types::String(pwcsFieldname.c_str()));
 
                                 // call overload
                                 pExtract = callOverload(*pEH->getExp(), L"6", pArgs, pTL, NULL);
@@ -1116,7 +1116,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
             }
             else if (pITCurrent->isList())
             {
-                List* pL = pITCurrent->getAs<List>();
+                types::List* pL = pITCurrent->getAs<types::List>();
                 if (pEH->getParent() && pEH->getParent()->getLevel() == pEH->getLevel())
                 {
                     std::wostringstream os;
@@ -1139,7 +1139,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                         if (pEH->getArgs()->size() > 1)
                         {
                             // call overload
-                            InternalType* pExtract = callOverload(*pEH->getExp(), L"6", pEH->getArgs(), pL, NULL);
+                            types::InternalType* pExtract = callOverload(*pEH->getExp(), L"6", pEH->getArgs(), pL, NULL);
 
                             if ((*iterFields)->getExp() == NULL)
                             {
@@ -1162,10 +1162,10 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                             int iNewSize = pEH->getSizeFromArgs();
                             if (pL->getSize() < iNewSize)
                             {
-                                pL->set(iNewSize - 1, new ListUndefined());
+                                pL->set(iNewSize - 1, new types::ListUndefined());
                             }
 
-                            Double* pDblArgs = (*pEH->getArgs())[0]->getAs<Double>();
+                            types::Double* pDblArgs = (*pEH->getArgs())[0]->getAs<types::Double>();
                             double* pdblArgs = pDblArgs->get();
 
                             if ((*iterFields)->getExp() == NULL)
@@ -1198,8 +1198,8 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                         std::wstring pwcsFieldname = (*iterFields)->getExpAsString();
 
                         // create pArg with "x"
-                        typed_list* args = new typed_list();
-                        args->push_back(new String(pwcsFieldname.c_str()));
+                        types::typed_list* args = new types::typed_list();
+                        args->push_back(new types::String(pwcsFieldname.c_str()));
                         pEH->setArgs(args);
 
                         // check if the field x is the last field
@@ -1220,7 +1220,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                         else
                         {
                             // call overload
-                            InternalType* pExtract = callOverload(*pEH->getExp(), L"6", args, pL, NULL);
+                            types::InternalType* pExtract = callOverload(*pEH->getExp(), L"6", args, pL, NULL);
 
                             // append extraction of a.x for next level.
                             workFields.push_back(new ExpHistory(pEH, (*iterFields)->getExp(), (*iterFields)->getArgs(), (*iterFields)->getLevel(), (*iterFields)->isCellExp(), pExtract));
@@ -1231,11 +1231,11 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
             }
             else if (pITCurrent->isHandle())
             {
-                typed_list* pArgs = pEH->getArgs();
-                GraphicHandle* pGH = pITCurrent->getAs<GraphicHandle>();
+                types::typed_list* pArgs = pEH->getArgs();
+                types::GraphicHandle* pGH = pITCurrent->getAs<types::GraphicHandle>();
                 if (pArgs)
                 {
-                    InternalType* pExtract = NULL;
+                    types::InternalType* pExtract = NULL;
 
                     if (pArgs->size() == 1 && (*pArgs)[0]->isImplicitList() == false)
                     {
@@ -1275,8 +1275,8 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                     std::wstring pwcsFieldname = (*iterFields)->getExpAsString();
 
                     // create arg with next field
-                    typed_list* args = new typed_list();
-                    args->push_back(new String(pwcsFieldname.c_str()));
+                    types::typed_list* args = new types::typed_list();
+                    args->push_back(new types::String(pwcsFieldname.c_str()));
                     pEH->setArgs(args);
 
                     // check if the field x is the last field
@@ -1297,7 +1297,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                     else
                     {
                         // call overload
-                        InternalType* pExtract = callOverload(*pEH->getExp(), L"e", args, pITCurrent, NULL);
+                        types::InternalType* pExtract = callOverload(*pEH->getExp(), L"e", args, pITCurrent, NULL);
 
                         // append extraction of a.x for next level.
                         workFields.push_back(new ExpHistory(pEH, (*iterFields)->getExp(), (*iterFields)->getArgs(), (*iterFields)->getLevel(), (*iterFields)->isCellExp(), pExtract));
@@ -1307,7 +1307,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
             }
             else if (pITCurrent->isCell())
             {
-                Cell* pCell = pITCurrent->getAs<Cell>();
+                types::Cell* pCell = pITCurrent->getAs<types::Cell>();
                 if (pEH->getArgs() && (*pEH->getArgs())[0]->isString() == false)
                 {
                     if (pEH->isCellExp())
@@ -1318,7 +1318,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                             // extract each elements of a(x)
                             for (int iCell = 0; iCell < pCell->getSize(); iCell++)
                             {
-                                InternalType* pIT = pCell->get(iCell);
+                                types::InternalType* pIT = pCell->get(iCell);
                                 if ((*iterFields)->getExp() == NULL)
                                 {
                                     // a{x}(y)
@@ -1350,7 +1350,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                                 pCell->resize(pEH->getArgsDimsArray(), pEH->getArgsDims());
                             }
 
-                            InternalType* pIT = pCell->extract(pEH->getArgs());
+                            types::InternalType* pIT = pCell->extract(pEH->getArgs());
                             workFields.push_front(new ExpHistory(pEH, pEH->getExp(), pEH->getArgs(), pEH->getLevel(), pEH->isCellExp(), pIT));
                             workFields.front()->setReinsertion();
                         }
@@ -1373,7 +1373,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                                 pCell->resize(pEH->getArgsDimsArray(), pEH->getArgsDims());
                             }
 
-                            InternalType* pIT = pCell->extract(pEH->getArgs());
+                            types::InternalType* pIT = pCell->extract(pEH->getArgs());
                             workFields.push_back(new ExpHistory(pEH, (*iterFields)->getExp(), (*iterFields)->getArgs(), (*iterFields)->getLevel(), (*iterFields)->isCellExp(), pIT));
                             workFields.front()->setReinsertion();
                         }
@@ -1399,7 +1399,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                 if (pEH->getArgs())
                 {
                     // a(x)
-                    InternalType* pExtract = pITCurrent->getAs<UserType>()->extract(pEH->getArgs());
+                    types::InternalType* pExtract = pITCurrent->getAs<types::UserType>()->extract(pEH->getArgs());
                     if (pExtract == NULL)
                     {
                         // call overload
@@ -1427,8 +1427,8 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                     std::wstring pwcsFieldname = (*iterFields)->getExpAsString();
 
                     // create arg with next field
-                    typed_list* args = new typed_list();
-                    args->push_back(new String(pwcsFieldname.c_str()));
+                    types::typed_list* args = new types::typed_list();
+                    args->push_back(new types::String(pwcsFieldname.c_str()));
                     pEH->setArgs(args);
 
                     // check if the field x is the last field
@@ -1448,7 +1448,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                     }
                     else
                     {
-                        InternalType* pExtract = pITCurrent->getAs<UserType>()->extract(args);
+                        types::InternalType* pExtract = pITCurrent->getAs<types::UserType>()->extract(args);
                         if (pExtract == NULL)
                         {
                             // call overload
@@ -1469,7 +1469,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
             }
             else
             {
-                InternalType* pIT = new Struct(1, 1);
+                types::InternalType* pIT = new types::Struct(1, 1);
                 pEH->setCurrent(pIT);
                 pEH->setReinsertion();
 
@@ -1492,7 +1492,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
             evalFields.push_back(pEH);
             workFields.pop_front();
 
-            typed_list* pArgs = pEH->getArgs();
+            types::typed_list* pArgs = pEH->getArgs();
 
             // should never occured
             if (pArgs == NULL || pArgs->size() == 0)
@@ -1504,7 +1504,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
 
             if (pEH->isCellExp())
             {
-                Cell* pCell = pEH->getCurrent()->getAs<Cell>();
+                types::Cell* pCell = pEH->getCurrent()->getAs<types::Cell>();
                 // insert "something" in b{x}
                 if ((*pArgs)[0]->isString())
                 {
@@ -1518,7 +1518,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
             else
             {
                 // insert "something" in b(x,y)
-                InternalType* pIT = insertionCall(*_pExp, pArgs, pEH->getCurrent(), _pAssignValue);
+                types::InternalType* pIT = insertionCall(*_pExp, pArgs, pEH->getCurrent(), _pAssignValue);
                 if (pIT == NULL)
                 {
                     std::wostringstream os;
@@ -1555,13 +1555,13 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                     break;
                 }
 
-                typed_list* pParentArgs = pEHParent->getArgs();
+                types::typed_list* pParentArgs = pEHParent->getArgs();
                 if (pParentArgs == NULL || pEH->getWhereReinsert() != -1)
                 {
-                    InternalType* pParent = pEHParent->getCurrent();
+                    types::InternalType* pParent = pEHParent->getCurrent();
                     if (pParent->isStruct())
                     {
-                        Struct* pStruct = pParent->getAs<Struct>();
+                        types::Struct* pStruct = pParent->getAs<types::Struct>();
                         pStruct->get(pEH->getWhereReinsert())->set(pEH->getExpAsString(), pEH->getCurrent());
                         evalFields.pop_back();
                         delete pEH;
@@ -1569,14 +1569,14 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                     }
                     else if (pParent->isTList() || pParent->isMList())
                     {
-                        TList* pTL = pParent->getAs<TList>();
+                        types::TList* pTL = pParent->getAs<types::TList>();
                         if (pParentArgs)
                         {
                             // In case where pTL is in several scilab variable,
                             // we have to clone it for keep the other variables unchanged.
                             if (pTL->getRef() > 1)
                             {
-                                pTL = pTL->clone()->getAs<TList>();
+                                pTL = pTL->clone()->getAs<types::TList>();
                             }
 
                             pTL->set(pEH->getWhereReinsert(), pEH->getCurrent());
@@ -1599,7 +1599,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                                 // we have to clone it for keep the other variables unchanged.
                                 if (pTL->getRef() > 1)
                                 {
-                                    pTL = pTL->clone()->getAs<TList>();
+                                    pTL = pTL->clone()->getAs<types::TList>();
                                 }
 
                                 pTL->set(pEH->getExpAsString(), pEH->getCurrent());
@@ -1615,13 +1615,13 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                                 continue;
                             }
 
-                            pParentArgs = new typed_list();
-                            pParentArgs->push_back(new String(pEH->getExpAsString().c_str()));
+                            pParentArgs = new types::typed_list();
+                            pParentArgs->push_back(new types::String(pEH->getExpAsString().c_str()));
                         }
                     }
                     else if (pParent->isCell())
                     {
-                        Cell* pCell = pParent->getAs<Cell>();
+                        types::Cell* pCell = pParent->getAs<types::Cell>();
                         if (pEHParent->isCellExp() && pEH->getWhereReinsert() != -1)
                         {
                             // a{x}.b => reinsert b in a{x}
@@ -1634,7 +1634,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                     }
                 }
 
-                InternalType* pIT = insertionCall(*_pExp, pParentArgs, pEHParent->getCurrent(), pEH->getCurrent());
+                types::InternalType* pIT = insertionCall(*_pExp, pParentArgs, pEHParent->getCurrent(), pEH->getCurrent());
                 if (pIT == NULL)
                 {
                     std::wostringstream os;
@@ -1701,23 +1701,23 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
     }
 }
 
-InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType* _pVar, InternalType* _pInsert)
+types::InternalType* insertionCall(const ast::Exp& e, types::typed_list* _pArgs, types::InternalType* _pVar, types::InternalType* _pInsert)
 {
-    InternalType* pOut = NULL;
-    InternalType *pIL = NULL;
+    types::InternalType* pOut = NULL;
+    types::InternalType *pIL = NULL;
     //fisrt extract implicit list
     if (_pInsert->isColon())
     {
         //double* pdbl = NULL;
         //_pInsert = new Double(-1, -1, &pdbl);
         //pdbl[0] = 1;
-        pIL = Double::Identity(-1, -1);
+        pIL = types::Double::Identity(-1, -1);
         _pInsert->killMe();
         _pInsert = pIL;
     }
     else if (_pInsert->isImplicitList())
     {
-        pIL = _pInsert->getAs<ImplicitList>()->extractFullMatrix();
+        pIL = _pInsert->getAs<types::ImplicitList>()->extractFullMatrix();
         if (pIL && pIL->isDeletable())
         {
             _pInsert->killMe();
@@ -1727,120 +1727,120 @@ InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType*
     else if (_pInsert->isContainer() && _pInsert->isRef())
     {
         //std::cout << "assign container type during insertion" << std::endl;
-        //InternalType* pIL = _pInsert->clone();
+        //types::InternalType* pIL = _pInsert->clone();
         //_pInsert = pIL;
     }
 
-    if (_pInsert->isDouble() && _pInsert->getAs<Double>()->isEmpty() && _pVar == NULL)
+    if (_pInsert->isDouble() && _pInsert->getAs<types::Double>()->isEmpty() && _pVar == NULL)
     {
         // l(x) = [] when l is not defined => create l = []
-        pOut = Double::Empty();
+        pOut = types::Double::Empty();
     }
-    else if (_pInsert->isDouble() && _pInsert->getAs<Double>()->isEmpty() && _pVar->isStruct() == false && _pVar->isList() == false)
+    else if (_pInsert->isDouble() && _pInsert->getAs<types::Double>()->isEmpty() && _pVar->isStruct() == false && _pVar->isList() == false)
     {
         //insert [] so deletion except for Struct and List which can insert []
-        InternalType::ScilabType varType = _pVar->getType();
+        types::InternalType::ScilabType varType = _pVar->getType();
         switch (varType)
         {
-            case InternalType::ScilabDouble :
+            case types::InternalType::ScilabDouble :
             {
-                pOut = _pVar->getAs<Double>()->remove(_pArgs);
+                pOut = _pVar->getAs<types::Double>()->remove(_pArgs);
                 break;
             }
-            case InternalType::ScilabString :
+            case types::InternalType::ScilabString :
             {
-                pOut = _pVar->getAs<String>()->remove(_pArgs);
+                pOut = _pVar->getAs<types::String>()->remove(_pArgs);
                 break;
             }
-            case InternalType::ScilabCell :
+            case types::InternalType::ScilabCell :
             {
-                pOut = _pVar->getAs<Cell>()->remove(_pArgs);
+                pOut = _pVar->getAs<types::Cell>()->remove(_pArgs);
                 break;
             }
-            case InternalType::ScilabBool :
+            case types::InternalType::ScilabBool :
             {
-                pOut = _pVar->getAs<Bool>()->remove(_pArgs);
+                pOut = _pVar->getAs<types::Bool>()->remove(_pArgs);
                 break;
             }
-            case InternalType::ScilabPolynom :
+            case types::InternalType::ScilabPolynom :
             {
-                pOut = _pVar->getAs<Polynom>()->remove(_pArgs);
+                pOut = _pVar->getAs<types::Polynom>()->remove(_pArgs);
                 break;
             }
-            case InternalType::ScilabInt8 :
+            case types::InternalType::ScilabInt8 :
             {
-                pOut = _pVar->getAs<Int8>()->remove(_pArgs);
+                pOut = _pVar->getAs<types::Int8>()->remove(_pArgs);
                 break;
             }
-            case InternalType::ScilabUInt8 :
+            case types::InternalType::ScilabUInt8 :
             {
-                pOut = _pVar->getAs<UInt8>()->remove(_pArgs);
+                pOut = _pVar->getAs<types::UInt8>()->remove(_pArgs);
                 break;
             }
-            case InternalType::ScilabInt16 :
+            case types::InternalType::ScilabInt16 :
             {
-                pOut = _pVar->getAs<Int16>()->remove(_pArgs);
+                pOut = _pVar->getAs<types::Int16>()->remove(_pArgs);
                 break;
             }
-            case InternalType::ScilabUInt16 :
+            case types::InternalType::ScilabUInt16 :
             {
-                pOut = _pVar->getAs<UInt16>()->remove(_pArgs);
+                pOut = _pVar->getAs<types::UInt16>()->remove(_pArgs);
                 break;
             }
-            case InternalType::ScilabInt32 :
+            case types::InternalType::ScilabInt32 :
             {
-                pOut = _pVar->getAs<Int32>()->remove(_pArgs);
+                pOut = _pVar->getAs<types::Int32>()->remove(_pArgs);
                 break;
             }
-            case InternalType::ScilabUInt32 :
+            case types::InternalType::ScilabUInt32 :
             {
-                pOut = _pVar->getAs<UInt32>()->remove(_pArgs);
+                pOut = _pVar->getAs<types::UInt32>()->remove(_pArgs);
                 break;
             }
-            case InternalType::ScilabInt64 :
+            case types::InternalType::ScilabInt64 :
             {
-                pOut = _pVar->getAs<Int64>()->remove(_pArgs);
+                pOut = _pVar->getAs<types::Int64>()->remove(_pArgs);
                 break;
             }
-            case InternalType::ScilabUInt64 :
+            case types::InternalType::ScilabUInt64 :
             {
-                pOut = _pVar->getAs<UInt64>()->remove(_pArgs);
+                pOut = _pVar->getAs<types::UInt64>()->remove(_pArgs);
                 break;
             }
-            case InternalType::ScilabSparse :
+            case types::InternalType::ScilabSparse :
             {
-                pOut = _pVar->getAs<Sparse>()->remove(_pArgs);
+                pOut = _pVar->getAs<types::Sparse>()->remove(_pArgs);
                 break;
             }
-            case InternalType::ScilabSparseBool :
+            case types::InternalType::ScilabSparseBool :
             {
-                pOut = _pVar->getAs<SparseBool>()->remove(_pArgs);
+                pOut = _pVar->getAs<types::SparseBool>()->remove(_pArgs);
                 break;
             }
-            case InternalType::ScilabStruct :
+            case types::InternalType::ScilabStruct :
             {
-                pOut = _pVar->getAs<Struct>()->insert(_pArgs, _pInsert);
+                pOut = _pVar->getAs<types::Struct>()->insert(_pArgs, _pInsert);
                 break;
             }
-            case InternalType::ScilabHandle :
+            case types::InternalType::ScilabHandle :
             {
-                GraphicHandle* pH = _pVar->getAs<GraphicHandle>();
+                types::GraphicHandle* pH = _pVar->getAs<types::GraphicHandle>();
                 if ((*_pArgs)[0]->isString())
                 {
-                    String *pS = (*_pArgs)[0]->getAs<String>();
+                    types::String *pS = (*_pArgs)[0]->getAs<types::String>();
 
-                    typed_list in;
-                    typed_list out;
-                    optional_list opt;
+                    types::typed_list in;
+                    types::typed_list out;
+                    types::optional_list opt;
                     ast::ExecVisitor exec;
 
                     in.push_back(pH);
                     in.push_back(pS);
                     in.push_back(_pInsert);
 
-                    Function* pCall = (Function*)symbol::Context::getInstance()->get(symbol::Symbol(L"set"));
-                    Callable::ReturnValue ret = pCall->call(in, opt, 1, out, &exec);
-                    if (ret == Callable::OK)
+                    types::Function* pCall = (types::Function*)symbol::Context::getInstance()->get(symbol::Symbol(L"set"));
+                    types::Callable::ReturnValue ret = pCall->call(in, opt, 1, out, &exec);
+                    if (ret == types::Callable::OK)
                     {
                         pOut = _pVar;
                     }
@@ -1860,15 +1860,15 @@ InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType*
             }
         }
     }
-    else if (_pVar == NULL || (_pVar->isDouble() && _pVar->getAs<Double>()->getSize() == 0))
+    else if (_pVar == NULL || (_pVar->isDouble() && _pVar->getAs<types::Double>()->getSize() == 0))
     {
         //insert in a new variable or []
         //call static insert function
         //if _pVar == NULL and pArg is single string, it's a struct creation
         if ((*_pArgs)[0]->isString())
         {
-            String *pS = (*_pArgs)[0]->getAs<String>();
-            Struct* pStr = new Struct(1, 1);
+            types::String *pS = (*_pArgs)[0]->getAs<types::String>();
+            types::Struct* pStr = new types::Struct(1, 1);
 
             if (_pArgs->size() != 1 || pS->isScalar() == false)
             {
@@ -1890,58 +1890,58 @@ InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType*
         {
             switch (_pInsert->getType())
             {
-                case InternalType::ScilabDouble :
-                    pOut = Double::insertNew(_pArgs, _pInsert);
+                case types::InternalType::ScilabDouble :
+                    pOut = types::Double::insertNew(_pArgs, _pInsert);
                     break;
-                case InternalType::ScilabString :
-                    pOut = String::insertNew(_pArgs, _pInsert);
+                case types::InternalType::ScilabString :
+                    pOut = types::String::insertNew(_pArgs, _pInsert);
                     break;
-                case InternalType::ScilabCell :
-                    pOut = Cell::insertNew(_pArgs, _pInsert);
+                case types::InternalType::ScilabCell :
+                    pOut = types::Cell::insertNew(_pArgs, _pInsert);
                     break;
-                case InternalType::ScilabBool :
-                    pOut = Bool::insertNew(_pArgs, _pInsert);
+                case types::InternalType::ScilabBool :
+                    pOut = types::Bool::insertNew(_pArgs, _pInsert);
                     break;
-                case InternalType::ScilabPolynom :
-                    pOut = Polynom::insertNew(_pArgs, _pInsert);
+                case types::InternalType::ScilabPolynom :
+                    pOut = types::Polynom::insertNew(_pArgs, _pInsert);
                     break;
-                case InternalType::ScilabInt8 :
-                    pOut = Int8::insertNew(_pArgs, _pInsert);
+                case types::InternalType::ScilabInt8 :
+                    pOut = types::Int8::insertNew(_pArgs, _pInsert);
                     break;
-                case InternalType::ScilabUInt8 :
-                    pOut = UInt8::insertNew(_pArgs, _pInsert);
+                case types::InternalType::ScilabUInt8 :
+                    pOut = types::UInt8::insertNew(_pArgs, _pInsert);
                     break;
-                case InternalType::ScilabInt16 :
-                    pOut = Int16::insertNew(_pArgs, _pInsert);
+                case types::InternalType::ScilabInt16 :
+                    pOut = types::Int16::insertNew(_pArgs, _pInsert);
                     break;
-                case InternalType::ScilabUInt16 :
-                    pOut = UInt16::insertNew(_pArgs, _pInsert);
+                case types::InternalType::ScilabUInt16 :
+                    pOut = types::UInt16::insertNew(_pArgs, _pInsert);
                     break;
-                case InternalType::ScilabInt32 :
-                    pOut = Int32::insertNew(_pArgs, _pInsert);
+                case types::InternalType::ScilabInt32 :
+                    pOut = types::Int32::insertNew(_pArgs, _pInsert);
                     break;
-                case InternalType::ScilabUInt32 :
-                    pOut = UInt32::insertNew(_pArgs, _pInsert);
+                case types::InternalType::ScilabUInt32 :
+                    pOut = types::UInt32::insertNew(_pArgs, _pInsert);
                     break;
-                case InternalType::ScilabInt64 :
-                    pOut = Int64::insertNew(_pArgs, _pInsert);
+                case types::InternalType::ScilabInt64 :
+                    pOut = types::Int64::insertNew(_pArgs, _pInsert);
                     break;
-                case InternalType::ScilabUInt64 :
-                    pOut = UInt64::insertNew(_pArgs, _pInsert);
+                case types::InternalType::ScilabUInt64 :
+                    pOut = types::UInt64::insertNew(_pArgs, _pInsert);
                     break;
-                case InternalType::ScilabSparse :
-                    pOut = Sparse::insertNew(_pArgs, _pInsert);
+                case types::InternalType::ScilabSparse :
+                    pOut = types::Sparse::insertNew(_pArgs, _pInsert);
                     break;
-                case InternalType::ScilabSparseBool :
-                    pOut = SparseBool::insertNew(_pArgs, _pInsert);
+                case types::InternalType::ScilabSparseBool :
+                    pOut = types::SparseBool::insertNew(_pArgs, _pInsert);
                     break;
-                case InternalType::ScilabHandle:
-                    pOut = GraphicHandle::insertNew(_pArgs, _pInsert);
+                case types::InternalType::ScilabHandle:
+                    pOut = types::GraphicHandle::insertNew(_pArgs, _pInsert);
                     break;
                 default :
                 {
                     // overload
-                    Double* pEmpty = Double::Empty();
+                    types::Double* pEmpty = types::Double::Empty();
                     pOut = callOverload(e, L"i", _pArgs, _pInsert, pEmpty);
                     pEmpty->killMe();
                     break;
@@ -1952,7 +1952,7 @@ InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType*
     else
     {
         //call type insert function
-        InternalType* pRet = NULL;
+        types::InternalType* pRet = NULL;
 
         // case m=x; m()=x;
         if (_pArgs == NULL || _pArgs->size() == 0)
@@ -1965,52 +1965,52 @@ InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType*
         //check types compatibilties
         if (_pVar->isDouble() && _pInsert->isDouble())
         {
-            pRet = _pVar->getAs<Double>()->insert(_pArgs, _pInsert);
+            pRet = _pVar->getAs<types::Double>()->insert(_pArgs, _pInsert);
         }
         else if (_pVar->isDouble() && _pInsert->isSparse())
         {
-            Sparse* pSp = _pInsert->getAs<Sparse>();
-            Double* pD = new Double(pSp->getRows(), pSp->getCols(), pSp->isComplex());
+            types::Sparse* pSp = _pInsert->getAs<types::Sparse>();
+            types::Double* pD = new types::Double(pSp->getRows(), pSp->getCols(), pSp->isComplex());
             pSp->fill(*pD);
-            pRet = _pVar->getAs<Double>()->insert(_pArgs, pD);
+            pRet = _pVar->getAs<types::Double>()->insert(_pArgs, pD);
             delete pD;
         }
         else if (_pVar->isString() && _pInsert->isString())
         {
-            pRet = _pVar->getAs<String>()->insert(_pArgs, _pInsert);
+            pRet = _pVar->getAs<types::String>()->insert(_pArgs, _pInsert);
         }
         else if (_pVar->isCell() && _pInsert->isCell())
         {
-            pRet = _pVar->getAs<Cell>()->insert(_pArgs, _pInsert);
+            pRet = _pVar->getAs<types::Cell>()->insert(_pArgs, _pInsert);
         }
         else if (_pVar->isBool() && _pInsert->isBool())
         {
-            pRet = _pVar->getAs<Bool>()->insert(_pArgs, _pInsert);
+            pRet = _pVar->getAs<types::Bool>()->insert(_pArgs, _pInsert);
         }
         else if (_pVar->isSparse() && _pInsert->isSparse())
         {
-            pRet = _pVar->getAs<Sparse>()->insert(_pArgs, _pInsert->getAs<Sparse>());
+            pRet = _pVar->getAs<types::Sparse>()->insert(_pArgs, _pInsert->getAs<types::Sparse>());
         }
         else if (_pVar->isSparse() && _pInsert->isDouble())
         {
-            pRet = _pVar->getAs<Sparse>()->insert(_pArgs, _pInsert);
+            pRet = _pVar->getAs<types::Sparse>()->insert(_pArgs, _pInsert);
         }
         else if (_pVar->isSparseBool() && _pInsert->isSparseBool())
         {
-            pRet = _pVar->getAs<SparseBool>()->insert(_pArgs, _pInsert->getAs<SparseBool>());
+            pRet = _pVar->getAs<types::SparseBool>()->insert(_pArgs, _pInsert->getAs<types::SparseBool>());
         }
         else if (_pVar->isSparseBool() && _pInsert->isBool())
         {
-            pRet = _pVar->getAs<SparseBool>()->insert(_pArgs, _pInsert);
+            pRet = _pVar->getAs<types::SparseBool>()->insert(_pArgs, _pInsert);
         }
         else if (_pVar->isDouble() && _pInsert->isPoly())
         {
-            Double* pDest = _pVar->getAs<Double>();
-            Polynom* pIns = _pInsert->getAs<Polynom>();
+            types::Double* pDest = _pVar->getAs<types::Double>();
+            types::Polynom* pIns = _pInsert->getAs<types::Polynom>();
             int iSize = pDest->getSize();
             int* piRanks = new int[iSize];
             memset(piRanks, 0x00, iSize * sizeof(int));
-            Polynom* pP = new Polynom(pIns->getVariableName(), pDest->getDims(), pDest->getDimsArray(), piRanks);
+            types::Polynom* pP = new types::Polynom(pIns->getVariableName(), pDest->getDims(), pDest->getDimsArray(), piRanks);
             delete[] piRanks;
             pP->setComplex(pDest->isComplex());
 
@@ -2036,22 +2036,22 @@ InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType*
         }
         else if (_pVar->isPoly() && _pInsert->isDouble())
         {
-            Polynom* pDest = _pVar->getAs<Polynom>();
-            Double* pIns = _pInsert->getAs<Double>();
+            types::Polynom* pDest = _pVar->getAs<types::Polynom>();
+            types::Double* pIns = _pInsert->getAs<types::Double>();
             bool isComplexIns = pIns->isComplex();
             int iSize = pIns->getSize();
             int* piRanks = new int[iSize];
             memset(piRanks, 0x00, iSize * sizeof(int));
 
             //create a new polynom with Double to insert it into dest polynom
-            Polynom* pP = new Polynom(pDest->getVariableName(), pIns->getDims(), pIns->getDimsArray(), piRanks);
+            types::Polynom* pP = new types::Polynom(pDest->getVariableName(), pIns->getDims(), pIns->getDimsArray(), piRanks);
             delete[] piRanks;
 
             if (isComplexIns)
             {
                 double* pR = pIns->get();
                 double* pI = pIns->getImg();
-                SinglePoly** pSP = pP->get();
+                types::SinglePoly** pSP = pP->get();
                 for (int idx = 0 ; idx < pP->getSize() ; idx++)
                 {
                     double dblR = pR[idx];
@@ -2063,7 +2063,7 @@ InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType*
             else
             {
                 double* pdblR = pIns->get();
-                SinglePoly** pSP = pP->get();
+                types::SinglePoly** pSP = pP->get();
                 for (int idx = 0 ; idx < pP->getSize() ; idx++)
                 {
                     double dblR = pdblR[idx];
@@ -2076,48 +2076,48 @@ InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType*
         }
         else if (_pVar->isPoly() && _pInsert->isPoly())
         {
-            pRet = _pVar->getAs<Polynom>()->insert(_pArgs, _pInsert);
+            pRet = _pVar->getAs<types::Polynom>()->insert(_pArgs, _pInsert);
         }
         else if (_pVar->isInt8() && _pInsert->isInt8())
         {
-            pRet = _pVar->getAs<Int8>()->insert(_pArgs, _pInsert);
+            pRet = _pVar->getAs<types::Int8>()->insert(_pArgs, _pInsert);
         }
         else if (_pVar->isUInt8() && _pInsert->isUInt8())
         {
-            pRet = _pVar->getAs<UInt8>()->insert(_pArgs, _pInsert);
+            pRet = _pVar->getAs<types::UInt8>()->insert(_pArgs, _pInsert);
         }
         else if (_pVar->isInt16() && _pInsert->isInt16())
         {
-            pRet = _pVar->getAs<Int16>()->insert(_pArgs, _pInsert);
+            pRet = _pVar->getAs<types::Int16>()->insert(_pArgs, _pInsert);
         }
         else if (_pVar->isUInt16() && _pInsert->isUInt16())
         {
-            pRet = _pVar->getAs<UInt16>()->insert(_pArgs, _pInsert);
+            pRet = _pVar->getAs<types::UInt16>()->insert(_pArgs, _pInsert);
         }
         else if (_pVar->isInt32() && _pInsert->isInt32())
         {
-            pRet = _pVar->getAs<Int32>()->insert(_pArgs, _pInsert);
+            pRet = _pVar->getAs<types::Int32>()->insert(_pArgs, _pInsert);
         }
         else if (_pVar->isUInt32() && _pInsert->isUInt32())
         {
-            pRet = _pVar->getAs<UInt32>()->insert(_pArgs, _pInsert);
+            pRet = _pVar->getAs<types::UInt32>()->insert(_pArgs, _pInsert);
         }
         else if (_pVar->isInt64() && _pInsert->isInt64())
         {
-            pRet = _pVar->getAs<Int64>()->insert(_pArgs, _pInsert);
+            pRet = _pVar->getAs<types::Int64>()->insert(_pArgs, _pInsert);
         }
         else if (_pVar->isUInt64() && _pInsert->isUInt64())
         {
-            pRet = _pVar->getAs<UInt64>()->insert(_pArgs, _pInsert);
+            pRet = _pVar->getAs<types::UInt64>()->insert(_pArgs, _pInsert);
         }
         else if (_pVar->isStruct())
         {
-            Struct* pStruct = _pVar->getAs<Struct>();
+            types::Struct* pStruct = _pVar->getAs<types::Struct>();
             // insert something in a field of a struct
             if (_pArgs->size() == 1 && (*_pArgs)[0]->isString())
             {
                 //s("x") = y
-                String *pS = (*_pArgs)[0]->getAs<String>();
+                types::String *pS = (*_pArgs)[0]->getAs<types::String>();
                 if (pS->isScalar() == false)
                 {
                     if (pIL)
@@ -2150,10 +2150,10 @@ InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType*
             {
                 if (_pInsert->isStruct())
                 {
-                    String* pStrFieldsName = pStruct->getFieldNames();
-                    Struct* pStructInsert = _pInsert->clone()->getAs<Struct>();
-                    String* pStrInsertFieldsName = pStructInsert->getFieldNames();
-                    Struct* pStructRet = NULL;
+                    types::String* pStrFieldsName = pStruct->getFieldNames();
+                    types::Struct* pStructInsert = _pInsert->clone()->getAs<types::Struct>();
+                    types::String* pStrInsertFieldsName = pStructInsert->getFieldNames();
+                    types::Struct* pStructRet = NULL;
 
                     // if not an empty struct
                     if (pStrFieldsName)
@@ -2168,7 +2168,7 @@ InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType*
                             else
                             {
                                 std::wstring pwcsField = pStrFieldsName->get(i - 1);
-                                List* pLExtract = pStructInsert->extractFieldWithoutClone(pwcsField);
+                                types::List* pLExtract = pStructInsert->extractFieldWithoutClone(pwcsField);
 
                                 for (int i = 0; i < pLExtract->getSize(); i++)
                                 {
@@ -2195,7 +2195,7 @@ InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType*
 
                     // insert elements in following pArgs
                     pRet = pStruct->insert(_pArgs, pStructInsert);
-                    pStructRet = pRet->getAs<Struct>();
+                    pStructRet = pRet->getAs<types::Struct>();
 
                     pStructInsert->killMe();
 
@@ -2218,13 +2218,13 @@ InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType*
         }
         else if (_pVar->isTList() || _pVar->isMList())
         {
-            TList* pTL = _pVar->getAs<TList>();
+            types::TList* pTL = _pVar->getAs<types::TList>();
             if (_pArgs->size() == 1)
             {
                 if ((*_pArgs)[0]->isString())
                 {
                     //s("x") = y
-                    String *pS = (*_pArgs)[0]->getAs<String>();
+                    types::String *pS = (*_pArgs)[0]->getAs<types::String>();
                     if (pS->isScalar() == false)
                     {
                         if (pIL)
@@ -2282,7 +2282,7 @@ InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType*
                         // we have to clone it for keep the other variables unchanged.
                         if (pTL->getRef() > 1)
                         {
-                            pTL = pTL->clone()->getAs<TList>();
+                            pTL = pTL->clone()->getAs<types::TList>();
                         }
 
                         pRet = pTL->insert(_pArgs, _pInsert);
@@ -2291,7 +2291,7 @@ InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType*
                         // in the first element, the TList have to be a List.
                         if (pTL->get(0)->isString() == false)
                         {
-                            List* pL = new List();
+                            types::List* pL = new types::List();
                             for (int i = 0; i < pTL->getSize(); i++)
                             {
                                 pL->append(pTL->get(i));
@@ -2323,12 +2323,12 @@ InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType*
         }
         else if (_pVar->isList())
         {
-            List* pL = NULL;
+            types::List* pL = NULL;
             // In case where pL is in several scilab variable,
             // we have to clone it for keep the other variables unchanged.
             if (_pVar->getRef() > 1)
             {
-                pL = _pVar->clone()->getAs<List>();
+                pL = _pVar->clone()->getAs<types::List>();
                 pRet = pL->insert(_pArgs, _pInsert);
                 if (pRet == NULL)
                 {
@@ -2339,7 +2339,7 @@ InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType*
             }
             else
             {
-                pL = _pVar->getAs<List>();
+                pL = _pVar->getAs<types::List>();
                 pRet = pL->insert(_pArgs, _pInsert);
                 if (pRet == NULL)
                 {
@@ -2353,22 +2353,22 @@ InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType*
             if (_pArgs->size() == 1 && (*_pArgs)[0]->isString())
             {
                 //s(["x"])
-                GraphicHandle* pH = _pVar->getAs<GraphicHandle>();
-                String *pS = (*_pArgs)[0]->getAs<String>();
-                typed_list in;
-                typed_list out;
-                optional_list opt;
+                types::GraphicHandle* pH = _pVar->getAs<types::GraphicHandle>();
+                types::String *pS = (*_pArgs)[0]->getAs<types::String>();
+                types::typed_list in;
+                types::typed_list out;
+                types::optional_list opt;
                 ast::ExecVisitor exec;
 
                 in.push_back(pH);
                 in.push_back(pS);
                 in.push_back(_pInsert);
 
-                Function* pCall = (Function*)symbol::Context::getInstance()->get(symbol::Symbol(L"set"));
+                types::Function* pCall = (types::Function*)symbol::Context::getInstance()->get(symbol::Symbol(L"set"));
                 if (pCall)
                 {
-                    Callable::ReturnValue ret = pCall->call(in, opt, 1, out, &exec);
-                    if (ret == Callable::OK)
+                    types::Callable::ReturnValue ret = pCall->call(in, opt, 1, out, &exec);
+                    if (ret == types::Callable::OK)
                     {
                         pRet = _pVar;
                     }
@@ -2380,7 +2380,7 @@ InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType*
             }
             else
             {
-                pRet = _pVar->getAs<GraphicHandle>()->insert(_pArgs, _pInsert);
+                pRet = _pVar->getAs<types::GraphicHandle>()->insert(_pArgs, _pInsert);
             }
         }
         else if (_pVar->isUserType())
@@ -2392,14 +2392,14 @@ InternalType* insertionCall(const ast::Exp& e, typed_list* _pArgs, InternalType*
                     types::ImplicitList* pIL = (*_pArgs)[i]->getAs<types::ImplicitList>();
                     if (pIL->isComputable())
                     {
-                        InternalType* pIT = pIL->extractFullMatrix();
+                        types::InternalType* pIT = pIL->extractFullMatrix();
                         (*_pArgs)[i]->killMe();
                         (*_pArgs)[i] = pIT;
                     }
                 }
             }
 
-            pRet = _pVar->getAs<UserType>()->insert(_pArgs, _pInsert);
+            pRet = _pVar->getAs<types::UserType>()->insert(_pArgs, _pInsert);
             if (pRet == NULL)
             {
                 pRet = callOverload(e, L"i", _pArgs, _pInsert, _pVar);
@@ -2440,7 +2440,7 @@ void callOnPrompt(void)
         onPrompt = symbol::Context::getInstance()->getOrCreate(symbol::Symbol(L"%onprompt"));
     }
 
-    InternalType* pOnPrompt = NULL;
+    types::InternalType* pOnPrompt = NULL;
     pOnPrompt = onPrompt->get();
     if (pOnPrompt != NULL && pOnPrompt->isCallable())
     {
index 3a9e7b7..b3847a5 100644 (file)
@@ -28,8 +28,6 @@ extern "C"
 }
 
 using namespace types;
-
-
 //define arrays on operation functions
 static add_function pAddfunction[types::InternalType::IdLast][types::InternalType::IdLast] = {NULL};
 
index db14fec..bdc7e01 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "types_finite.hxx"
 
-bool isDoubleFinite(Double *_pDouble)
+bool isDoubleFinite(types::Double *_pDouble)
 {
     int iSize = _pDouble->getSize();
     if (matrix_finite( _pDouble->getReal(), iSize) == 1)
index 652e3b4..3c63912 100644 (file)
@@ -21,6 +21,8 @@ extern "C"
 #include "charEncoding.h"
 }
 
+using namespace types;
+
 InternalType *GenericPower(InternalType *_pLeftOperand, InternalType *_pRightOperand)
 {
     InternalType *pResult = NULL;
index b6a83be..4379a91 100644 (file)
@@ -264,7 +264,7 @@ std::wstring& ParserSingleInstance::getErrorMessage(void)
     return _error_message;
 }
 
-void ParserSingleInstance::appendErrorMessage(std::wstring message)
+void ParserSingleInstance::appendErrorMessage(const std::wstring& message)
 {
     _error_message += message;
 }
index b95c797..91d8611 100644 (file)
@@ -18,7 +18,7 @@ extern "C"
 #include "charEncoding.h"
 }
 
-void ParserSingleInstance::PrintError(std::wstring msg)
+void ParserSingleInstance::PrintError(const std::wstring& msg)
 {
     int i = 0;
 
index e2f1a53..8f02872 100644 (file)
@@ -262,7 +262,7 @@ types::InternalType* Context::getFunction(const Symbol& _key)
     return get(_key);
 }
 
-int Context::getFunctionList(std::list<Symbol>& lst, std::wstring _stModuleName)
+int Context::getFunctionList(std::list<Symbol>& lst, const std::wstring& _stModuleName)
 {
     return variables.getFunctionList(lst, _stModuleName, m_iLevel);
 }
index b610373..0da2750 100644 (file)
@@ -816,17 +816,17 @@ std::list<ConfigVariable::EntryPointStr*>* ConfigVariable::getEntryPointList()
 //dynamic modules
 std::map<std::wstring, DynLibHandle> ConfigVariable::m_DynModules;
 
-void ConfigVariable::addDynModule(std::wstring _name, DynLibHandle _lib)
+void ConfigVariable::addDynModule(const std::wstring& _name, DynLibHandle _lib)
 {
     m_DynModules[_name] = _lib;
 }
 
-void ConfigVariable::removeDynModule(std::wstring _name)
+void ConfigVariable::removeDynModule(const std::wstring& _name)
 {
     m_DynModules.erase(_name);
 }
 
-DynLibHandle ConfigVariable::getDynModule(std::wstring _name)
+DynLibHandle ConfigVariable::getDynModule(const std::wstring& _name)
 {
     std::map<std::wstring, DynLibHandle>::iterator it;
     it = m_DynModules.find(_name);
index 59ab675..4518465 100644 (file)
@@ -31,7 +31,6 @@ extern "C"
 #include "getshortpathname.h"
 }
 
-using namespace std;
 /*--------------------------------------------------------------------------*/
 wchar_t* getSCIHOMEW(void)
 {
@@ -40,7 +39,7 @@ wchar_t* getSCIHOMEW(void)
 /*--------------------------------------------------------------------------*/
 char* getSCIHOME(void)
 {
-    wstring tmpSCIHOME = ConfigVariable::getSCIHOME();
+    std::wstring tmpSCIHOME = ConfigVariable::getSCIHOME();
     if (tmpSCIHOME == L"")
     {
         tmpSCIHOME = L"empty_SCIHOME";
index c033134..cff4da6 100644 (file)
@@ -30,7 +30,6 @@ extern "C"
 #include "getshortpathname.h"
 }
 
-using namespace std;
 char *getSCI(void)
 {
     return wide_string_to_UTF8(ConfigVariable::getSCIPath().c_str());
@@ -79,7 +78,7 @@ void setSCI(const char* _sci_path)
     pwstWSCI = to_wide_string(_sci_path);
 #endif
 
-    wstring wst(pwstWSCI);
+    std::wstring wst(pwstWSCI);
     ConfigVariable::setSCIPath(wst);
 
     FREE(pwstWSCI);
@@ -218,7 +217,7 @@ char* computeSCI()
 
         if (ierr == 1)
         {
-            cerr << "SCI environment variable not defined." << endl;
+            std::cerr << "SCI environment variable not defined." << std::endl;
             exit(1);
         }
     }
index 9b7b541..3e99254 100644 (file)
@@ -49,7 +49,6 @@ extern "C"
 #include "getshortpathname.h"
 }
 
-using namespace std;
 
 
 /*--------------------------------------------------------------------------*/
@@ -88,7 +87,7 @@ void SciEnvForWindows(void)
     {
         if ( (!Set_Shell()) || (!IsTheGoodShell()))
         {
-            cout << "Please modify ""ComSpec"" environment variable." << endl << "cmd.exe on W2K and more." << endl;
+            std::cout << "Please modify ""ComSpec"" environment variable." << std::endl << "cmd.exe on W2K and more." << std::endl;
         }
     }
 
index 152ffda..a3b067f 100644 (file)
@@ -20,12 +20,12 @@ extern "C"
 #include "addfunction.h"
 }
 
-void addCFunction(wchar_t* _wstName, OLDGW_FUNC _pFunc, wchar_t* _wstModule)
+void addCFunction(const wchar_t* _wstName, OLDGW_FUNC _pFunc, const wchar_t* _wstModule)
 {
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(_wstName, _pFunc, _wstModule));
 }
 
-void addMexFunction(wchar_t* _wstName, MEXGW_FUNC _pFunc, wchar_t* _wstModule)
+void addMexFunction(const wchar_t* _wstName, MEXGW_FUNC _pFunc, const wchar_t* _wstModule)
 {
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(_wstName, _pFunc, _wstModule));
 }
index ad0b04d..748e072 100644 (file)
@@ -27,8 +27,6 @@ extern "C"
 #include "os_string.h"
 }
 
-using namespace std;
-
 namespace types
 {
 Double* Double::Empty()
@@ -344,7 +342,7 @@ bool Double::setOnes()
     return true;
 }
 
-bool Double::subMatrixToString(wostringstream& ostr, int* _piDims, int /*_iDims*/)
+bool Double::subMatrixToString(std::wostringstream& ostr, int* _piDims, int /*_iDims*/)
 {
     int iCurrentLine = 0;
     int iLineLen = ConfigVariable::getConsoleWidth();
@@ -352,13 +350,13 @@ bool Double::subMatrixToString(wostringstream& ostr, int* _piDims, int /*_iDims*
 
     if (isIdentity())
     {
-        ostr << L"eye *" << endl << endl;
+        ostr << L"eye *" << std::endl << std::endl;
         if (isComplex() == false)
         {
             DoubleFormat df;
             getDoubleFormat((m_pRealData[0]), &df);
             addDoubleValue(&ostr, (m_pRealData[0]), &df);
-            ostr << endl;
+            ostr << std::endl;
         }
         else
         {
@@ -367,14 +365,14 @@ bool Double::subMatrixToString(wostringstream& ostr, int* _piDims, int /*_iDims*
             getDoubleFormat(ZeroIsZero(m_pRealData[0]), &dfR);
             getDoubleFormat(ZeroIsZero(m_pImgData[0]), &dfI);
             addDoubleComplexValue(&ostr, ZeroIsZero(m_pRealData[0]), ZeroIsZero(m_pImgData[0]), dfR.iWidth + dfI.iWidth, &dfR, &dfI);
-            ostr << endl;
+            ostr << std::endl;
         }
-        ostr << endl;
+        ostr << std::endl;
     }
     else if (isEmpty())
     {
         ostr << L"    []";
-        ostr << endl;
+        ostr << std::endl;
     }
     else if (isScalar())
     {
@@ -389,7 +387,7 @@ bool Double::subMatrixToString(wostringstream& ostr, int* _piDims, int /*_iDims*
             getDoubleFormat((m_pRealData[iPos]), &df);
             ostr << SPACE_BETWEEN_TWO_VALUES;
             addDoubleValue(&ostr, (m_pRealData[iPos]), &df);
-            ostr << endl;
+            ostr << std::endl;
         }
         else
         {
@@ -399,7 +397,7 @@ bool Double::subMatrixToString(wostringstream& ostr, int* _piDims, int /*_iDims*
             getDoubleFormat(ZeroIsZero(m_pImgData[iPos]), &dfI);
             ostr << SPACE_BETWEEN_TWO_VALUES;
             addDoubleComplexValue(&ostr, ZeroIsZero(m_pRealData[iPos]), ZeroIsZero(m_pImgData[iPos]), dfR.iWidth + dfI.iWidth, &dfR, &dfI);
-            ostr << endl;
+            ostr << std::endl;
         }
     }
     else if (getCols() == 1)
@@ -425,7 +423,7 @@ bool Double::subMatrixToString(wostringstream& ostr, int* _piDims, int /*_iDims*
                 getDoubleFormat(ZeroIsZero(m_pRealData[iPos]), &df);
                 ostr << SPACE_BETWEEN_TWO_VALUES;
                 addDoubleValue(&ostr, ZeroIsZero(m_pRealData[iPos]), &df);
-                ostr << endl;
+                ostr << std::endl;
             }
         }
         else
@@ -450,14 +448,14 @@ bool Double::subMatrixToString(wostringstream& ostr, int* _piDims, int /*_iDims*
 
                 ostr << SPACE_BETWEEN_TWO_VALUES;
                 addDoubleComplexValue(&ostr, ZeroIsZero(m_pRealData[iPos]), ZeroIsZero(m_pImgData[iPos]), dfR.iWidth + dfI.iWidth, &dfR, &dfI);
-                ostr << endl;
+                ostr << std::endl;
             }
         }
     }
     else if (getRows() == 1)
     {
         //row vector
-        wostringstream ostemp;
+        std::wostringstream ostemp;
         int iLastVal = m_iCols1PrintState;
 
         if (isComplex() == false)
@@ -479,12 +477,12 @@ bool Double::subMatrixToString(wostringstream& ostr, int* _piDims, int /*_iDims*
                     if ((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
                     {
                         m_iCols1PrintState = iLastVal;
-                        ostr << endl << endl;
+                        ostr << std::endl << std::endl;
                         return false;
                     }
 
                     addColumnString(ostr, iLastVal + 1, i);
-                    ostr << ostemp.str() << endl;
+                    ostr << ostemp.str() << std::endl;
                     ostemp.str(L"");
                     iLastVal = i;
                 }
@@ -497,7 +495,7 @@ bool Double::subMatrixToString(wostringstream& ostr, int* _piDims, int /*_iDims*
             {
                 addColumnString(ostr, iLastVal + 1, getCols());
             }
-            ostemp << endl;
+            ostemp << std::endl;
             ostr << ostemp.str();
         }
         else //complex case
@@ -525,7 +523,7 @@ bool Double::subMatrixToString(wostringstream& ostr, int* _piDims, int /*_iDims*
                     }
 
                     addColumnString(ostr, iLastVal + 1, i);
-                    ostr << ostemp.str() << endl;
+                    ostr << ostemp.str() << std::endl;
                     ostemp.str(L"");
                     iLastVal = i;
                 }
@@ -538,13 +536,13 @@ bool Double::subMatrixToString(wostringstream& ostr, int* _piDims, int /*_iDims*
             {
                 addColumnString(ostr, iLastVal + 1, getCols());
             }
-            ostemp << endl;
+            ostemp << std::endl;
             ostr << ostemp.str();
         }
     }
     else // matrix
     {
-        wostringstream ostemp;
+        std::wostringstream ostemp;
         int iLen = 0;
         int iLastCol = m_iCols1PrintState;
 
@@ -611,7 +609,7 @@ bool Double::subMatrixToString(wostringstream& ostr, int* _piDims, int /*_iDims*
                             df.iWidth = piSize[iCols2];
                             addDoubleValue(&ostemp, ZeroIsZero(m_pRealData[iPos]), &df);
                         }
-                        ostemp << endl;
+                        ostemp << std::endl;
                     }
 
                     iLen = 0;
@@ -665,7 +663,7 @@ bool Double::subMatrixToString(wostringstream& ostr, int* _piDims, int /*_iDims*
                     df.iWidth = piSize[iCols2];
                     addDoubleValue(&ostemp, ZeroIsZero(m_pRealData[iPos]), &df);
                 }
-                ostemp << endl;
+                ostemp << std::endl;
             }
 
             if (m_iRows2PrintState == 0 && iLastCol != 0)
@@ -736,7