uft: module output_stream 06/17606/1
Antoine ELIAS [Thu, 31 Dec 2015 13:43:05 +0000 (14:43 +0100)]
Change-Id: I5b611c01b2db29095bd2e00741c093070fd40eab

44 files changed:
scilab/modules/ast/ast.vcxproj
scilab/modules/ast/ast.vcxproj.filters
scilab/modules/ast/includes/analysis/ConstantVisitor.hxx
scilab/modules/ast/includes/analysis/TIType.hxx
scilab/modules/ast/includes/analysis/data/DataManager.hxx
scilab/modules/ast/includes/analysis/data/FunctionBlock.hxx
scilab/modules/ast/includes/analysis/data/TypeLocal.hxx
scilab/modules/ast/includes/analysis/gvn/SymbolicDimension.hxx
scilab/modules/ast/includes/analysis/gvn/SymbolicRange.hxx
scilab/modules/ast/includes/analysis/tools.hxx
scilab/modules/ast/includes/ast/prettyprintvisitor.hxx
scilab/modules/ast/includes/types/arrayof.hxx
scilab/modules/ast/includes/types/double.hxx
scilab/modules/ast/output_stream_Import.def [deleted file]
scilab/modules/ast/src/cpp/analysis/Checkers.cpp
scilab/modules/ast/src/cpp/ast/run_CallExp.hpp
scilab/modules/ast/src/cpp/ast/runvisitor.cpp
scilab/modules/ast/src/cpp/ast/visitor_common.cpp
scilab/modules/ast/src/cpp/system_env/configvariable.cpp
scilab/modules/ast/src/cpp/types/arrayof.cpp
scilab/modules/ast/src/cpp/types/double.cpp
scilab/modules/ast/src/cpp/types/function.cpp
scilab/modules/ast/src/cpp/types/list.cpp
scilab/modules/ast/src/cpp/types/types_tools.cpp
scilab/modules/console/src/c/windows/TermConsole.h
scilab/modules/console/src/c/windows/TermPrintf.c
scilab/modules/console/src/c/windows/TermPrintf.h
scilab/modules/output_stream/includes/diary.h
scilab/modules/output_stream/includes/scilabWrite.hxx
scilab/modules/output_stream/includes/scilab_sprintf.hxx
scilab/modules/output_stream/src/c/Fileio_Import.def
scilab/modules/output_stream/src/c/Scierror.c
scilab/modules/output_stream/src/c/sciprint.c
scilab/modules/output_stream/src/cpp/Diary.cpp
scilab/modules/output_stream/src/cpp/Diary.hxx
scilab/modules/output_stream/src/cpp/DiaryList.cpp
scilab/modules/output_stream/src/cpp/DiaryList.hxx
scilab/modules/output_stream/src/cpp/diary_manager.cpp
scilab/modules/output_stream/src/cpp/diary_manager.hxx
scilab/modules/output_stream/src/cpp/getDiaryDate.cpp
scilab/modules/output_stream/src/cpp/getDiaryDate.hxx
scilab/modules/output_stream/src/cpp/getUniqueFilename.cpp
scilab/modules/output_stream/src/cpp/getUniqueFilename.hxx
scilab/modules/output_stream/src/cpp/scilabWrite.cpp

index fdf82d4..47101ee 100644 (file)
       <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <ImportLibrary>../../bin/$(ProjectName).lib</ImportLibrary>
-      <AdditionalDependencies>string.lib;fileio.lib;dynamic_link.lib;sciconsole.lib;output_stream.lib;core.lib;io.lib;elementary_functions_f.lib;elementary_functions.lib;polynomials_f.lib;linear_algebra_f.lib;coverage.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>string.lib;fileio.lib;dynamic_link.lib;sciconsole.lib;core.lib;io.lib;elementary_functions_f.lib;elementary_functions.lib;polynomials_f.lib;linear_algebra_f.lib;coverage.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <RandomizedBaseAddress>false</RandomizedBaseAddress>
     </Link>
     <PreLinkEvent>
@@ -120,7 +120,6 @@ lib /DEF:"$(ProjectDir)elementary_functions_import.def" /SUBSYSTEM:WINDOWS /MACH
 lib /DEF:"$(ProjectDir)linear_algebra_f_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)linear_algebra_f.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)polynomials_f_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)polynomials_f.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)io_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)io.lib" 1&gt;NUL 2&gt;NUL
-lib /DEF:"$(ProjectDir)output_stream_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)output_stream.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)console_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)sciconsole.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)dynamic_link_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)dynamic_link.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)fileio_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)fileio.lib" 1&gt;NUL 2&gt;NUL
@@ -149,7 +148,7 @@ lib /DEF:"$(ProjectDir)coverage_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platfo
       <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <ImportLibrary>../../bin/$(ProjectName).lib</ImportLibrary>
-      <AdditionalDependencies>string.lib;fileio.lib;dynamic_link.lib;sciconsole.lib;output_stream.lib;core.lib;io.lib;elementary_functions_f.lib;elementary_functions.lib;polynomials_f.lib;linear_algebra_f.lib;coverage.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>string.lib;fileio.lib;dynamic_link.lib;sciconsole.lib;core.lib;io.lib;elementary_functions_f.lib;elementary_functions.lib;polynomials_f.lib;linear_algebra_f.lib;coverage.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <RandomizedBaseAddress>false</RandomizedBaseAddress>
     </Link>
     <PreLinkEvent>
@@ -159,7 +158,6 @@ lib /DEF:"$(ProjectDir)elementary_functions_import.def" /SUBSYSTEM:WINDOWS /MACH
 lib /DEF:"$(ProjectDir)linear_algebra_f_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)linear_algebra_f.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)polynomials_f_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)polynomials_f.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)io_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)io.lib" 1&gt;NUL 2&gt;NUL
-lib /DEF:"$(ProjectDir)output_stream_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)output_stream.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)console_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)sciconsole.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)dynamic_link_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)dynamic_link.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)fileio_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)fileio.lib" 1&gt;NUL 2&gt;NUL
@@ -185,7 +183,7 @@ lib /DEF:"$(ProjectDir)coverage_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platfo
     <Link>
       <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
       <ImportLibrary>../../bin/$(ProjectName).lib</ImportLibrary>
-      <AdditionalDependencies>string.lib;fileio.lib;dynamic_link.lib;sciconsole.lib;output_stream.lib;core.lib;io.lib;elementary_functions_f.lib;elementary_functions.lib;polynomials_f.lib;linear_algebra_f.lib;coverage.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>string.lib;fileio.lib;dynamic_link.lib;sciconsole.lib;core.lib;io.lib;elementary_functions_f.lib;elementary_functions.lib;polynomials_f.lib;linear_algebra_f.lib;coverage.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <RandomizedBaseAddress>false</RandomizedBaseAddress>
     </Link>
     <PreLinkEvent>
@@ -195,7 +193,6 @@ lib /DEF:"$(ProjectDir)elementary_functions_import.def" /SUBSYSTEM:WINDOWS /MACH
 lib /DEF:"$(ProjectDir)linear_algebra_f_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)linear_algebra_f.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)polynomials_f_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)polynomials_f.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)io_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)io.lib" 1&gt;NUL 2&gt;NUL
-lib /DEF:"$(ProjectDir)output_stream_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)output_stream.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)console_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)sciconsole.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)dynamic_link_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)dynamic_link.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)fileio_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)fileio.lib" 1&gt;NUL 2&gt;NUL
@@ -224,7 +221,7 @@ lib /DEF:"$(ProjectDir)coverage_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platfo
     <Link>
       <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
       <ImportLibrary>../../bin/$(ProjectName).lib</ImportLibrary>
-      <AdditionalDependencies>string.lib;fileio.lib;dynamic_link.lib;sciconsole.lib;output_stream.lib;core.lib;io.lib;elementary_functions_f.lib;elementary_functions.lib;polynomials_f.lib;linear_algebra_f.lib;coverage.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>string.lib;fileio.lib;dynamic_link.lib;sciconsole.lib;core.lib;io.lib;elementary_functions_f.lib;elementary_functions.lib;polynomials_f.lib;linear_algebra_f.lib;coverage.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <RandomizedBaseAddress>false</RandomizedBaseAddress>
     </Link>
     <PreLinkEvent>
@@ -234,7 +231,6 @@ lib /DEF:"$(ProjectDir)elementary_functions_import.def" /SUBSYSTEM:WINDOWS /MACH
 lib /DEF:"$(ProjectDir)linear_algebra_f_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)linear_algebra_f.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)polynomials_f_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)polynomials_f.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)io_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)io.lib" 1&gt;NUL 2&gt;NUL
-lib /DEF:"$(ProjectDir)output_stream_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)output_stream.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)console_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)sciconsole.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)dynamic_link_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)dynamic_link.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)fileio_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)fileio.lib" 1&gt;NUL 2&gt;NUL
@@ -258,7 +254,6 @@ lib /DEF:"$(ProjectDir)coverage_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platfo
     <None Include="fileio_Import.def" />
     <None Include="io_Import.def" />
     <None Include="linear_algebra_f_Import.def" />
-    <None Include="output_stream_Import.def" />
     <None Include="polynomials_f_Import.def" />
     <None Include="string_Import.def" />
   </ItemGroup>
index 0c2e506..6321e21 100644 (file)
     <None Include="fileio_Import.def">
       <Filter>Libraries Dependencies</Filter>
     </None>
-    <None Include="output_stream_Import.def">
-      <Filter>Libraries Dependencies</Filter>
-    </None>
     <None Include="string_Import.def">
       <Filter>Libraries Dependencies</Filter>
     </None>
index 0aa1d1a..e5cbce8 100644 (file)
@@ -61,7 +61,7 @@ public:
     {
         if (parent)
         {
-            return new ConstantVisitor(parent);
+            return new ConstantVisitor(*parent);
         }
         else
         {
index 429e88d..f1acc79 100644 (file)
@@ -36,7 +36,7 @@ struct TIType
     bool scalar;
 
     TIType(const Type _type = UNKNOWN) : type(_type), scalar(true) { }
-    TIType(GVN & gvn) : type(UNKNOWN), rows(gvn, 0.), cols(gvn, 0.), scalar(false) { }
+    TIType(GVN & gvn) : type(UNKNOWN), rows(gvn, (int64_t)0), cols(gvn, (int64_t)0), scalar(false) { }
     TIType(GVN & gvn, const Type _type) : type(_type), rows(gvn, _type == EMPTY ? 0 : 1), cols(gvn, _type == EMPTY ? 0 : 1), scalar(_type != EMPTY) { }
     TIType(GVN & gvn, const Type _type, const int _rows, const int _cols) : type(_type), rows(gvn, _rows), cols(gvn, _cols), scalar(_rows == 1 && _cols == 1) { }
     TIType(GVN & gvn, Type _type, const SymbolicDimension & _rows, const SymbolicDimension & _cols) : type(_type), rows(_rows), cols(_cols), scalar(_rows == 1 && _cols == 1) { }
@@ -153,8 +153,8 @@ struct TIType
         else if ((this->type != COMPLEX || type.type != DOUBLE) && this->type != type.type)
         {
             this->type = UNKNOWN;
-            rows.setValue(0.);
-            cols.setValue(0.);
+            rows.setValue((int64_t)0);
+            cols.setValue((int64_t)0);
         }
         else if ((!scalar || !type.scalar) && (rows != type.rows || cols != type.cols))
         {
index 0b663cf..9fff5b0 100644 (file)
@@ -36,8 +36,8 @@ namespace analysis
 class AnalysisVisitor;
 class FunctionBlock;
 class MacroDef;
-class Data;
-class Info;
+struct Data;
+struct Info;
 
 class DataManager
 {
index aace9fb..1240edf 100644 (file)
@@ -153,7 +153,7 @@ public:
         std::map<TypeLocal, int> map;
         for (const auto & p : getTemp())
         {
-            _total += p.second.size();
+            _total += (int)p.second.size();
             map.emplace(p.first, p.second.size());
         }
 
index 1e6badd..46fab37 100644 (file)
@@ -60,7 +60,7 @@ struct TypeLocal
     {
         if (type.isConstantDims())
         {
-            return TypeLocal(type.type, type.rows.getConstant(), type.cols.getConstant(), isAnInt);
+            return TypeLocal(type.type, (int)type.rows.getConstant(), (int)type.cols.getConstant(), isAnInt);
         }
         else
         {
index a695a8a..3b9af1d 100644 (file)
@@ -62,7 +62,7 @@ public:
      * \param _gvn the GVN associated with this dimension
      * \param dim the value of this dimension
      */
-    SymbolicDimension(GVN & _gvn, int64_t dim) : gvn(&_gvn), value(dim == -1 ? _gvn.getValue() : _gvn.getValue(dim)) { }
+    SymbolicDimension(GVN & _gvn, int64_t dim) : gvn(&_gvn), value(dim == -1 ? _gvn.getValue() : _gvn.getValue((double)dim)) { }
 
     /**
      * \brief Get the associated GVN
@@ -151,7 +151,7 @@ public:
      */
     inline void setValue(const int64_t _value)
     {
-        value = gvn->getValue(_value);
+        value = gvn->getValue((double)_value);
     }
 
     /**
@@ -206,7 +206,7 @@ public:
      */
     inline SymbolicDimension operator+(const int64_t R) const
     {
-        return SymbolicDimension(gvn, gvn->getValue(OpValue::Kind::PLUS, *value, *gvn->getValue(R)));
+        return SymbolicDimension(gvn, gvn->getValue(OpValue::Kind::PLUS, *value, *gvn->getValue((double)R)));
     }
 
     /**
@@ -222,7 +222,7 @@ public:
      */
     inline SymbolicDimension operator-(const int64_t R) const
     {
-        return SymbolicDimension(gvn, gvn->getValue(OpValue::Kind::MINUS, *value, *gvn->getValue(R)));
+        return SymbolicDimension(gvn, gvn->getValue(OpValue::Kind::MINUS, *value, *gvn->getValue((double)R)));
     }
 
     /**
@@ -238,7 +238,7 @@ public:
      */
     inline SymbolicDimension operator*(const int64_t R) const
     {
-        return SymbolicDimension(gvn, gvn->getValue(OpValue::Kind::TIMES, *value, *gvn->getValue(R)));
+        return SymbolicDimension(gvn, gvn->getValue(OpValue::Kind::TIMES, *value, *gvn->getValue((double)R)));
     }
 
     /**
@@ -274,7 +274,7 @@ public:
      */
     inline SymbolicDimension operator/(const int64_t R) const
     {
-        return SymbolicDimension(gvn, gvn->getValue(OpValue::Kind::RDIV, *value, *gvn->getValue(R)));
+        return SymbolicDimension(gvn, gvn->getValue(OpValue::Kind::RDIV, *value, *gvn->getValue((double)R)));
     }
 
     /**
@@ -290,7 +290,7 @@ public:
      */
     inline SymbolicDimension operator^(const int64_t R) const
     {
-        return SymbolicDimension(gvn, gvn->getValue(OpValue::Kind::POWER, *value, *gvn->getValue(R)));
+        return SymbolicDimension(gvn, gvn->getValue(OpValue::Kind::POWER, *value, *gvn->getValue((double)R)));
     }
 
     /**
@@ -338,7 +338,7 @@ public:
      */
     inline friend SymbolicDimension operator-(const int64_t L, const SymbolicDimension & R)
     {
-        return SymbolicDimension(R.gvn, R.gvn->getValue(OpValue::Kind::MINUS, *R.gvn->getValue(L), *R.value));
+        return SymbolicDimension(R.gvn, R.gvn->getValue(OpValue::Kind::MINUS, *R.gvn->getValue((double)L), *R.value));
     }
 
     /**
@@ -354,7 +354,7 @@ public:
      */
     inline friend SymbolicDimension operator/(const int64_t L, const SymbolicDimension & R)
     {
-        return SymbolicDimension(R.gvn, R.gvn->getValue(OpValue::Kind::RDIV, *R.gvn->getValue(L), *R.value));
+        return SymbolicDimension(R.gvn, R.gvn->getValue(OpValue::Kind::RDIV, *R.gvn->getValue((double)L), *R.value));
     }
 
     /**
@@ -362,7 +362,7 @@ public:
      */
     inline friend SymbolicDimension operator^(const int64_t L, const SymbolicDimension & R)
     {
-        return SymbolicDimension(R.gvn, R.gvn->getValue(OpValue::Kind::POWER, *R.gvn->getValue(L), *R.value));
+        return SymbolicDimension(R.gvn, R.gvn->getValue(OpValue::Kind::POWER, *R.gvn->getValue((double)L), *R.value));
     }
 
     /**
index c5d78dd..e6ad0c6 100644 (file)
@@ -60,7 +60,7 @@ public:
      * \param _start the starting value
      * \param _end the ending value
      */
-    SymbolicRange(GVN & _gvn, int64_t _start, int64_t _end) : SymbolicRange(&_gvn, _gvn.getValue(_start), _gvn.getValue(_end)) { }
+    SymbolicRange(GVN & _gvn, int64_t _start, int64_t _end) : SymbolicRange(&_gvn, _gvn.getValue((double)_start), _gvn.getValue((double)_end)) { }
 
     inline void set(GVN & _gvn, GVN::Value * _start, GVN::Value * _end)
     {
index 8574bbb..8592879 100644 (file)
@@ -215,7 +215,7 @@ inline std::ostream & operator<<(std::ostream & out, const IntType & it)
 template<typename T>
 inline static unsigned char popcount(const T x)
 {
-    return std::bitset<sizeof(T)>(x).count();
+    return (unsigned char)std::bitset<sizeof(T)>(x).count();
 }
 
 inline static unsigned char log2(const unsigned int x)
index 2e06f07..7d918d1 100644 (file)
@@ -139,7 +139,7 @@ public:
         T * pT = static_cast<T *>(pIT);
         if (pT)
         {
-            const int size = pT->getSize();
+            int size = pT->getSize();
             if (size == 0)
             {
                 stream << "[]";
@@ -151,11 +151,12 @@ public:
             else
             {
                 stream << "[";
-                const int _size = std::min(4, size);
-                for (unsigned int i = 0; i < _size - 1; ++i)
+                int _size = std::min(4, size);
+                for (int i = 0; i < _size - 1; ++i)
                 {
                     stream << pT->get(i) << ",";
                 }
+
                 stream << pT->get(_size - 1);
                 if (size <= _size)
                 {
index be0499e..715215e 100644 (file)
 #define NOMINMAX
 #endif
 
+#ifdef _MSC_VER
+#pragma warning( disable : 4661)
+#endif
+
 #include <sstream>
 #include <cstdio>
 #include "types.hxx"
index 5349493..1b5babb 100644 (file)
@@ -50,7 +50,7 @@ public :
     /*data management*/
     double*                     getReal() const;
     double                      getReal(int _iRows, int _iCols);
-    bool                        setInt(int* _piReal); //to translate int to double matrix
+    void                        setInt(int* _piReal); //to translate int to double matrix
 
     /*zero or one set filler*/
     bool                        setZeros();
diff --git a/scilab/modules/ast/output_stream_Import.def b/scilab/modules/ast/output_stream_Import.def
deleted file mode 100644 (file)
index 0a3b889..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-LIBRARY    output_stream.dll
-
-
-EXPORTS
-sciprint
-Scierror
-scilabWriteW
-scilabErrorW
-Sciwarning
index 776cf1c..5e9fa69 100644 (file)
@@ -25,7 +25,7 @@ Checkers::CheckersMap Checkers::map = Checkers::initMap();
 
 TIType Checkers::check(GVN & gvn, const std::string & name, const std::vector<TIType> & args)
 {
-    const unsigned short size = args.size();
+    const unsigned short size = (unsigned short)args.size();
     CheckersMap::const_iterator i = map.find(__NName(size, name));
     if (i != map.end())
     {
index 3c9c168..3a0a303 100644 (file)
@@ -265,7 +265,7 @@ void RunVisitorT<T>::visitprivate(const CallExp &e)
             if (pIT->isInvokable() == false)
             {
                 // call overload
-                ret = Overload::call("%" + pIT->getShortTypeStr() + "_e", in, iRetCount, out, this);
+                ret = Overload::call("%" + pIT->getShortTypeStr() + "_e", in, iRetCount, out) == types::Function::OK;
             }
             else
             {
@@ -273,7 +273,7 @@ void RunVisitorT<T>::visitprivate(const CallExp &e)
                 if (ret == false && pIT->isUserType())
                 {
                     // call overload
-                    ret = Overload::call("%" + pIT->getShortTypeStr() + "_e", in, iRetCount, out, this);
+                    ret = Overload::call("%" + pIT->getShortTypeStr() + "_e", in, iRetCount, out) == types::Function::OK;
                 }
             }
 
index dfe41c5..7197f4b 100644 (file)
@@ -415,7 +415,7 @@ void RunVisitorT<T>::visitprivate(const FieldExp &e)
 
         try
         {
-            Ret = Overload::call("%" + stType + "_e", in, 1, out, this);
+            Ret = Overload::call("%" + stType + "_e", in, 1, out);
         }
         catch (const InternalError& ie)
         {
@@ -425,7 +425,7 @@ void RunVisitorT<T>::visitprivate(const FieldExp &e)
                 //tlist/mlist name are truncated to 8 first character
                 if (stType.size() > 8)
                 {
-                    Ret = Overload::call("%" + stType.substr(0, 8) + "_e", in, 1, out, this);
+                    Ret = Overload::call("%" + stType.substr(0, 8) + "_e", in, 1, out);
                 }
                 else
                 {
@@ -438,7 +438,7 @@ void RunVisitorT<T>::visitprivate(const FieldExp &e)
                 // TList or Mlist
                 if (pValue->isList())
                 {
-                    Ret = Overload::call("%l_e", in, 1, out, this);
+                    Ret = Overload::call("%l_e", in, 1, out);
                 }
                 else
                 {
@@ -1491,7 +1491,7 @@ void RunVisitorT<T>::visitprivate(const NotExp &e)
         pValue->IncreaseRef();
         in.push_back(pValue);
 
-        types::Callable::ReturnValue Ret = Overload::call("%" + pValue->getShortTypeStr() + "_5", in, 1, out, this);
+        types::Callable::ReturnValue Ret = Overload::call("%" + pValue->getShortTypeStr() + "_5", in, 1, out);
 
         if (Ret != types::Callable::OK)
         {
@@ -1557,11 +1557,11 @@ void RunVisitorT<T>::visitprivate(const TransposeExp &e)
         types::Callable::ReturnValue Ret;
         if (bConjug)
         {
-            Ret = Overload::call("%" + getResult()->getShortTypeStr() + "_t", in, 1, out, this);
+            Ret = Overload::call("%" + getResult()->getShortTypeStr() + "_t", in, 1, out);
         }
         else
         {
-            Ret = Overload::call("%" + getResult()->getShortTypeStr() + "_0", in, 1, out, this);
+            Ret = Overload::call("%" + getResult()->getShortTypeStr() + "_0", in, 1, out);
         }
 
         if (Ret != types::Callable::OK)
index 1b988d1..ba73570 100644 (file)
@@ -2085,7 +2085,7 @@ types::InternalType* insertionCall(const ast::Exp& e, types::typed_list* _pArgs,
                         //_pInsert->IncreaseRef();
                         //in.push_back(_pInsert);
 
-                        //Overload::call(function_name, in, 1, out, &exec);
+                        //Overload::call(function_name, in, 1, out);
                         //_pInsert->DecreaseRef();
 
                         //if (out.size() != 0)
index 6d4572f..c8fed5f 100644 (file)
@@ -1230,7 +1230,7 @@ void ConfigVariable::whereErrorToString(std::ostringstream &ostr)
 
     // compute max size between "at line xxx of function" and "in builtin "
     // +1 : line number is pad to 5. length of "% 5d" + 1 == 5
-    int iMaxLen = std::max(strAtLine.length() + 1, strBuiltin.length());
+    int iMaxLen = (int)std::max(strAtLine.length() + 1, strBuiltin.length());
     if (isExecstr)
     {
         iMaxLen = std::max(((int)strExecStr.length()) + 1, iMaxLen);
index 6e2810b..97decc0 100644 (file)
@@ -857,7 +857,7 @@ GenericType* ArrayOf<T>::remove(typed_list* _pArgs)
             int last = 0;
             for (int i = 0; i < iNotEntireSize; ++i)
             {
-                int ii = piNotEntireIndex[i] - 1;
+                int ii = (int)piNotEntireIndex[i] - 1;
                 for (int j = last; j < ii; ++j)
                 {
                     pOut->set(iNewPos, get(j));
index 1be16c5..78df54c 100644 (file)
@@ -274,18 +274,12 @@ double Double::getReal(int _iRows, int _iCols)
     return get(_iRows, _iCols);
 }
 
-bool Double::setInt(int* _piReal)
+void Double::setInt(int* _piReal)
 {
-    bool ret = true;
     for (int i = 0 ; i < m_iSize ; i++)
     {
-        ret = set(i, static_cast<double>(_piReal[i]));
-        if (ret == false)
-        {
-            return false;
-        }
+        set(i, static_cast<double>(_piReal[i]));
     }
-    return true;
 }
 
 void Double::whoAmI()
index c75c12e..ea1755a 100644 (file)
@@ -205,7 +205,7 @@ Function::ReturnValue WrapFunction::call(typed_list &in, optional_list &opt, int
     int ret = 1;
     int inSize = (int)in.size();
     int optSize = (int)opt.size();
-    bool isRef = checkReferenceModule(m_stModule.c_str());
+    bool isRef = checkReferenceModule(m_stModule.c_str()) == 1;
 
     if (m_pLoadDeps != NULL)
     {
index fd74d8e..1f651c8 100644 (file)
@@ -66,7 +66,7 @@ List::List(List *_oListCopyMe)
 {
     m_plData = new std::vector<InternalType *>;
     std::vector<InternalType *>* lData = _oListCopyMe->getData();
-    int size = lData->size();
+    int size = (int)lData->size();
     for (int i = 0 ; i < size ; i++)
     {
         append((*lData)[i]);
index e29aa9b..479cdfc 100644 (file)
@@ -283,7 +283,7 @@ bool getImplicitIndex(GenericType* _pRef, typed_list* _pArgsIn, std::vector<int>
 
                 //printf("%.2f : %.2f : %.2f\n", start, step, end);
 
-                int size = (end - start) / step + 1;
+                int size = (int)((end - start) / step) + 1;
                 if (size <= 0)
                 {
                     //manage implicit that return []
@@ -293,10 +293,10 @@ bool getImplicitIndex(GenericType* _pRef, typed_list* _pArgsIn, std::vector<int>
 
                 std::vector<int> idx(size);
                 int* pi = idx.data();
-                pi[0] = start - 1; //0-indexed
+                pi[0] = (int)start - 1; //0-indexed
                 for (int j = 1; j < size; ++j)
                 {
-                    pi[j] = pi[j - 1] + step;
+                    pi[j] = pi[j - 1] + (int)step;
                 }
 
                 lstIdx.push_back(idx);
index 86cd9ec..41453c1 100644 (file)
@@ -23,7 +23,7 @@ void InitializeTerminal(void);
 * @param[in] buffer
 * @return number of characters
 */
-int TerminalPrintf(char *buffer);
+int TerminalPrintf(const char *buffer);
 
 /**
 * put a character
@@ -36,7 +36,7 @@ int TerminalPutc(char ch);
 * @param[in] prompt
 * @return line from terminal
 */
-char *TerminalGetString(char *prompt);
+char *TerminalGetString(const char *prompt);
 
 /**
 * do a beep
index 5b9e369..8b93a63 100644 (file)
@@ -14,7 +14,7 @@
 #include "dynlib_console.h"
 #include "TermConsole.h"
 /*--------------------------------------------------------------------------*/
-CONSOLE_IMPEXP void TermPrintf_Windows(char *buffer)
+CONSOLE_IMPEXP void TermPrintf_Windows(const char *buffer)
 {
     TerminalPrintf(buffer);
 }
index 0d45c4b..286281a 100644 (file)
@@ -21,7 +21,7 @@
 * @param[in] a string to disp
 */
 
-void TermPrintf_Windows(char *buffer);
+void TermPrintf_Windows(const char *buffer);
 
 #endif /* __TERMPRINTF_WINDOWS_H__ */
 /*--------------------------------------------------------------------------*/
index 0b78cab..283bfd7 100644 (file)
@@ -26,14 +26,14 @@ extern "C" {
     * @param[in] string to write
     * @param[in] string is a input
     */
-    OUTPUT_STREAM_IMPEXP int diaryWrite(const wchar_t *wstr, BOOL bInput);
+    OUTPUT_STREAM_IMPEXP int diaryWrite(const char *str, BOOL bInput);
 
     /*
     * same as diaryWrite but add carriage return
     * @param[in] string to write
     * @param[in] string is a input
     */
-    OUTPUT_STREAM_IMPEXP int diaryWriteln(const wchar_t *wstr, BOOL bInput);
+    OUTPUT_STREAM_IMPEXP int diaryWriteln(const char* str, BOOL bInput);
 
 #ifdef  __cplusplus
 }
index dc853bb..06a13ca 100644 (file)
@@ -25,16 +25,10 @@ extern "C"
 typedef void (*SCILAB_OUTPUT_METHOD)(const char *text);
 
 OUTPUT_STREAM_IMPEXP void setScilabOutputMethod(SCILAB_OUTPUT_METHOD writer);
-
 OUTPUT_STREAM_IMPEXP void scilabWrite(const char* _pstText);
-
-OUTPUT_STREAM_IMPEXP void scilabWriteW(const wchar_t* _pwstText);
-
 OUTPUT_STREAM_IMPEXP void scilabError(const char* _pstText);
-OUTPUT_STREAM_IMPEXP void scilabErrorW(const wchar_t* _pwstText);
 
 /* functions write in "console" without take care of mode*/
-OUTPUT_STREAM_IMPEXP void scilabForcedWriteW(const wchar_t* _pwsText);
 OUTPUT_STREAM_IMPEXP void scilabForcedWrite(const char* _pstText);
 
 #ifdef __cplusplus
index c76f1ca..e1ac488 100644 (file)
@@ -43,7 +43,7 @@ struct TokenDef
     {}
 };
 
-OUTPUT_STREAM_IMPEXP_GW char** scilab_sprintf(const std::string& funcname, const char* _pwstInput, types::typed_list &in, int* _piOutputRows, int* _piNewLine);
+OUTPUT_STREAM_IMPEXP_GW char** scilab_sprintf(const std::string& funcname, const char* _pstInput, types::typed_list &in, int* _piOutputRows, int* _piNewLine);
 
 
 
index b4420b3..a978270 100644 (file)
@@ -2,6 +2,6 @@ LIBRARY    fileio.dll
 
 
 EXPORTS
-FileExistW
-getFullFilenameW
-splitpathW
+FileExist
+getFullFilename
+splitpath
index 7dde7a9..6900cf1 100644 (file)
@@ -30,7 +30,7 @@
 int  Scierror(int iv, const char *fmt, ...)
 {
     int retval = 0;
-    wchar_t* pwstError = NULL;
+    char* pstError = NULL;
     char s_buf[bsiz];
     va_list ap;
 
@@ -48,37 +48,7 @@ int  Scierror(int iv, const char *fmt, ...)
 
     va_end(ap);
 
-    pwstError = to_wide_string(s_buf);
-    setLastError(iv, pwstError, 0, NULL);
-
-    FREE(pwstError);
+    setLastError(iv, s_buf, 0, NULL);
     return retval;
 }
-
-//int ScierrorW(int iv, const wchar_t *fmt,...)
-//{
-//  int retval = 0;
-//  int lstr = 0;
-//  wchar_t s_buf[bsiz];
-//  va_list ap;
-//
-//  va_start(ap,fmt);
-//
-//#if _MSC_VER
-//  retval = vsnwprintf(s_buf,bsiz-1, fmt, ap );
-//#else
-//  retval = vswprintf(s_buf, bsiz-1, fmt, ap );
-//#endif
-//  if (retval < 0) s_buf[bsiz-1]='\0';
-//
-//  lstr = (int) wcslen(s_buf);
-//  va_end(ap);
-//
-//
-//    setLastError(iv, s_buf, 0, NULL);
-//    scilabErrorW(s_buf);
-//    scilabErrorW(L"\n");
-//
-//  return retval;
-//}
 /*--------------------------------------------------------------------------*/
index 7edb522..51ab222 100644 (file)
@@ -37,7 +37,6 @@
 * @param[in] buffer to disp
 */
 static void printf_scilab(const char* buffer);
-static void printf_scilabW(const wchar_t* buffer);
 /*--------------------------------------------------------------------------*/
 void sciprint(const char* fmt, ...)
 {
@@ -48,40 +47,6 @@ void sciprint(const char* fmt, ...)
     va_end (ap);
 }
 /*--------------------------------------------------------------------------*/
-//void sciprintW(wchar_t* fmt,...)
-//{
-//     va_list ap;
-//
-//     va_start(ap,fmt);
-//     scivprintW(fmt,ap);
-//     va_end (ap);
-//}
-/*--------------------------------------------------------------------------*/
-//int scivprintW(wchar_t* fmt,va_list args)
-//{
-//     static wchar_t s_buf[MAXPRINTF];
-//     int count=0;
-//
-//     va_list savedargs;
-//     va_copy(savedargs, args);
-//
-//#ifdef _MSC_VER
-//     count= vsnwprintf(s_buf, MAXPRINTF - 1, fmt, args );
-//#else
-//     count= vswprintf(s_buf, MAXPRINTF - 1, fmt, args );
-//#endif
-//     if(count == -1)
-//    {
-//        s_buf[MAXPRINTF - 1]= L'\0';
-//    }
-//
-//     scilabWriteW(s_buf);
-//
-//     va_end(savedargs);
-//
-//     return count;
-//}
-/*--------------------------------------------------------------------------*/
 int scivprint(const char *fmt, va_list args)
 {
     static char s_buf[MAXPRINTF];
@@ -108,39 +73,10 @@ int scivprint(const char *fmt, va_list args)
     return count;
 }
 /*--------------------------------------------------------------------------*/
-static void printf_scilabW(const wchar_t* buffer)
-{
-    if (buffer)
-    {
-        char* cBuffer = wide_string_to_UTF8(buffer);
-        if (cBuffer)
-        {
-            if (getScilabMode() == SCILAB_STD)
-            {
-                ConsolePrintf(cBuffer);
-            }
-            else
-            {
-#ifdef _MSC_VER
-                TermPrintf_Windows(cBuffer);
-#else
-                printf("%s", cBuffer);
-#endif
-            }
-
-            diaryWrite(buffer, FALSE);
-
-            FREE(cBuffer);
-            cBuffer = NULL;
-        }
-    }
-}
-/*--------------------------------------------------------------------------*/
 static void printf_scilab(const char *buffer)
 {
     if (buffer)
     {
-        wchar_t *wcBuffer = NULL;
         if (getScilabMode() == SCILAB_STD)
         {
             ConsolePrintf(buffer);
@@ -154,13 +90,7 @@ static void printf_scilab(const char *buffer)
 #endif
         }
 
-        wcBuffer = to_wide_string(buffer);
-        if (wcBuffer)
-        {
-            diaryWrite(wcBuffer, FALSE);
-            FREE(wcBuffer);
-            wcBuffer = NULL;
-        }
+        diaryWrite(buffer, FALSE);
     }
 }
 /*--------------------------------------------------------------------------*/
index 6d0ca85..5d4d42e 100644 (file)
@@ -24,24 +24,24 @@ extern "C"
 #include "sci_malloc.h"
 }
 /*--------------------------------------------------------------------------*/
-Diary::Diary(const std::wstring& _wfilename, int _mode, int ID, bool autorename)
+Diary::Diary(const std::string& _filename, int _mode, int ID, bool autorename)
 {
-    std::ios::openmode wofstream_mode;
+    std::ios::openmode ofstream_mode;
 
-    std::wstring fullfilename = getUniqueFilename(_wfilename);
+    std::string fullfilename = getUniqueFilename(_filename);
     if (autorename)
     {
-        fullfilename = getUniqueFilename(_wfilename);
+        fullfilename = getUniqueFilename(_filename);
 
-        wchar_t* ws = getFullFilenameW(fullfilename.data());
-        fullfilename = ws;
-        FREE(ws);
+        char* s = getFullFilename(fullfilename.data());
+        fullfilename = s;
+        FREE(s);
     }
     else
     {
-        wchar_t* ws = getFullFilenameW(_wfilename.data());
-        fullfilename = ws;
-        FREE(ws);
+        char* s = getFullFilename(_filename.data());
+        fullfilename = s;
+        FREE(s);
     }
 
     suspendwrite = false;
@@ -52,38 +52,25 @@ Diary::Diary(const std::wstring& _wfilename, int _mode, int ID, bool autorename)
 
     if (_mode == 0)
     {
-        wofstream_mode = std::ios::trunc | std::ios::binary;
+        ofstream_mode = std::ios::trunc | std::ios::binary;
     }
     else
     {
-        wofstream_mode = std::ios::app | std::ios::binary;
+        ofstream_mode = std::ios::app | std::ios::binary;
     }
 
-#ifdef _MSC_VER
-    std::wofstream fileDiary(fullfilename, wofstream_mode);
-#else
-    wchar_t *wcfile = (wchar_t *) fullfilename.c_str();
-    char *filename = wide_string_to_UTF8(wcfile);
-
-    std::ofstream fileDiary(filename, wofstream_mode);
-
-    if (filename)
-    {
-        FREE(filename);
-        filename = NULL;
-    }
-#endif
+    std::ofstream fileDiary(fullfilename, ofstream_mode);
 
     if (fileDiary.bad())
     {
-        wfilename = std::wstring(L"");
+        filename = std::string("");
         fileAttribMode = -1;
         setID(-1);
     }
     else
     {
-        wfilename = fullfilename;
-        fileAttribMode = wofstream_mode;
+        filename = fullfilename;
+        fileAttribMode = ofstream_mode;
         setID(ID);
     }
     fileDiary.close();
@@ -92,48 +79,35 @@ Diary::Diary(const std::wstring& _wfilename, int _mode, int ID, bool autorename)
 /*--------------------------------------------------------------------------*/
 Diary::~Diary()
 {
-    wfilename = L"";
+    filename = "";
     fileAttribMode = -1;
     setID(-1);
 }
 
 /*--------------------------------------------------------------------------*/
-std::wstring Diary::getFilename(void)
+std::string Diary::getFilename(void)
 {
-    return wfilename;
+    return filename;
 }
 
 /*--------------------------------------------------------------------------*/
-void Diary::write(const std::wstring& _wstr, bool bInput)
+void Diary::write(const std::string& _str, bool bInput)
 {
     if (!suspendwrite)
     {
-        std::ios::openmode wofstream_mode = std::ios::app | std::ios::binary;
-
-#ifdef _MSC_VER
-        std::wofstream fileDiary(wfilename.c_str(), wofstream_mode);
-#else
-        wchar_t *wcfile = (wchar_t *) wfilename.c_str();
-        char *filename = wide_string_to_UTF8(wcfile);
-
-        std::ofstream fileDiary(filename, wofstream_mode);
-        if (filename)
-        {
-            FREE(filename);
-            filename = NULL;
-        }
-#endif
+        std::ios::openmode ofstream_mode = std::ios::app | std::ios::binary;
 
+        std::ofstream fileDiary(filename.c_str(), ofstream_mode);
         if (fileDiary.good())
         {
-            char *line = NULL;
-            std::wstring wst = _wstr;
+            const char *line = NULL;
+            std::string st = _str;
 #ifdef _MSC_VER
             /* carriage return for Windows */
-            wst = replace(wst, std::wstring(L"\n"), std::wstring(L"\r\n"));
-            wst = replace(wst, std::wstring(L"\r\r"), std::wstring(L"\r"));
+            st = replace(st, "\n", "\r\n");
+            st = replace(st, "\r\r", "\r");
 #endif
-            line = wide_string_to_UTF8(wst.data());
+            line = st.data();
 
             if (bInput)         // input
             {
@@ -189,10 +163,10 @@ void Diary::write(const std::wstring& _wstr, bool bInput)
 }
 
 /*--------------------------------------------------------------------------*/
-void Diary::writeln(const std::wstring& _wstr, bool bInput)
+void Diary::writeln(const std::string& _str, bool bInput)
 {
-#define ENDLINE L"\n"
-    write(_wstr + ENDLINE, bInput);
+#define ENDLINE "\n"
+    write(_str + ENDLINE, bInput);
 }
 
 /*--------------------------------------------------------------------------*/
@@ -223,14 +197,14 @@ bool Diary::getSuspendWrite(void)
 }
 
 /*--------------------------------------------------------------------------*/
-std::wstring Diary::replace(const std::wstring& text, const std::wstring& s, const std::wstring& replacement)
+std::string Diary::replace(const std::string& text, const std::string& s, const std::string& replacement)
 {
-    std::wstring::size_type pos = 0;
-    std::wstring ret = text;
-    while (pos != std::wstring::npos)
+    std::string::size_type pos = 0;
+    std::string ret = text;
+    while (pos != std::string::npos)
     {
         pos = ret.find(s, pos);
-        if (pos == std::wstring::npos)
+        if (pos == std::string::npos)
             // no more 's' in '*this'
         {
             break;
index aedf0af..bb343c2 100644 (file)
@@ -21,7 +21,7 @@
 class Diary
 {
 private:
-    std::wstring wfilename;
+    std::string filename;
     int ID_foutstream;
 
     int fileAttribMode;
@@ -43,13 +43,13 @@ private:
     /*
     * used on Windows to replace carriage return
     */
-    std::wstring replace(const std::wstring& text, const std::wstring& s, const std::wstring& replacement);
+    std::string replace(const std::string& text, const std::string& s, const std::string& replacement);
 
 public:
     /*
     * constructor
     */
-    Diary(const std::wstring& _wfilename, int _mode, int ID, bool autorename);
+    Diary(const std::string& _filename, int _mode, int ID, bool autorename);
 
     /*
     * destructor
@@ -59,7 +59,7 @@ public:
     /*
     * get filename of this diary
     */
-    std::wstring getFilename(void);
+    std::string getFilename(void);
 
     /*
     * get & set IO mode
@@ -75,12 +75,12 @@ public:
     /*
     * write a string in this diary
     */
-    void write(const std::wstring& _wstr, bool bInput);
+    void write(const std::string& _wstr, bool bInput);
 
     /*
     * write a line in this diary
     */
-    void writeln(const std::wstring& _wstr, bool bInput);
+    void writeln(const std::string& _wstr, bool bInput);
 
     /*
     * get & set Resume mode
index d2646a3..80e701b 100644 (file)
@@ -28,15 +28,15 @@ DiaryList::~DiaryList()
     closeAllDiaries();
 }
 /*--------------------------------------------------------------------------*/
-int DiaryList::openDiary(const std::wstring& _wfilename, bool autorename)
+int DiaryList::openDiary(const std::string& _filename, bool autorename)
 {
-    return openDiary(_wfilename, 0, autorename);
+    return openDiary(_filename, 0, autorename);
 }
 /*--------------------------------------------------------------------------*/
-int DiaryList::openDiary(const std::wstring& _wfilename, int _mode, bool autorename)
+int DiaryList::openDiary(const std::string& _filename, int _mode, bool autorename)
 {
     int ID = -1;
-    Diary newDiary(_wfilename, _mode, findFreeID(), autorename);
+    Diary newDiary(_filename, _mode, findFreeID(), autorename);
     if (newDiary.getID() != -1)
     {
         LSTDIARY.push_back(newDiary);
@@ -90,51 +90,51 @@ int * DiaryList::getIDs(int *sizeID)
     return IDs;
 }
 /*--------------------------------------------------------------------------*/
-std::wstring DiaryList::getFilename(int ID_diary)
+std::string DiaryList::getFilename(int ID_diary)
 {
-    std::wstring wFilename(L"");
+    std::string filename("");
     std::list<Diary>::iterator i;
     for ( i = LSTDIARY.begin(); i != LSTDIARY.end(); i++)
     {
         if ( i->getID() == ID_diary )
         {
-            wFilename = i->getFilename();
+            filename = i->getFilename();
         }
     }
-    return wFilename;
+    return filename;
 }
 /*--------------------------------------------------------------------------*/
-std::list<std::wstring> DiaryList::getFilenames()
+std::list<std::string> DiaryList::getFilenames()
 {
     LSTDIARY.sort(compareDiary);
     int size = (int)LSTDIARY.size();
-    std::list<std::wstring> wFilenames(size);
+    std::list<std::string> filenames(size);
 
     if (size > 0)
     {
         for (auto& iter : LSTDIARY)
         {
-            wFilenames.push_back(iter.getFilename());
+            filenames.push_back(iter.getFilename());
         }
     }
-    return wFilenames;
+    return filenames;
 }
 /*--------------------------------------------------------------------------*/
-void DiaryList::write(const std::wstring& _wstr, bool bInput)
+void DiaryList::write(const std::string& _str, bool bInput)
 {
     std::list<Diary>::iterator i;
     for ( i = LSTDIARY.begin(); i != LSTDIARY.end(); i++)
     {
-        i->write(_wstr, bInput);
+        i->write(_str, bInput);
     }
 }
 /*--------------------------------------------------------------------------*/
-void DiaryList::writeln(const std::wstring& _wstr, bool bInput)
+void DiaryList::writeln(const std::string& _str, bool bInput)
 {
     std::list<Diary>::iterator i;
     for ( i = LSTDIARY.begin(); i != LSTDIARY.end(); i++)
     {
-        i->writeln(_wstr, bInput);
+        i->writeln(_str, bInput);
     }
 }
 /*--------------------------------------------------------------------------*/
@@ -151,14 +151,14 @@ bool DiaryList::exists(int ID_diary)
     return false;
 }
 /*--------------------------------------------------------------------------*/
-bool DiaryList::exists(const std::wstring& _wfilename)
+bool DiaryList::exists(const std::string& _filename)
 {
     std::list<Diary>::iterator i;
     for ( i = LSTDIARY.begin(); i != LSTDIARY.end(); i++)
     {
-        wchar_t* wc = getFullFilenameW(_wfilename.data());
-        int comp = i->getFilename().compare(wc);
-        FREE(wc);
+        char* c = getFullFilename(_filename.data());
+        int comp = i->getFilename().compare(c);
+        FREE(c);
         if (comp == 0)
         {
             return true;
@@ -242,14 +242,14 @@ bool DiaryList::getSuspendWrite(int  ID_diary)
     return false;
 }
 /*--------------------------------------------------------------------------*/
-int DiaryList::getID(const std::wstring& _wfilename)
+int DiaryList::getID(const std::string& _filename)
 {
     std::list<Diary>::iterator i;
     for ( i = LSTDIARY.begin(); i != LSTDIARY.end(); i++)
     {
-        wchar_t* ws = getFullFilenameW(_wfilename.data());
-        int comp = i->getFilename().compare(ws);
-        FREE(ws);
+        char* s = getFullFilename(_filename.data());
+        int comp = i->getFilename().compare(s);
+        FREE(s);
         if (comp == 0)
         {
             return i->getID();
index 18801cf..3fc6a1c 100644 (file)
@@ -29,8 +29,8 @@ public:
     ~DiaryList();
 
     /* open a diary */
-    int openDiary(const std::wstring& _wfilename, int _mode, bool autorename);
-    int openDiary(const std::wstring& _wfilename, bool autorename);
+    int openDiary(const std::string& _filename, int _mode, bool autorename);
+    int openDiary(const std::string& _filename, bool autorename);
 
     /* close a diary by ID */
     bool closeDiary(int ID_diary);
@@ -42,20 +42,20 @@ public:
     int * getIDs(int *sizeID);
 
     /* get filenames of diaries */
-    std::list<std::wstring> getFilenames();
+    std::list<std::string> getFilenames();
 
     /* get filename by IDs */
-    std::wstring getFilename(int ID_diary);
+    std::string getFilename(int ID_diary);
 
     /* write string in diaries */
-    void write(const std::wstring& _wstr, bool bInput);
-    void writeln(const std::wstring& _wstr, bool bInput);
+    void write(const std::string& _str, bool bInput);
+    void writeln(const std::string& _str, bool bInput);
 
     /* test if exists a diary by ID */
     bool exists(int ID_diary);
 
     /* test if exists a diary by filename */
-    bool exists(const std::wstring& _wfilename);
+    bool exists(const std::string& _filename);
 
     /* set & get Resume mode */
     void setSuspendWrite(bool bWith);
@@ -65,7 +65,7 @@ public:
     bool getSuspendWrite(int ID_diary);
 
     /* get ID by filename */
-    int getID(const std::wstring& _wfilename);
+    int getID(const std::string& _wfilename);
 
     /* set & get mode */
     void setFilterMode(int ID_diary, diary_filter mode);
index 4fe6830..7874132 100644 (file)
@@ -38,41 +38,41 @@ static int destroyDiaryManager(void)
     return 1;
 }
 /*--------------------------------------------------------------------------*/
-wchar_t *getDiaryFilename(int _Id)
+char* getDiaryFilename(int _Id)
 {
-    wchar_t *wcFilename = NULL;
+    char* filename = NULL;
     if (SCIDIARY)
     {
-        if (SCIDIARY->getFilename(_Id).compare(L""))
+        if (SCIDIARY->getFilename(_Id).compare(""))
         {
-            wcFilename = (wchar_t*) MALLOC(sizeof(wchar_t) * (SCIDIARY->getFilename(_Id).length() + 1));
-            if (wcFilename)
+            filename = (char*)MALLOC(sizeof(char) * (SCIDIARY->getFilename(_Id).length() + 1));
+            if (filename)
             {
-                wcscpy(wcFilename, SCIDIARY->getFilename(_Id).c_str());
+                strcpy(filename, SCIDIARY->getFilename(_Id).c_str());
             }
         }
     }
-    return wcFilename;
+    return filename;
 }
 /*--------------------------------------------------------------------------*/
-wchar_t **getDiaryFilenames(int *array_size)
+char **getDiaryFilenames(int *array_size)
 {
     *array_size = 0;
     if (SCIDIARY)
     {
-        std::list<std::wstring> wstringFilenames = SCIDIARY->getFilenames();
-        *array_size = (int)wstringFilenames.size();
+        std::list<std::string> stringFilenames = SCIDIARY->getFilenames();
+        *array_size = (int)stringFilenames.size();
         if (array_size > 0)
         {
-            wchar_t **wcFilenames = (wchar_t **) MALLOC (sizeof(wchar_t*) * (*array_size));
+            char **filenames = (char **) MALLOC (sizeof(char*) * (*array_size));
             int i = 0;
-            for (const auto& filename : wstringFilenames)
+            for (const auto& filename : stringFilenames)
             {
-                wcFilenames[i] = (wchar_t*)MALLOC(sizeof(wchar_t) * (filename.length() + 1));
-                wcscpy(wcFilenames[i], filename.data());
+                filenames[i] = (char*)MALLOC(sizeof(char) * (filename.length() + 1));
+                strcpy(filenames[i], filename.data());
                 ++i;
             }
-            return wcFilenames;
+            return filenames;
         }
     }
     return NULL;
@@ -133,7 +133,7 @@ int diaryClose(int _iId)
     return 1;
 }
 /*--------------------------------------------------------------------------*/
-int diaryClose(wchar_t *filename)
+int diaryClose(char *filename)
 {
     if (SCIDIARY)
     {
@@ -169,11 +169,11 @@ int diaryPause(int _iId)
     return 1;
 }
 /*--------------------------------------------------------------------------*/
-int diaryPause(wchar_t *filename)
+int diaryPause(char *filename)
 {
     if (SCIDIARY)
     {
-        int iID = SCIDIARY->getID(std::wstring(filename));
+        int iID = SCIDIARY->getID(filename);
         if (iID != -1)
         {
             SCIDIARY->setSuspendWrite(iID, true);
@@ -203,11 +203,11 @@ int diaryResume(int _iId)
     return 1;
 }
 /*--------------------------------------------------------------------------*/
-int diaryResume(wchar_t *filename)
+int diaryResume(char *filename)
 {
     if (SCIDIARY)
     {
-        int iID = SCIDIARY->getID(std::wstring(filename));
+        int iID = SCIDIARY->getID(filename);
         if (iID != -1)
         {
             SCIDIARY->setSuspendWrite(iID, false);
@@ -229,11 +229,11 @@ int diaryExists(int _iId)
     return 1;
 }
 /*--------------------------------------------------------------------------*/
-int diaryExists(wchar_t *filename)
+int diaryExists(char *filename)
 {
     if (SCIDIARY)
     {
-        if (SCIDIARY->exists(std::wstring(filename)))
+        if (SCIDIARY->exists(filename))
         {
             return 0;
         }
@@ -241,56 +241,56 @@ int diaryExists(wchar_t *filename)
     return 1;
 }
 /*--------------------------------------------------------------------------*/
-int diaryNew(wchar_t *filename, bool autorename)
+int diaryNew(char *filename, bool autorename)
 {
     createDiaryManager();
 
     if (SCIDIARY)
     {
-        return SCIDIARY->openDiary(std::wstring(filename), autorename);
+        return SCIDIARY->openDiary(filename, autorename);
     }
 
     return -1;
 }
 /*--------------------------------------------------------------------------*/
-int diaryAppend(wchar_t *filename)
+int diaryAppend(char *filename)
 {
     createDiaryManager();
     if (SCIDIARY)
     {
-        return SCIDIARY->openDiary(std::wstring(filename), 1, false);
+        return SCIDIARY->openDiary(filename, 1, false);
     }
     return -1;
 }
 /*--------------------------------------------------------------------------*/
-int diaryWrite(const wchar_t *wstr, BOOL bInput)
+int diaryWrite(const char *str, BOOL bInput)
 {
     if (SCIDIARY)
     {
         if (bInput)
         {
-            SCIDIARY->write(std::wstring(wstr), true);
+            SCIDIARY->write(str, true);
         }
         else
         {
-            SCIDIARY->write(std::wstring(wstr), false);
+            SCIDIARY->write(str, false);
         }
         return 0;
     }
     return 1;
 }
 /*--------------------------------------------------------------------------*/
-int diaryWriteln(const wchar_t *wstr, BOOL bInput)
+int diaryWriteln(const char *str, BOOL bInput)
 {
     if (SCIDIARY)
     {
         if (bInput)
         {
-            SCIDIARY->writeln(std::wstring(wstr), true);
+            SCIDIARY->writeln(str, true);
         }
         else
         {
-            SCIDIARY->writeln(std::wstring(wstr), false);
+            SCIDIARY->writeln(str, false);
         }
         return 0;
     }
index 865dbac..2398603 100644 (file)
@@ -25,14 +25,14 @@ extern "C"
 * @param[in] _Id
 * @return filename
 */
-OUTPUT_STREAM_IMPEXP wchar_t *getDiaryFilename(int _Id);
+OUTPUT_STREAM_IMPEXP char* getDiaryFilename(int _Id);
 
 /**
 * get all filenames in manager
 * @param[out] size of returned array
 * @return filenames
 */
-OUTPUT_STREAM_IMPEXP wchar_t **getDiaryFilenames(int *array_size);
+OUTPUT_STREAM_IMPEXP char** getDiaryFilenames(int *array_size);
 
 /**
 * get all IDs in manager
@@ -66,7 +66,7 @@ OUTPUT_STREAM_IMPEXP int diaryClose(int _iId);
 * @param[in] filename
 * @return 0 (OK) 1 (NOK)
 */
-OUTPUT_STREAM_IMPEXP int diaryClose(wchar_t *filename);
+OUTPUT_STREAM_IMPEXP int diaryClose(char* filename);
 
 /**
 * Pause all diaries
@@ -86,7 +86,7 @@ OUTPUT_STREAM_IMPEXP int diaryPause(int _iId);
 * @param[in] filename
 * @return 0 (OK) 1 (NOK)
 */
-OUTPUT_STREAM_IMPEXP int diaryPause(wchar_t *filename);
+OUTPUT_STREAM_IMPEXP int diaryPause(char* filename);
 
 /**
 * Resume All diaries
@@ -106,7 +106,7 @@ OUTPUT_STREAM_IMPEXP int diaryResume(int _iId);
 * @param[in] filename
 * @return 0 (OK) 1 (NOK)
 */
-OUTPUT_STREAM_IMPEXP int diaryResume(wchar_t *filename);
+OUTPUT_STREAM_IMPEXP int diaryResume(char* filename);
 
 /**
 * check if a ID exists
@@ -120,21 +120,21 @@ OUTPUT_STREAM_IMPEXP int diaryExists(int _iId);
 * @param[in] filename
 * @return 0 (OK) 1 (NOK)
 */
-OUTPUT_STREAM_IMPEXP int diaryExists(wchar_t *filename);
+OUTPUT_STREAM_IMPEXP int diaryExists(char* filename);
 
 /**
 * create a new diary
 * @param[in] filename
 * @return ID or -1 (NOK)
 */
-OUTPUT_STREAM_IMPEXP int diaryNew(wchar_t *filename, bool autorename);
+OUTPUT_STREAM_IMPEXP int diaryNew(char* filename, bool autorename);
 
 /**
 * append to a diary
 * @param[in] filename
 * @return ID or -1 (NOK)
 */
-OUTPUT_STREAM_IMPEXP int diaryAppend(wchar_t *filename);
+OUTPUT_STREAM_IMPEXP int diaryAppend(char* filename);
 
 /*
 * Set filter mode (input, output)
index c0dd166..f5631d3 100644 (file)
@@ -28,10 +28,10 @@ extern "C"
 #include <locale.h>
 }
 /*--------------------------------------------------------------------------*/
-std::wstring getDiaryDate(int format_mode)
+std::string getDiaryDate(int format_mode)
 {
-    std::wstring wstrdate(L"");
-    std::wstringstream StrStream;
+    std::string strdate("");
+    std::stringstream StrStream;
     time_t tDate;
     time(&tDate);
 
@@ -41,7 +41,7 @@ std::wstring getDiaryDate(int format_mode)
         default: // UNIX TIMESTAMP
         {
             StrStream << (unsigned int)tDate;
-            wstrdate = StrStream.str();
+            strdate = StrStream.str();
         }
         break;
         case 1: // http://en.wikipedia.org/wiki/ISO_8601 YYYY-MM-DD hh:mm:ss
@@ -58,10 +58,10 @@ std::wstring getDiaryDate(int format_mode)
             StrStream << YEAR << L"-" << MONTH << L"-" << DAY_OF_MONTH;
             StrStream << L" ";
             StrStream << HOUR_OF_DAY << L":" << MINUTES << L":" << SECONDS;
-            wstrdate = StrStream.str();
+            strdate = StrStream.str();
         }
         break;
     }
-    return wstrdate;
+    return strdate;
 }
 /*--------------------------------------------------------------------------*/
index b7402fe..5c7f907 100644 (file)
@@ -22,7 +22,7 @@
 * _mode 1: ISO_8601
 * @return std::wstring date & time
 */
-std::wstring getDiaryDate(int format_mode);
+std::string getDiaryDate(int format_mode);
 
 #endif /* __GETDIARYDATE_HXX__ */
 /*--------------------------------------------------------------------------*/
index 8fb6067..2453797 100644 (file)
@@ -29,54 +29,44 @@ extern "C"
 #include "charEncoding.h"
 }
 /*--------------------------------------------------------------------------*/
-static void wcsplitpath(const wchar_t* path, wchar_t* drv, wchar_t* dir, wchar_t* name, wchar_t* ext);
-static int getFileSize(const std::wstring& _wfilename);
+static int getFileSize(const std::string& _filename);
 /*--------------------------------------------------------------------------*/
-std::wstring getUniqueFilename(const std::wstring& _wfilename)
+std::string getUniqueFilename(const std::string& _filename)
 {
-    wchar_t* ws = getFullFilenameW(_wfilename.data());
-    std::wstring wfullfilename(ws);
-    FREE(ws);
-    std::wstring newfilename;
+    char* s = getFullFilename(_filename.data());
+    std::string fullfilename(s);
+    FREE(s);
+    std::string newfilename;
 
-    if (FileExistW(wfullfilename.data()))
+    if (FileExist(fullfilename.data()))
     {
-        wchar_t wcdrive[PATH_MAX];
-        wchar_t wcdirectory[PATH_MAX];
-        wchar_t wcname[PATH_MAX];
-        wchar_t wcext[PATH_MAX];
+        char drive[PATH_MAX];
+        char directory[PATH_MAX];
+        char name[PATH_MAX];
+        char ext[PATH_MAX];
         unsigned int id = (unsigned int)(-1);
 
-        splitpathW(wfullfilename.data(), FALSE, wcdrive, wcdirectory, wcname, wcext);
-        std::wstring prefixFilename(wcdrive);
-        prefixFilename += wcdirectory;
-        prefixFilename += wcname;
+        splitpath(fullfilename.data(), FALSE, drive, directory, name, ext);
+        std::string prefixFilename(drive);
+        prefixFilename += directory;
+        prefixFilename += name;
 
         do
         {
             id++;
-            newfilename = prefixFilename + L"_" + std::to_wstring(id) + wcext;
-        } while (FileExistW(newfilename.data()) && getFileSize(newfilename) != 0);
+            newfilename = prefixFilename + "_" + std::to_string(id) + ext;
+        } while (FileExist(newfilename.data()) && getFileSize(newfilename) != 0);
     }
     else
     {
-        newfilename = wfullfilename;
+        newfilename = fullfilename;
     }
     return newfilename;
 }
 /*--------------------------------------------------------------------------*/
-static int getFileSize(const std::wstring& _wfilename)
+static int getFileSize(const std::string& _filename)
 {
-#ifdef _MSC_VER
-    std::wifstream file(_wfilename.c_str());
-#else
-    char *_filename = wide_string_to_UTF8((wchar_t*)_wfilename.c_str());
-    if (_filename == NULL)
-    {
-        return false;
-    }
-    std::ifstream file(_filename);
-#endif
+    std::ifstream file(_filename.c_str());
     file.seekg(std::ios::end);
     if(file.is_open())
     {
index 582778e..db6b60a 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <string>
 
-std::wstring getUniqueFilename(const std::wstring& _wfilename);
+std::string getUniqueFilename(const std::string& _filename);
 
 #endif /* __GETFULLFILENAME_HXX__ */
 /*--------------------------------------------------------------------------*/
index 66ab6a3..08d07c2 100644 (file)
@@ -31,9 +31,7 @@ void setScilabOutputMethod(SCILAB_OUTPUT_METHOD writer)
 
 static void scilabPrint(const char* _pstText)
 {
-    wchar_t* pwstTemp = to_wide_string(_pstText);
-    diaryWrite(pwstTemp, FALSE);
-    FREE(pwstTemp);
+    diaryWrite(_pstText, FALSE);
     (*_writer)(const_cast<char*>(_pstText));
 }
 
@@ -50,23 +48,6 @@ void scilabForcedWrite(const char* _pstText)
     scilabPrint(const_cast<char*>(_pstText));
 }
 
-void scilabWriteW(const wchar_t* _pwsText)
-{
-    if (isPromptShow())
-    {
-        char* pstTemp = wide_string_to_UTF8(_pwsText);
-        scilabWrite(pstTemp);
-        FREE(pstTemp);
-    }
-}
-
-void scilabForcedWriteW(const wchar_t* _pwsText)
-{
-    char* pstTemp = wide_string_to_UTF8(_pwsText);
-    scilabForcedWrite(pstTemp);
-    FREE(pstTemp);
-}
-
 void scilabError(const char* _pstText)
 {
     if (getSilentError() == VERBOSE_ERROR)
@@ -74,13 +55,3 @@ void scilabError(const char* _pstText)
         scilabPrint(const_cast<char*>(_pstText));
     }
 }
-
-void scilabErrorW(const wchar_t* _pwsText)
-{
-    if (getSilentError() == VERBOSE_ERROR)
-    {
-        char* pstTemp = wide_string_to_UTF8(_pwsText);
-        scilabPrint(pstTemp);
-        FREE(pstTemp);
-    }
-}