fix windows release compilation and remove "some" warnings ( 1800+ ) on windows 18/11518/4
Antoine ELIAS [Thu, 16 May 2013 11:15:46 +0000 (13:15 +0200)]
Change-Id: Ic4fe2b48124d1f0b065fb240c251f4cd9ec3f470

109 files changed:
scilab/modules/ast/includes/scilabexception.hxx
scilab/modules/cacsd/sci_gateway/c/gw_cacsd0.c
scilab/modules/cacsd/sci_gateway/c/gw_cacsd2.c
scilab/modules/cacsd/sci_gateway/c/gw_cacsd3.c
scilab/modules/cacsd/sci_gateway/c/sci_mucomp.c
scilab/modules/cacsd/sci_gateway/c/sci_zrankqr.c
scilab/modules/call_scilab/sci_gateway/c/gw_call_scilab.c
scilab/modules/completion/sci_gateway/c/gw_completion.c
scilab/modules/console/sci_gateway/c/gw_console.c
scilab/modules/console/src/c/dropFiles.c
scilab/modules/core/src/cpp/search_functions.cpp
scilab/modules/core/src/cpp/storeCommand.cpp
scilab/modules/data_structures/sci_gateway/c/gw_data_structures1.c
scilab/modules/data_structures/sci_gateway/c/gw_data_structures2.c
scilab/modules/differential_equations/includes/differential_equations_gw.hxx
scilab/modules/dynamic_link/sci_gateway/c/gw_dynamic_link.c
scilab/modules/elementary_functions/sci_gateway/c/gw_elementary_functions.c
scilab/modules/elementary_functions/sci_gateway/cpp/sci_real.cpp
scilab/modules/external_objects/includes/ScilabEnvironments.hxx
scilab/modules/fftw/sci_gateway/c/gw_fftw.c
scilab/modules/fftw/sci_gateway/c/sci_loadfftwlibrary.c
scilab/modules/fileio/sci_gateway/c/gw_fileio.c
scilab/modules/fileio/src/c/fscanfMat.c
scilab/modules/fileio/src/c/readline.c
scilab/modules/functions/sci_gateway/c/gw_functions.c
scilab/modules/functions_manager/includes/funcmanager.hxx
scilab/modules/graphic_export/sci_gateway/c/gw_graphic_export.c
scilab/modules/graphic_objects/includes/ScilabView.hxx
scilab/modules/graphics/sci_gateway/c/sci_plot2d1.c
scilab/modules/graphics/src/c/Format.c
scilab/modules/graphics/src/c/getHandleProperty/get_thickness_property.c
scilab/modules/graphics/src/nographics/nographics.c
scilab/modules/graphics/src/nographics/nographics.vcxproj
scilab/modules/graphics/src/nographics/nographics.vcxproj.filters
scilab/modules/hdf5/sci_gateway/c/gw_hdf5.c
scilab/modules/helptools/sci_gateway/c/gw_helptools.c
scilab/modules/history_manager/includes/dynlib_history_manager_gw.h
scilab/modules/history_manager/sci_gateway/c/gw_history_manager.c
scilab/modules/history_manager/src/cpp/HistoryFile.hxx
scilab/modules/history_manager/src/cpp/HistoryManager.hxx
scilab/modules/history_manager/src/cpp/HistorySearch.hxx
scilab/modules/integer/sci_gateway/c/gw_integer.c
scilab/modules/integer/src/c/genmsum.c
scilab/modules/integer/src/cpp/integer_gw.vcxproj
scilab/modules/io/sci_gateway/c/gw_io.c
scilab/modules/jvm/sci_gateway/c/gw_jvm.c
scilab/modules/jvm/src/nojvm/nojvm.vcxproj
scilab/modules/jvm/src/nojvm/nojvm.vcxproj.filters
scilab/modules/linear_algebra/includes/dynlib_linear_algebra_gw.h
scilab/modules/linear_algebra/sci_gateway/c/gw_linear_algebra.c
scilab/modules/linear_algebra/sci_gateway/c/gw_linear_algebra2.c
scilab/modules/linear_algebra/sci_gateway/cpp/linear_algebra_gw.vcxproj
scilab/modules/linear_algebra/sci_gateway/cpp/linear_algebra_gw.vcxproj.filters
scilab/modules/localization/sci_gateway/c/gw_localization.c
scilab/modules/matio/includes/gw_matio.h
scilab/modules/matio/includes/matio_gw.hxx
scilab/modules/matio/sci_gateway/c/gw_matio.c
scilab/modules/matio/sci_gateway/c/sci_matfile_open.c
scilab/modules/operations/src/c/doublecomplex.c
scilab/modules/operations/src/c/matrix_division.c
scilab/modules/output_stream/sci_gateway/c/gw_output_stream.c
scilab/modules/polynomials/includes/dynlib_polynomials_gw.h
scilab/modules/polynomials/src/c/polynomials.vcxproj
scilab/modules/polynomials/src/c/polynomials.vcxproj.filters
scilab/modules/renderer/renderer.vcxproj
scilab/modules/scicos/sci_gateway/c/gw_scicos.c
scilab/modules/scicos/sci_gateway/c/sci_model2blk.c
scilab/modules/scicos_blocks/src/c/canimxy3d.c
scilab/modules/scinotes/sci_gateway/c/gw_scinotes.c
scilab/modules/signal_processing/sci_gateway/c/gw_signal.c
scilab/modules/sound/sci_gateway/c/gw_sound.c
scilab/modules/sparse/sci_gateway/c/gw_sparse.c
scilab/modules/sparse/sci_gateway/cpp/sci_nnz.cpp
scilab/modules/sparse/sci_gateway/cpp/sci_sp2adj.cpp
scilab/modules/sparse/sci_gateway/cpp/sci_sparse.cpp
scilab/modules/spreadsheet/sci_gateway/c/gw_spreadsheet.c
scilab/modules/spreadsheet/src/c/csvRead.c
scilab/modules/spreadsheet/src/c/csvWrite.c
scilab/modules/spreadsheet/src/c/xls.c
scilab/modules/statistics/sci_gateway/c/gw_statistics.c
scilab/modules/string/src/c/pcre_private.c
scilab/modules/symbolic/sci_gateway/c/gw_symbolic.c
scilab/modules/system_env/includes/configvariable.hxx
scilab/modules/tclsci/sci_gateway/c/gw_tclsci.c
scilab/modules/tclsci/src/c/ScilabEval.c
scilab/modules/time/sci_gateway/c/gw_time.c
scilab/modules/types/includes/callable.hxx
scilab/modules/types/includes/inspector.hxx
scilab/modules/types/includes/int16.hxx
scilab/modules/types/includes/int32.hxx
scilab/modules/types/includes/int64.hxx
scilab/modules/types/includes/int8.hxx
scilab/modules/types/includes/matrixiterator.hxx
scilab/modules/types/includes/polynom.hxx
scilab/modules/types/includes/sparse.hxx
scilab/modules/types/includes/string.hxx
scilab/modules/types/includes/struct.hxx
scilab/modules/types/includes/uint16.hxx
scilab/modules/types/includes/uint32.hxx
scilab/modules/types/includes/uint64.hxx
scilab/modules/types/includes/uint8.hxx
scilab/modules/types/src/cpp/sparse.cpp
scilab/modules/ui_data/sci_gateway/c/gw_ui_data.c
scilab/modules/windows_tools/sci_gateway/c/gw_windows_tools.c
scilab/modules/windows_tools/src/c/scilab_windows/FilesAssociations.c
scilab/modules/windows_tools/src/c/scilab_windows/WndThread.c
scilab/modules/windows_tools/src/c/scilab_windows/console_main.c
scilab/modules/windows_tools/src/c/scilab_windows/splashScreen.cpp
scilab/modules/windows_tools/src/c/scilab_windows/windows_main.c

index 5ca6ea1..3d12f7a 100644 (file)
 #include "location.hxx"
 #include "dynlib_ast_tools.hxx"
 
+//disable warnings about exports STL items
+#pragma warning (disable : 4251)
+
 namespace ast
 {
-    class EXTERN_AST_TOOLS ScilabException : public std::exception
-    {
-    public :
-        ScilabException();
-        ScilabException(std::wstring _wstErrorMesssage);
-        ScilabException(std::string _stErrorMesssage);
-        ScilabException(const Location& _ErrorLocation);
-        ScilabException(std::wstring _wstErrorMesssage, int _iErrorNumber, const Location& _ErrorLocation);
-        virtual ~ScilabException() throw() {};
+class EXTERN_AST_TOOLS ScilabException : public std::exception
+{
+public :
+    ScilabException();
+    ScilabException(std::wstring _wstErrorMesssage);
+    ScilabException(std::string _stErrorMesssage);
+    ScilabException(const Location& _ErrorLocation);
+    ScilabException(std::wstring _wstErrorMesssage, int _iErrorNumber, const Location& _ErrorLocation);
+    virtual ~ScilabException() throw() {};
 
-        void            SetErrorMessage(std::wstring _wstErrorMesssage);
-        std::wstring    GetErrorMessage(void);
+    void            SetErrorMessage(std::wstring _wstErrorMesssage);
+    std::wstring    GetErrorMessage(void);
 
-        void            SetErrorNumber(int _iErrorNumber);
-        int             GetErrorNumber(void);
+    void            SetErrorNumber(int _iErrorNumber);
+    int             GetErrorNumber(void);
 
-        void            SetErrorLocation(const Location& _ErrorLocation);
-        Location&       GetErrorLocation(void);
-    protected :
-        std::wstring    m_wstErrorMessage;
+    void            SetErrorLocation(const Location& _ErrorLocation);
+    Location&       GetErrorLocation(void);
+protected :
+    std::wstring    m_wstErrorMessage;
 
-        int             m_iErrorNumber;
-        Location        m_ErrorLocation;
+    int             m_iErrorNumber;
+    Location        m_ErrorLocation;
 
-    protected :
-        void createScilabException(std::wstring _wstErrorMesssage = L"", int _iErrorNumber = 0, const Location& _ErrorLocation = *new Location());
-    };
+protected :
+    void createScilabException(std::wstring _wstErrorMesssage = L"", int _iErrorNumber = 0, const Location& _ErrorLocation = *new Location());
+};
 
-    class EXTERN_AST_TOOLS ScilabError : public ScilabException
-    {
-    public :
-        ScilabError() : ScilabException(){}
-        ScilabError(std::wstring _wstErrorMesssage) : ScilabException(_wstErrorMesssage){}
-        ScilabError(std::string _stErrorMesssage) : ScilabException(_stErrorMesssage){}
-        ScilabError(const Location& _ErrorLocation) : ScilabException(_ErrorLocation){}
-        ScilabError(std::wstring _wstErrorMesssage, int _iErrorNumber, const Location& _ErrorLocation) : ScilabException(_wstErrorMesssage, _iErrorNumber, _ErrorLocation){}
-    };
+class EXTERN_AST_TOOLS ScilabError : public ScilabException
+{
+public :
+    ScilabError() : ScilabException() {}
+    ScilabError(std::wstring _wstErrorMesssage) : ScilabException(_wstErrorMesssage) {}
+    ScilabError(std::string _stErrorMesssage) : ScilabException(_stErrorMesssage) {}
+    ScilabError(const Location& _ErrorLocation) : ScilabException(_ErrorLocation) {}
+    ScilabError(std::wstring _wstErrorMesssage, int _iErrorNumber, const Location& _ErrorLocation) : ScilabException(_wstErrorMesssage, _iErrorNumber, _ErrorLocation) {}
+};
 
-    class EXTERN_AST_TOOLS InternalAbort : public ScilabException
-    {
-    public :
-        InternalAbort(){}
-    };
+class EXTERN_AST_TOOLS InternalAbort : public ScilabException
+{
+public :
+    InternalAbort() {}
+};
 
-    class EXTERN_AST_TOOLS ScilabMessage : public ScilabException
-    {
-    public :
-        ScilabMessage() : ScilabException(){}
-        ScilabMessage(std::wstring _wstErrorMesssage); //: ScilabException(_wstErrorMesssage){}
-        ScilabMessage(std::string _stErrorMesssage); //: ScilabException(_stErrorMesssage){}
-        ScilabMessage(const Location& _ErrorLocation) : ScilabException(_ErrorLocation){}
-        ScilabMessage(std::wstring _wstErrorMesssage, int _iErrorNumber, const Location& _ErrorLocation); //: ScilabException(_wstErrorMesssage, _iErrorNumber, _ErrorLocation){}
-    };
+class EXTERN_AST_TOOLS ScilabMessage : public ScilabException
+{
+public :
+    ScilabMessage() : ScilabException() {}
+    ScilabMessage(std::wstring _wstErrorMesssage); //: ScilabException(_wstErrorMesssage){}
+    ScilabMessage(std::string _stErrorMesssage); //: ScilabException(_stErrorMesssage){}
+    ScilabMessage(const Location& _ErrorLocation) : ScilabException(_ErrorLocation) {}
+    ScilabMessage(std::wstring _wstErrorMesssage, int _iErrorNumber, const Location& _ErrorLocation); //: ScilabException(_wstErrorMesssage, _iErrorNumber, _ErrorLocation){}
+};
 }
 #endif // !AST_SCILABEXCEPTION_HXX
index 1e2b7d6..5e76be1 100644 (file)
 #include "callFunctionFromGateway.h"
 #include "api_scilab.h"
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[] =
-{
-//    {sci_gschur, "gschur"}, obsolete (use schur in linear algebra)
-//    {sci_gspec, "gspec"}, obsolete (use spec in linear algebra)
-    {sci_ereduc, "ereduc"},
-    {sci_fstair, "fstair"}
-};
-/*--------------------------------------------------------------------------*/
 int gw_cacsd0(void)
 {
     return 0;
index 5b73487..8feece7 100644 (file)
 #include "callFunctionFromGateway.h"
 #include "api_scilab.h"
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[]=
-{
-    {NULL, ""}, /* not used */
-    {sci_ppol, "ppol"},
-    {sci_tzer, "tzer"},
-    {sci_freq, "freq"},
-    {sci_ltitr, "ltitr"},
-    {sci_rtitr, "rtitr"}
-};
-/*--------------------------------------------------------------------------*/
 int gw_cacsd2(void)
 {
     return 0;
index de18281..c681f3c 100644 (file)
 #include "callFunctionFromGateway.h"
 #include "api_scilab.h"
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[] =
-{
-    {sci_arl2, "arl2_ius"},
-    {sci_residu, "residu"},
-    {sci_ldiv, "ldiv"}
-};
-/*--------------------------------------------------------------------------*/
 int gw_cacsd3(void)
 {
     return 0;
index 7b95818..5ae3aaf 100644 (file)
@@ -35,9 +35,9 @@ int sci_mucomp(char *fname, void* pvApiCtx)
     int* lIWORK     = NULL;
     double* lRWORK  = NULL;
 
-    int* piAddrlZ           = NULL;
-    doublecomplex* lZ       = NULL;
-    doublecomplex* lZWORK   = NULL;
+    int* piAddrlZ               = NULL;
+    doublecomplex* lZ           = NULL;
+    const doublecomplex* lZWORK = NULL;
 
     int LRWORK = 0, LZWRKMIN = 0;
     int M  = 0, N  = 0;
index 2bea32e..8791697 100644 (file)
@@ -37,11 +37,11 @@ int sci_zrankqr(char *fname, void* pvApiCtx)
     int* piAddrptrQ     = NULL;
     int* piAddrptrDWORK = NULL;
 
-    doublecomplex* ptrA     = NULL;
-    doublecomplex* ptrTAU   = NULL;
-    doublecomplex* ptrR     = NULL;
-    doublecomplex* ptrQ     = NULL;
-    doublecomplex* ptrDWORK = NULL;
+    doublecomplex* ptrA             = NULL;
+    const doublecomplex* ptrTAU     = NULL;
+    const doublecomplex* ptrR       = NULL;
+    const doublecomplex* ptrQ       = NULL;
+    const doublecomplex* ptrDWORK   = NULL;
 
     int minrhs = 1;
     int maxrhs = 3;
index b71ef81..23d355a 100644 (file)
 #include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[] =
-{
-{sci_fromjava,"fromjava"},
-{sci_fromc,"fromc"}
-};
-/*--------------------------------------------------------------------------*/
 int gw_call_scilab(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index 21423b6..ff75465 100644 (file)
 #include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[]=
-{
-{sci_completion,"completion"}
-};
-/*--------------------------------------------------------------------------*/
 int gw_completion(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index 51b8a76..c4bede2 100644 (file)
 #include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[]=
-{
-{NULL, ""}, //clc
-{NULL, ""}, //tohome
-{NULL, ""}, //lines
-{NULL, ""}, //prompt
-{NULL, ""} //iswaitingforinput
-};
-/*--------------------------------------------------------------------------*/
 int gw_console(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index 6b517ea..81706e7 100644 (file)
@@ -23,6 +23,7 @@
 #include "stricmp.h"
 #include "with_module.h"
 #include "os_strdup.h"
+#include "charEncoding.h"
 /*--------------------------------------------------------------------------*/
 #define BIN_EXTENSION_FILE ".bin"
 #define SAV_EXTENSION_FILE ".sav"
@@ -45,8 +46,8 @@
 #define FORMAT_UNKNOW_EXTENSION_FILES "disp(gettext('Unknown file type : %s'));"
 #define XCOS_NOT_INSTALLED "disp(gettext('Please install xcos module.'))"
 /*--------------------------------------------------------------------------*/
-static char *getCommandByFileExtension(char *File,char *FileExtension);
-static char *buildCommand(char *format,char *filename);
+static char *getCommandByFileExtension(char *File, char *FileExtension);
+static char *buildCommand(char *format, char *filename);
 static BOOL LaunchFilebyExtension(char *File);
 /*--------------------------------------------------------------------------*/
 BOOL dropFiles(char **files)
@@ -60,8 +61,15 @@ BOOL dropFiles(char **files)
         if (convertfile)
         {
             BOOL bCheck = LaunchFilebyExtension(convertfile);
-            if (convertfile) {FREE(convertfile);convertfile = NULL;}
-            if (!bCheck) return bCheck;
+            if (convertfile)
+            {
+                FREE(convertfile);
+                convertfile = NULL;
+            }
+            if (!bCheck)
+            {
+                return bCheck;
+            }
         }
         len++;
     }
@@ -70,86 +78,91 @@ BOOL dropFiles(char **files)
 /*--------------------------------------------------------------------------*/
 BOOL LaunchFilebyExtension(char *File)
 {
-    BOOL bOK=FALSE;
+    BOOL bOK = FALSE;
 
-    char *CommandLine=NULL;
-    char *FileExtension=NULL;
+    char *CommandLine = NULL;
+    char *FileExtension = NULL;
 
     FileExtension = FindFileExtension(File);
     CommandLine = getCommandByFileExtension(File, FileExtension);
 
     if (CommandLine)
     {
-        StoreCommand(CommandLine);
+        wchar_t* pwstCommandLine = to_wide_string(CommandLine);
+        StoreCommand(pwstCommandLine);
         bOK = TRUE;
 
         FREE(CommandLine);
+        FREE(pwstCommandLine);
         CommandLine = NULL;
     }
 
-    if (FileExtension) {FREE(CommandLine);CommandLine=NULL;}
+    if (FileExtension)
+    {
+        FREE(CommandLine);
+        CommandLine = NULL;
+    }
 
     return bOK;
 }
 /*--------------------------------------------------------------------------*/
-static char *getCommandByFileExtension(char *File,char *FileExtension)
+static char *getCommandByFileExtension(char *File, char *FileExtension)
 {
     char *command = NULL;
 
     if (FileExtension)
     {
         if ( (stricmp(FileExtension, BIN_EXTENSION_FILE) == 0) ||
-            (stricmp(FileExtension, SAV_EXTENSION_FILE) == 0) ||
-            (stricmp(FileExtension, SOD_EXTENSION_FILE) == 0))
+                (stricmp(FileExtension, SAV_EXTENSION_FILE) == 0) ||
+                (stricmp(FileExtension, SOD_EXTENSION_FILE) == 0))
         {
             command = buildCommand(FORMAT_BIN_SCE_EXTENSION_FILES, File);
         }
-        else
-            if ( (stricmp(FileExtension, COS_EXTENSION_FILE) == 0) ||
-                (stricmp(FileExtension, COSF_EXTENSION_FILE) == 0) ||
-                (stricmp(FileExtension, ZCOS_EXTENSION_FILE) == 0) ||
-                (stricmp(FileExtension, XCOS_EXTENSION_FILE) == 0))
+        else if ( (stricmp(FileExtension, COS_EXTENSION_FILE) == 0) ||
+                  (stricmp(FileExtension, COSF_EXTENSION_FILE) == 0) ||
+                  (stricmp(FileExtension, ZCOS_EXTENSION_FILE) == 0) ||
+                  (stricmp(FileExtension, XCOS_EXTENSION_FILE) == 0))
+        {
+            if (with_module(L"xcos"))
             {
-                if (with_module("xcos"))
-                {
-                    command = buildCommand(FORMAT_COS_COSF_XCOS_EXTENSION_FILES, File);
-                }
-                else
-                {
-                    command = os_strdup(XCOS_NOT_INSTALLED);
-                }
+                command = buildCommand(FORMAT_COS_COSF_XCOS_EXTENSION_FILES, File);
             }
             else
-                if (stricmp(FileExtension,SCI_EXTENSION_FILE) == 0)
-                {
-                    command = buildCommand(FORMAT_SCI_EXTENSION_FILES, File);
-                }
-                else
-                    if ( (stricmp(FileExtension, SCE_EXTENSION_FILE) == 0) || (stricmp(FileExtension, TST_EXTENSION_FILE) == 0) || (stricmp(FileExtension, DEM_EXTENSION_FILE) == 0) )
-                    {
-                        command = buildCommand(FORMAT_SCE_TST_EXTENSION_FILES, File);
-                    }
-                    else
-                        if (stricmp(FileExtension, SCG_EXTENSION_FILE) == 0)
-                        {
-                            command = buildCommand(FORMAT_SCG_EXTENSION_FILES, File);
-                        }
-                        else
-                        {
-                            command = buildCommand(FORMAT_UNKNOW_EXTENSION_FILES, File);
-                        }
+            {
+                command = os_strdup(XCOS_NOT_INSTALLED);
+            }
+        }
+        else if (stricmp(FileExtension, SCI_EXTENSION_FILE) == 0)
+        {
+            command = buildCommand(FORMAT_SCI_EXTENSION_FILES, File);
+        }
+        else if ( (stricmp(FileExtension, SCE_EXTENSION_FILE) == 0) || (stricmp(FileExtension, TST_EXTENSION_FILE) == 0) || (stricmp(FileExtension, DEM_EXTENSION_FILE) == 0) )
+        {
+            command = buildCommand(FORMAT_SCE_TST_EXTENSION_FILES, File);
+        }
+        else if (stricmp(FileExtension, SCG_EXTENSION_FILE) == 0)
+        {
+            command = buildCommand(FORMAT_SCG_EXTENSION_FILES, File);
+        }
+        else
+        {
+            command = buildCommand(FORMAT_UNKNOW_EXTENSION_FILES, File);
+        }
     }
     return command;
 }
 /*--------------------------------------------------------------------------*/
-static char *buildCommand(char *format,char *filename)
+static char *buildCommand(char *format, char *filename)
 {
     char *command = NULL;
 
     if (format && filename)
     {
-        command =(char*)MALLOC( (strlen(filename) + strlen(format) + 1)*sizeof(char) );
-        if (command) sprintf(command,format,filename);
+        command = (char*)MALLOC( (strlen(filename) + strlen(format) + 1) * sizeof(char) );
+        if (command)
+        {
+            sprintf(command, format, filename);
+        }
     }
 
     return command;
index d3239a3..ad5d81c 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
 #include "intmacr2tree.h" /*#define idstk(x,y) (C2F(vstk).idstk+(x-1)+(y-1)*nsiz) */
 
     void C2F(siflibs)(int* id, int* k_ptr, int* istr, int* lbibn, int* nbibn,
-        int* ilp, int* nn, int* should_return);
+                      int* ilp, int* nn, int* should_return);
     void C2F(sivars)(int* id, int* should_return);
     void C2F(namstr)(int* id, int* str, int* n, int const* job);
 }
@@ -37,34 +37,34 @@ extern "C" {
 
 namespace
 {
-    char const f_true = 1;
-    char const f_false = 0;
-    int const percent = 56;
-    int const nclas = 29;
-    int const from_id = 1;
-
-    /* directly convert from id to upper char */
-    int upper_char(int id)
-    {
-        /* scilab character encoding is using signed bytes packed into an int.
-         * testing for the 7th bit with & 0x80 gives us the sign
-         * & 0xff extracts the byte if positive,
-         * |0xffffff00 extracts the byte if negative (assuming two's complement negative numbers representations)
-         * abs() takes the upper value in scilab character encoding.
-         */
-        return std::abs((int)((id & 0x80) ? (id |0xffffff00) :  (id & 0xff)));
-    }
+char const f_true = 1;
+char const f_false = 0;
+int const percent = 56;
+int const nclas = 29;
+int const from_id = 1;
+
+/* directly convert from id to upper char */
+int upper_char(int id)
+{
+    /* scilab character encoding is using signed bytes packed into an int.
+     * testing for the 7th bit with & 0x80 gives us the sign
+     * & 0xff extracts the byte if positive,
+     * |0xffffff00 extracts the byte if negative (assuming two's complement negative numbers representations)
+     * abs() takes the upper value in scilab character encoding.
+     */
+    return std::abs((int)((id & 0x80) ? (id | 0xffffff00) :  (id & 0xff)));
+}
 
-    /* gives the discriminating char (either first of second if first=percent) */
-    int id_char(int const* id)
+/* gives the discriminating char (either first of second if first=percent) */
+int id_char(int const* id)
+{
+    int ch(upper_char(*id));
+    if (ch == percent)
     {
-        int ch(upper_char(*id));
-        if (ch == percent)
-        {
-            return upper_char((*id)>>8);
-        }
-        return ch;
+        return upper_char((*id) >> 8);
     }
+    return ch;
+}
 }
 /* search for an id in the libraries
  * as we reimplement part of Fortran function, we now use a 'bool' (for Fortran) should_return to tell calling
@@ -75,62 +75,61 @@ void C2F(siflibs)(int* id, int* k_ptr, int* istr, int* lbibn_ptr, int* nbibn_ptr
                   int* ilp_ptr, int* nn_ptr, int* should_return)
 {
 
-    int const* const lstk_ptr = (int*)C2F(vstk).lstk-1;
-    int const* const istk_ptr = ((int*)C2F(stack).Stk)-1;
     int k, ilp, nbibn, lbibn;
 
-    *should_return= f_false;
+    *should_return = f_false;
 
-    for (k= Bot; k < C2F(vstk).isiz; ++k)
+    for (k = Bot; k < C2F(vstk).isiz; ++k)
     {
-        int il = iadr(lstk_ptr[k]);
+        int il = iadr(*Lstk(k));
         int ip;
 
-        if (istk_ptr[il] == sci_lib)
+        if (*istk(il) == sci_lib)
         {
-            nbibn = istk_ptr[il+1];
-            lbibn = il+2;
-            il += nbibn+2;
-            ilp = il+1;
+            nbibn = *istk(il + 1);
+            lbibn = il + 2;
+            il += nbibn + 2;
+            ilp = il + 1;
 #ifdef _MSC_VER
-            ip = min(nclas,max(1, id_char(id)-9));
+            ip = min(nclas, max(1, id_char(id) - 9));
 #else
-            ip =  std::min(nclas,std::max(1, id_char(id)-9));
+            ip =  std::min(nclas, std::max(1, id_char(id) - 9));
 #endif
             if (ip <= nclas)
             {
 
-                int n = istk_ptr[ilp+ip] -istk_ptr[ilp+ip-1];
+                int n = *istk(ilp + ip) - *istk(ilp + ip - 1);
                 if (n != 0)
                 {
-                    int iln= ilp+nclas+1+(istk_ptr[ilp+ip-1]-1)*nsiz;
+                    int iln = ilp + nclas + 1 + (*istk(ilp + ip - 1) - 1) * nsiz;
 
-                    for (int i = 1; i<=n; ++i, iln+= nsiz)
+                    for (int i = 1; i <= n; ++i, iln += nsiz)
                     {
-                        if (eq_n<nsiz>(id, istk_ptr+iln))
-                        { /* 39 */
+                        if (eq_n<nsiz>(id, istk(iln)))
+                        {
+                            /* 39 */
                             if ((Fin == -1) || (Fin == -3))
                             {
-                                C2F(com).fun= k;
-                                Fin= i;
-                                *should_return= f_true;
+                                C2F(com).fun = k;
+                                Fin = i;
+                                *should_return = f_true;
                                 return;
                             }
 
-                            Fin= i;
+                            Fin = i;
                             if (C2F(errgst).err1 != 0)
                             {
-                                C2F(com).fun= Fin= 0;
-                                *should_return= f_true;
+                                C2F(com).fun = Fin = 0;
+                                *should_return = f_true;
                                 return;
                             }
 
-                            C2F(namstr)(id,istr, nn_ptr, &from_id);
-                            *k_ptr= k;
-                            *lbibn_ptr= lbibn;
-                            *nbibn_ptr= nbibn;
-                            *ilp_ptr= ilp;
-                            *should_return= f_false;
+                            C2F(namstr)(id, istr, nn_ptr, &from_id);
+                            *k_ptr = k;
+                            *lbibn_ptr = lbibn;
+                            *nbibn_ptr = nbibn;
+                            *ilp_ptr = ilp;
+                            *should_return = f_false;
                             return;
                         }
                     }
@@ -141,12 +140,12 @@ void C2F(siflibs)(int* id, int* k_ptr, int* istr, int* lbibn_ptr, int* nbibn_ptr
         }
 
     }
-    C2F(com).fun= Fin= 0;
-    *should_return= f_true;
+    C2F(com).fun = Fin = 0;
+    *should_return = f_true;
     return;
 }
 
-/* search for an id in vars, also lifted from Fortran code in funs.f 
+/* search for an id in vars, also lifted from Fortran code in funs.f
  30   k=bot-1
  31   k=k+1
       if(k.gt.isiz) goto 35
@@ -164,31 +163,32 @@ c     modif 1.3 SS
 */
 void C2F(sivars)(int* id, int* should_return)
 {
-    int* const lstk_ptr = (int*)C2F(vstk).lstk-1;
+    int* const lstk_ptr = (int*)C2F(vstk).lstk - 1;
 
     int k;
     /*  idstk(x,y) (C2F(vstk).idstk+(x-1)+(y-1)*nsiz) */
-    int* id_addr=C2F(vstk).idstk;
-    for (*should_return= f_false, k= Bot, id_addr+=(k-1)*nsiz;
-         k <=  C2F(vstk).isiz && !eq_n<nsiz>(id_addr, id);
-         ++k, id_addr+=nsiz)
+    int* id_addr = C2F(vstk).idstk;
+    for (*should_return = f_false, k = Bot, id_addr += (k - 1) * nsiz;
+            k <=  C2F(vstk).isiz && !eq_n<nsiz>(id_addr, id);
+            ++k, id_addr += nsiz)
     {
     }
 
     if (k <=  C2F(vstk).isiz)
-    {/* eq_id */
-        int il=lstk_ptr[k];
-        il=il+il-1;/* iadr() */
+    {
+        /* eq_id */
+        int il = lstk_ptr[k];
+        il = il + il - 1; /* iadr() */
         if ((*istk(il) != sci_u_function) && (*istk(il) != sci_c_function))
         {
-            C2F(com).fun= Fin= 0;
+            C2F(com).fun = Fin = 0;
         }
         else
         {
-          C2F(com).fun= -1;
-          Fin= k;
+            C2F(com).fun = -1;
+            Fin = k;
         }
-        *should_return= f_true;
+        *should_return = f_true;
     }
-    return; 
+    return;
 }
index 55b561a..b84fa34 100644 (file)
@@ -36,9 +36,9 @@ extern "C"
 /*--------------------------------------------------------------------------*/
 typedef struct commandRec
 {
-       char              *command;             /* command info one string two integers */
-       int               flag; /* 1 if the command execution cannot be interrupted */
-       struct commandRec *next;
+    char              *command;                /* command info one string two integers */
+    int               flag; /* 1 if the command execution cannot be interrupted */
+    struct commandRec *next;
 } CommandRec;
 /*--------------------------------------------------------------------------*/
 /* Extern Signal to say we git a StoreCommand. */
@@ -49,7 +49,7 @@ static __threadLock commandQueueSingleAccess = __StaticInitLock;
 /*--------------------------------------------------------------------------*/
 int StoreCommand (wchar_t *command)
 {
-       return StoreCommandWithFlag (command, 0);
+    return StoreCommandWithFlag (command, 0);
 }
 /*--------------------------------------------------------------------------*/
 /*
@@ -57,13 +57,13 @@ int StoreCommand (wchar_t *command)
  * flag = 0 : the command is not shown in scilab window
  * flag = 1 : the command is shown in scilab window (if at prompt) and executed sequentially
  */
-int StoreCommandWithFlag (wchar_t *command,int flag)
+int StoreCommandWithFlag (wchar_t *command, int flag)
 {
     Parser parser;
     try
     {
         parser.parse(command);
-        if(parser.getExitStatus() == Parser::Succeded)
+        if (parser.getExitStatus() == Parser::Succeded)
         {
             ast::ExecVisitor exec;
             parser.getTree()->accept(exec);
@@ -73,7 +73,7 @@ int StoreCommandWithFlag (wchar_t *command,int flag)
             throw ScilabException(parser.getErrorMessage());
         }
     }
-    catch(ScilabException se)
+    catch (ScilabException se)
     {
         scilabErrorW(L"\n");
         scilabErrorW(L"\n");
@@ -83,19 +83,9 @@ int StoreCommandWithFlag (wchar_t *command,int flag)
         scilabErrorW(L"\n");
         scilabErrorW(_W("while executing a callback"));
     }
-    catch(ScilabMessage sm)
-    {
-        scilabErrorW(L"\n");
-        scilabErrorW(L"\n");
-        scilabErrorW(command);
-        scilabErrorW(L"\n");
-        scilabErrorW(sm.GetErrorMessage().c_str());
-        scilabErrorW(L"\n");
-        scilabErrorW(_W("while executing a callback"));
-    }
 
     delete parser.getTree();
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
 /*
@@ -103,14 +93,14 @@ int StoreCommandWithFlag (wchar_t *command,int flag)
  * flag = 0 : the command is not shown in scilab window
  * flag = 1 : the command is shown in scilab window (if at prompt) and executed sequentially
  */
-int StorePrioritaryCommandWithFlag (wchar_t *command,int flag)
+int StorePrioritaryCommandWithFlag (wchar_t *command, int flag)
 {
     Parser parser;
 
     try
     {
         parser.parse(command);
-        if(parser.getExitStatus() == Parser::Succeded)
+        if (parser.getExitStatus() == Parser::Succeded)
         {
             ast::ExecVisitor exec;
             parser.getTree()->accept(exec);
@@ -120,7 +110,7 @@ int StorePrioritaryCommandWithFlag (wchar_t *command,int flag)
             throw ScilabException(parser.getErrorMessage());
         }
     }
-    catch(ScilabException se)
+    catch (ScilabException se)
     {
         scilabErrorW(L"\n");
         scilabErrorW(L"\n");
@@ -130,25 +120,15 @@ int StorePrioritaryCommandWithFlag (wchar_t *command,int flag)
         scilabErrorW(L"\n");
         scilabErrorW(_W("while executing a callback"));
     }
-    catch(ScilabMessage sm)
-    {
-        scilabErrorW(L"\n");
-        scilabErrorW(L"\n");
-        scilabErrorW(command);
-        scilabErrorW(L"\n");
-        scilabErrorW(sm.GetErrorMessage().c_str());
-        scilabErrorW(L"\n");
-        scilabErrorW(_W("while executing a callback"));
-    }
 
     delete parser.getTree();
-       return (0);
+    return (0);
 }
 /*--------------------------------------------------------------------------*/
 int isEmptyCommandQueue(void)
 {
 #pragma message("WARNING : isEmptyCommandQueue is deprecated. It will be removed _BEFORE_ Scilab 6.0.")
-       // FIXME : Do not forget to remove me.
+    // FIXME : Do not forget to remove me.
     return 0;
 }
 /*--------------------------------------------------------------------------*/
@@ -159,22 +139,22 @@ int isEmptyCommandQueue(void)
 int GetCommand ( char *str)
 {
 #pragma message("WARNING : GetCommand is deprecated. It will be removed _BEFORE_ Scilab 6.0.")
-       // FIXME : Do not forget to remove me.
+    // FIXME : Do not forget to remove me.
     return 0;
 }
 /*--------------------------------------------------------------------------*/
 int ismenu(void)
 {
 #pragma message("WARNING : ismenu is deprecated. It will be removed _BEFORE_ Scilab 6.0.")
-       // FIXME : Do not forget to remove me.
+    // FIXME : Do not forget to remove me.
     return 0;
 }
 /*--------------------------------------------------------------------------*/
 /* menu/button info for Scilab */
-int C2F(getmen)(char * btn_cmd,int * lb, int * entry)
+int C2F(getmen)(char * btn_cmd, int * lb, int * entry)
 {
 #pragma message("WARNING : C2F(getmen) is deprecated. It will be removed _BEFORE_ Scilab 6.0.")
-       // FIXME : Do not forget to remove me.
+    // FIXME : Do not forget to remove me.
     return 0;
 }
 /*--------------------------------------------------------------------------*/
index 7224266..8abec37 100644 (file)
 #include "MALLOC.h"
 #include "Scierror.h"
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[]=
-{
-       {NULL, ""}, // list => Moved to type module
-       {NULL, ""}, // tlist => Moved to type module
-       {sci_rlist, "rlist"},
-       {sci_lsslist, "lsslist"},
-       {sci_glist, "glist"},
-       {sci_lstcat, "lstcat"},
-       {NULL, ""}, // mlist => Moved to type module
-       {sci_definedfields, "definedfields"},
-       {sci_lstsize, "lstsize"}
-};
-/*--------------------------------------------------------------------------*/
 int gw_data_structures1(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
 int C2F(gwdatastructures1)(void)
 {
-       return gw_data_structures1();
+    return gw_data_structures1();
 }
 /*--------------------------------------------------------------------------*/
index 61592bd..5b92a39 100644 (file)
 #include "MALLOC.h"
 #include "Scierror.h"
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[] =
-{
-    {NULL, ""}, //getfield
-    {NULL, ""} //setfield
-};
-/*--------------------------------------------------------------------------*/
 int gw_data_structures2(void)
 {
     return 0;
index c1279a0..ee713c3 100644 (file)
 
 extern "C"
 {
-#include "dynlib_differential_equations.h"
+#include "dynlib_differential_equations_gw.h"
 }
 
 // equation 1
-CPP_GATEWAY_PROTOTYPE_EXPORT(sci_ode, DIFFERENTIAL_EQUATIONS_IMPEXP);
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_ode, DIFFERENTIAL_EQUATIONS_GW_IMPEXP);
 
 // equation 2
-CPP_GATEWAY_PROTOTYPE_EXPORT(sci_impl, DIFFERENTIAL_EQUATIONS_IMPEXP);    // Old function name was sciimpl
-CPP_GATEWAY_PROTOTYPE_EXPORT(sci_dassl, DIFFERENTIAL_EQUATIONS_IMPEXP);   // Old function name dassli
-CPP_GATEWAY_PROTOTYPE_EXPORT(sci_dasrt, DIFFERENTIAL_EQUATIONS_IMPEXP);   // Old function name was dasrti
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_impl, DIFFERENTIAL_EQUATIONS_GW_IMPEXP);    // Old function name was sciimpl
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_dassl, DIFFERENTIAL_EQUATIONS_GW_IMPEXP);   // Old function name dassli
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_dasrt, DIFFERENTIAL_EQUATIONS_GW_IMPEXP);   // Old function name was dasrti
 
 // equation 3
-CPP_GATEWAY_PROTOTYPE_EXPORT(sci_odedc, DIFFERENTIAL_EQUATIONS_IMPEXP);   // Old function name was sci_odc
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_odedc, DIFFERENTIAL_EQUATIONS_GW_IMPEXP);   // Old function name was sci_odc
 
 // equation 4
-CPP_GATEWAY_PROTOTYPE_EXPORT(sci_intg, DIFFERENTIAL_EQUATIONS_IMPEXP);
-CPP_GATEWAY_PROTOTYPE_EXPORT(sci_int2d, DIFFERENTIAL_EQUATIONS_IMPEXP);
-CPP_GATEWAY_PROTOTYPE_EXPORT(sci_int3d, DIFFERENTIAL_EQUATIONS_IMPEXP);
-CPP_GATEWAY_PROTOTYPE_EXPORT(sci_feval, DIFFERENTIAL_EQUATIONS_IMPEXP);
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_intg, DIFFERENTIAL_EQUATIONS_GW_IMPEXP);
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_int2d, DIFFERENTIAL_EQUATIONS_GW_IMPEXP);
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_int3d, DIFFERENTIAL_EQUATIONS_GW_IMPEXP);
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_feval, DIFFERENTIAL_EQUATIONS_GW_IMPEXP);
 
 // equation 6
-CPP_GATEWAY_PROTOTYPE_EXPORT(sci_bvode, DIFFERENTIAL_EQUATIONS_IMPEXP);   // Old function name was scibvode
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_bvode, DIFFERENTIAL_EQUATIONS_GW_IMPEXP);   // Old function name was scibvode
 
 #endif /* !__DIFFERENTIAL_EQUATIONS_GW_HXX__ */
index 703d22b..03347e6 100644 (file)
 #include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[] =
-{
-       {NULL, ""}, //getdynlibext
-       {NULL, ""}, //addinter
-       {sci_fort,"fort"},
-       {sci_call,"call"},
-       {NULL ,""}, //link
-       {NULL, ""}, //ulink
-       {NULL, ""}, //c_link
-       {NULL, ""} // ilib_verbose
-};
-/*--------------------------------------------------------------------------*/
 int gw_dynamic_link(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index 28fa3f9..56f40e1 100644 (file)
 #include "MALLOC.h"
 
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[] =
-{
-    {NULL, ""}, //abs
-    {NULL, ""}, //real
-    {NULL, ""}, //imag
-    {NULL, ""}, //conj
-    {NULL, ""}, //round
-    {NULL, ""}, //int
-    {NULL, ""}, //size
-    {NULL, ""}, //sum
-    {NULL, ""}, //prod
-    {NULL, ""}, //diag
-    {NULL, ""}, //trui
-    {NULL, ""}, //tril
-    {NULL, ""}, //eye
-    {NULL, ""}, //rand
-    {NULL , ""}, //ones
-    {NULL , ""}, //max
-    {NULL , ""}, //min
-    {NULL , ""}, //kron
-    {NULL , ""}, //kron
-    {NULL , ""}, //kron
-    {NULL , ""}, //kron
-    {NULL , ""}, //sin
-    {NULL , ""}, //cos
-    {NULL , ""}, //atan
-    {NULL , ""}, //exp
-    {NULL , ""}, //sqrt
-    {NULL , ""}, //log
-    {sci_chinesehat, "^"},
-    {NULL, ""}, //sign
-    {NULL, ""}, //clean
-    {NULL, ""}, //floor
-    {NULL, ""}, //ceil
-    {NULL, ""}, //expm
-    {NULL, ""}, //cumsum
-    {NULL, ""}, //cumprod
-    {NULL, ""}, //testmatrix
-    {NULL, ""}, //isreal
-    {NULL, ""}, //frexp
-    {NULL, ""}, //zeros
-    {NULL, ""}, //tan
-    {NULL, ""}, //log1p
-    {NULL, ""}, //imult
-    {NULL, ""}, //asin
-    {NULL, ""}, //acos
-    {NULL, ""}, //number_properties
-    {NULL, ""}, //nearfloat
-    {NULL, ""}, //dsearch
-    {NULL, ""}, //isequal
-    {NULL, ""}, //spones
-    {NULL, ""}, //gsort
-    {NULL, ""}, //isequalbitwise
-    {NULL, ""}, //rat
-    {NULL, ""}, //base2dec
-    {NULL, ""} //dec2base
-};
-/*--------------------------------------------------------------------------*/
 int gw_elementary_functions(void)
 {
     return 0;
index c94e24f..327bb9c 100644 (file)
@@ -199,6 +199,7 @@ SciErr real_poly(void* pvApiCtx, int* _piAddress)
 SciErr real_sparse(void* pvApiCtx, int* _piAddress)
 {
     SciErr sciErr;
+    sciErr.iErr = 0;
 
     types::Sparse* pS = (types::Sparse*)_piAddress;
     types::Sparse* pSReal = pS->newReal();
index b97b4b6..e52cd2b 100644 (file)
@@ -13,6 +13,9 @@
 #ifndef __SCILABENVIRONMENTS_HXX__
 #define __SCILABENVIRONMENTS_HXX__
 
+//disable warnings about exports STL items
+#pragma warning (disable : 4251)
+
 #include <vector>
 
 #include "ScilabAbstractEnvironmentException.hxx"
index 4e71d76..43ed8d6 100644 (file)
 #include "api_scilab.h"
 #include "MALLOC.h"
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[] =
-{
-{ sci_loadfftwlibrary,"loadfftwlibrary"},
-{ sci_disposefftwlibrary,"disposefftwlibrary"},
-{ sci_fftwlibraryisloaded,"fftwlibraryisloaded"},
-{ sci_fftw,"fftw"},
-{ sci_fftw_flags,"fftw_flags"},
-{ sci_get_fftw_wisdom,"get_fftw_wisdom"},
-{ sci_set_fftw_wisdom,"set_fftw_wisdom"},
-{ sci_fftw_forget_wisdom,"fftw_forget_wisdom"},
-{ sci_dct,"dct"},
-{ sci_dst,"dst"}
-};
-/*--------------------------------------------------------------------------*/
 int gw_fftw(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index a2d1013..146cb30 100644 (file)
@@ -20,7 +20,6 @@
 /*--------------------------------------------------------------------------*/
 int sci_loadfftwlibrary(char *fname, void* pvApiCtx)
 {
-    static int l1, n1, m1;
     char* FFTWLibname = NULL;
     char* l1char = NULL;
     int* piAddr1 = NULL;
@@ -53,7 +52,6 @@ int sci_loadfftwlibrary(char *fname, void* pvApiCtx)
     FFTWLibname = l1char;
     setfftwlibname(FFTWLibname);
 
-    n1 = 1;
     if ( LoadFFTWLibrary(FFTWLibname) )
     {
         iErr = createScalarBoolean(pvApiCtx, nbInputArgument(pvApiCtx) + 1, 1); // true
index 3bf6db6..bd6c3de 100644 (file)
 #include "MALLOC.h"
 #include "api_scilab.h"
 /*--------------------------------------------------------------------------*/
-/*  interface function */
-/*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[]={
-       {NULL, ""}, //mopen
-       {NULL, ""}, //mputstr
-       {NULL, ""}, //mclose
-       {NULL, ""}, //mput
-       {NULL, ""}, //mget
-       {NULL, ""}, //mgetstr
-       {NULL, ""}, //meof
-       {NULL, ""}, //mseek
-       {NULL, ""}, //mtell
-       {NULL, ""}, //mclearerr
-       {NULL, ""}, //mfprintf *
-       {NULL, ""}, //mscanf *
-       {NULL, ""}, //mfscanf *
-       {NULL, ""}, //msscanf *
-       {NULL,"" }, //fscanfMat
-       {NULL,"" }, //fprintfMat
-       {NULL, ""}, //merror
-       {NULL, ""}, //findfiles
-       {NULL, ""}, //maxfiles => deprecated (Scilab 5.4)
-       {NULL, ""}, //getdrives
-       {NULL, ""}, //fullpath
-       {NULL, ""}, //deletefile
-       {NULL, ""}, //pathsep
-       {NULL, ""}, //filesep
-       {NULL, ""}, //getlongpathname
-       {NULL, ""}, //getshortpathname
-       {NULL, ""}, //fileext
-       {NULL, ""}, //isdir
-       {NULL, ""}, //removedir
-       {NULL, ""}, //createdir
-       {NULL, ""}, //pwd
-       {NULL, ""}, //chdir
-       {NULL, ""}, //fileinfo
-       {NULL, ""}, //newest
-       {NULL, ""}, //getrelativefilename
-       {NULL, ""}, //get_absolute_file_path
-       {NULL, ""}, //copyfile
-       {NULL, ""}, //isfile
-       {NULL, ""}, //fileparts
-       {NULL, ""}, //movefile
-       {NULL, ""}, //basename
-       {NULL, ""}, //pathconvert
-       {NULL, ""}, //cd
-    {NULL, ""}, //mgetl
-    {NULL, ""}, //mputl
-    {NULL, ""}, //tempname
-    {NULL, ""}, //getURL
-    {NULL, ""}  //splitURL
-};
-/*--------------------------------------------------------------------------*/
 int gw_fileio(void)
 {
     return 0;
 }
 /*--------------------------------------------------------------------------*/
-
index 72c29e1..9fd602f 100644 (file)
@@ -84,6 +84,7 @@ fscanfMatResult *fscanfMat(char *filename, char *format, char *separator)
 
 
     fscanfMatResult *resultFscanfMat = NULL;
+    wchar_t **pwsLines = NULL;
     char **lines = NULL;
     int nblines = 0;
     double *dValues = NULL;
@@ -124,7 +125,16 @@ fscanfMatResult *fscanfMat(char *filename, char *format, char *separator)
         return resultFscanfMat;
     }
 
-    lines = mgetl(fd, -1, &nblines, &errMGETL);
+    pwsLines = mgetl(fd, -1, &nblines, &errMGETL);
+
+    lines = (char**)MALLOC(sizeof(char*) * nblines);
+    for (i = 0 ; i < nblines ; i++)
+    {
+        lines[i] = wide_string_to_UTF8(pwsLines[i]);
+    }
+
+    freeArrayOfWideString(pwsLines, nblines);
+
     C2F(mclose)(&fd, &dErrClose);
     if (errMGETL != MGETL_NO_ERROR)
     {
index d453984..a0d3705 100644 (file)
@@ -17,6 +17,7 @@
 #include "mgetl.h"
 #include "stack-def.h" /* bsiz */
 #include "freeArrayOfString.h"
+#include "MALLOC.h"
 /*--------------------------------------------------------------------------*/
 #define EMPTYSTR ""
 /*--------------------------------------------------------------------------*/
@@ -27,28 +28,31 @@ int LineRead(int fd, char buf[], int n, int *cnt, int *nr)
     int nbLinesReaded = 0;
     int mgetIerr = MGETL_ERROR;
 
-    char **lines = mgetl(fd, nbLinesToRead, &nbLinesReaded, &mgetIerr);
+    wchar_t **lines = mgetl(fd, nbLinesToRead, &nbLinesReaded, &mgetIerr);
+    char* line = wide_string_to_UTF8(lines[0]);
+    freeArrayOfWideString(lines, nbLinesReaded);
+
     *cnt = 0;
     *nr = 0;
 
     memset(buf, 0, n);
     strcpy(buf, EMPTYSTR);
 
-    switch(mgetIerr)
+    switch (mgetIerr)
     {
-    case MGETL_NO_ERROR:
+        case MGETL_NO_ERROR:
         {
-            if ((lines[0]) && (lines) && (nbLinesReaded == 1))
+            if (line && nbLinesReaded == 1)
             {
                 /* current limitation (bsiz) of line readed by scilab */
-                if ((int)strlen(lines[0]) < bsiz)
+                if ((int)wcslen(lines[0]) < bsiz)
                 {
-                    strcpy(buf, lines[0]);
+                    strcpy(buf, line);
                     returnedInfo = READNEXTLINE_ERROR_EOL;
                 }
                 else
                 {
-                    strncpy(buf, lines[0], bsiz);
+                    strncpy(buf, line, bsiz);
                     returnedInfo = READNEXTLINE_ERROR_BUFFER_FULL;
                 }
             }
@@ -59,7 +63,7 @@ int LineRead(int fd, char buf[], int n, int *cnt, int *nr)
         }
         break;
 
-    case MGETL_EOF:
+        case MGETL_EOF:
         {
             if (lines)
             {
@@ -70,14 +74,14 @@ int LineRead(int fd, char buf[], int n, int *cnt, int *nr)
                 else
                 {
                     /* current limitation (bsiz) of line readed by scilab */
-                    if ((int)strlen(lines[0]) >= bsiz)
+                    if ((int)strlen(line) >= bsiz)
                     {
-                        strcpy(buf, lines[0]);
+                        strcpy(buf, line);
                         returnedInfo = READNEXTLINE_ERROR_EOF_REACHED_AFTER_EOL;
                     }
                     else
                     {
-                        strncpy(buf, lines[0], bsiz);
+                        strncpy(buf, line, bsiz);
                         returnedInfo = READNEXTLINE_ERROR_BUFFER_FULL;
                     }
                 }
@@ -89,9 +93,9 @@ int LineRead(int fd, char buf[], int n, int *cnt, int *nr)
         }
         break;
 
-    case MGETL_MEMORY_ALLOCATION_ERROR:
-    case MGETL_ERROR:
-    default:
+        case MGETL_MEMORY_ALLOCATION_ERROR:
+        case MGETL_ERROR:
+        default:
         {
             returnedInfo = READNEXTLINE_ERROR_ERROR_UNMANAGED;
         }
@@ -101,10 +105,9 @@ int LineRead(int fd, char buf[], int n, int *cnt, int *nr)
     *cnt = (int)strlen(buf) + 1;
     *nr = *cnt;
 
-    if (lines)
+    if (line)
     {
-            freeArrayOfString(lines, nbLinesReaded);
-            lines = NULL;
+        FREE(line);
     }
 
     return returnedInfo;
index 2f3b9c3..ba2eeea 100644 (file)
 #include "callFunctionFromGateway.h"
 #include "recursionFunction.h"
 /*--------------------------------------------------------------------------*/
-static int sci_getf(char *fname,unsigned long fname_len)
-{
-       // Because we do not want change order in gateway
-       // empty function
-       return 0;
-}
-/*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[] =
-{
-       {NULL ,""}, //lib
-       {NULL, ""}, //deff
-       {NULL, ""}, //getf
-       {NULL, ""}, //exec
-       {NULL, ""}, //execstr
-       {sci_librarieslist,"librarieslist"},
-       {sci_libraryinfo,"libraryinfo"},
-       {NULL, ""} //whereis
-};
-/*--------------------------------------------------------------------------*/
 int gw_functions(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index df872ea..3aa4ad8 100644 (file)
 #include <iostream>
 #include <string>
 
+//disable warnings about exports STL items
+#pragma warning (disable : 4251)
 
 #ifdef _MSC_VER
-       #if FUNC_MAN_EXPORTS
-               #define EXTERN_FUNC_MAN __declspec (dllexport)
-       #else
-               #define EXTERN_FUNC_MAN __declspec (dllimport)
-       #endif
+#if FUNC_MAN_EXPORTS
+#define EXTERN_FUNC_MAN __declspec (dllexport)
 #else
-       #define EXTERN_FUNC_MAN 
+#define EXTERN_FUNC_MAN __declspec (dllimport)
+#endif
+#else
+#define EXTERN_FUNC_MAN
 #endif
 
 using namespace std;
@@ -39,30 +41,30 @@ using namespace std;
 #define END_EXT     L".end"
 
 //Gateway function pointer
-typedef int (*GW_MOD)(void); 
+typedef int (*GW_MOD)(void);
 
 class EXTERN_FUNC_MAN FuncManager
 {
-private : 
-//     map <string, FuncInfo*> m_FuncMap;
-       map<wstring, GW_MOD>    m_ModuleMap;
-       map<wstring, GW_MOD>    m_ActivModuleMap;
-       list<wstring>           m_ModuleName;
-       wstring                 m_szXmlFile;
+private :
+    // map <string, FuncInfo*> m_FuncMap;
+    map<wstring, GW_MOD>    m_ModuleMap;
+    map<wstring, GW_MOD>    m_ActivModuleMap;
+    list<wstring>           m_ModuleName;
+    wstring                 m_szXmlFile;
     bool                    m_bNoStart;
 public:
-       FuncManager(void);
-       ~FuncManager(void);
+    FuncManager(void);
+    ~FuncManager(void);
 
     bool LoadModules(bool _bNoStart);
 
 private :
-       bool GetModules();
-       bool AppendModules();
-       bool VerifyModule(wchar_t* ModuleName);
+    bool GetModules();
+    bool AppendModules();
+    bool VerifyModule(wchar_t* ModuleName);
 
-       bool CreateModuleList(void);
-       bool LoadFuncByModule(void);
+    bool CreateModuleList(void);
+    bool LoadFuncByModule(void);
 
     bool ExecuteStartFile(wstring _stModule);
 
index 6869970..a49516b 100644 (file)
 #include "gw_graphic_export.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
-static BOOL loadedDep = FALSE;
-static BOOL loadedDepVectorialExport = FALSE;
-/*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[] =
-{
-  {NULL, "xs2bmp"}, //sci_xs2bmp
-  {NULL, "xs2gif"}, //sci_xs2gif
-  {NULL, "xs2jpg"}, //sci_xs2jpg
-  {NULL, "xs2png"}, //sci_xs2png
-  {NULL, "xs2ppm"}, //sci_xs2ppm
-  {NULL, "xs2eps"}, //sci_xs2eps
-  {NULL, "xs2pdf"}, //sci_xs2pdf
-  {NULL, "xs2svg"}, //sci_xs2svg
-  {NULL, "xs2ps"}   //sci_xs2ps
-};
-/*--------------------------------------------------------------------------*/
 int gw_graphic_export(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index f1d70b5..83e253d 100644 (file)
@@ -18,6 +18,9 @@
 
 #include "dynlib_graphic_objects.h"
 
+//disable warnings about exports STL items
+#pragma warning (disable : 4251)
+
 extern "C"
 {
     void ScilabNativeView__createObject(char const* pstId);
index 4ee5fd9..68b3816 100644 (file)
@@ -61,7 +61,6 @@ int sci_plot2d1_G(char * fname, int ptype, void *pvApiCtx)
     int *axes = &axes_def;
     int iskip = 0, test  = 0;
     int m1 = 0, n1 = 0, m2 = 0, n2 = 0, i = 0, j = 0;
-    char strfl[4];
 
     static rhs_opts opts[] =
     {
index 8138505..11ee9a2 100644 (file)
 
 #define MAX(A,B) ((A<B)?B:A)
 
-static double spans[18] = {10, 12, 14, 15, 16, 18, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 90, 100};
-static int ticks[18] = {11, 7, 8, 4, 9, 10, 11, 6, 7, 8, 9, 10, 11, 7, 8, 9, 10, 11};
-static double width[18] = {1, 2, 2, 5, 2, 2, 2, 5, 5, 5, 5, 5, 5, 10, 10, 10, 10, 10};
-
 /** Maximum of ticks for log mode */
 #define MAX_LOG_TICKS 15
 
index bca8a6b..ce6ec4e 100644 (file)
@@ -35,7 +35,7 @@
 void* get_thickness_property(void* _pvCtx, char* pobjUID)
 {
     double lineThickness = 0.0;
-    double *pdblLineThickness = &lineThickness;
+    void* pdblLineThickness = &lineThickness;
 
     getGraphicObjectProperty(pobjUID, __GO_LINE_THICKNESS__, jni_double,  &pdblLineThickness);
 
index dddaaf6..a05057c 100644 (file)
 /*--------------------------------------------------------------------------*/
 #include <string.h>
 #include "gw_graphics.h"
-#include "callFunctionFromGateway.h"
-#include "graphicModuleLoad.h"
 #include "TerminateGraphics.h"
-#include "getDictionaryGetProperties.h"
-#include "getDictionarySetProperties.h"
-#include "DrawObjects.h"
 #include "GetProperty.h"
 #include "SetProperty.h"
-#include "math_graphics.h"
-#include "DestroyObjects.h"
-#include "axesScale.h"
 #include "BuildObjects.h"
-#include "BasicAlgos.h"
-#include "pixel_mode.h"
-#include "Axes.h"
-#include "getPropertyAssignedValue.h"
-#include "SetHashTable.h"
-#include "Scierror.h"
-#include "localization.h"
-#include "Format.h"
 #include "MALLOC.h"
-#include "Interaction.h"
-#include "InitObjects.h"
 
 /*--------------------------------------------------------------------------*/
 
index da9f313..d60c5ec 100644 (file)
@@ -77,7 +77,7 @@
     <ClCompile>
       <Optimization>Disabled</Optimization>
       <AdditionalIncludeDirectories>../../includes;../../../localization/includes;../../../core/includes;../../../output_stream/includes;../../../../libs/intl;../../../api_scilab/includes;../c/getHandleProperty;../../../operations/includes;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../dynamic_link/includes</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;GRAPHICS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;GRAPHICS_GW_EXPORTS;GRAPHICS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
     </ClCompile>
@@ -99,7 +99,7 @@
     <ClCompile>
       <Optimization>Disabled</Optimization>
       <AdditionalIncludeDirectories>../../includes;../../../localization/includes;../../../core/includes;../../../output_stream/includes;../../../../libs/intl;../../../api_scilab/includes;../c/getHandleProperty;../../../operations/includes;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../dynamic_link/includes</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;GRAPHICS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;GRAPHICS_GW_EXPORTS;GRAPHICS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
     </ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
       <AdditionalIncludeDirectories>../../includes;../../../localization/includes;../../../core/includes;../../../output_stream/includes;../../../../libs/intl;../../../api_scilab/includes;../c/getHandleProperty;../../../operations/includes;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../dynamic_link/includes</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;GRAPHICS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;GRAPHICS_GW_EXPORTS;GRAPHICS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
       <AdditionalIncludeDirectories>../../includes;../../../localization/includes;../../../core/includes;../../../output_stream/includes;../../../../libs/intl;../../../api_scilab/includes;../c/getHandleProperty;../../../operations/includes;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../dynamic_link/includes</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;GRAPHICS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;GRAPHICS_GW_EXPORTS;GRAPHICS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
   </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\includes\dynlib_graphics_gw.h" />
+    <ClInclude Include="..\..\includes\graphics_gw.hxx" />
+  </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
index 66b6421..1b2b218 100644 (file)
       <Filter>Resource Files</Filter>
     </ResourceCompile>
   </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\includes\graphics_gw.hxx">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\includes\dynlib_graphics_gw.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
 </Project>
\ No newline at end of file
index ab3fb6a..70afed9 100644 (file)
 #include "callFunctionFromGateway.h"
 #include "api_scilab.h"
 #include "MALLOC.h"
-
-/*--------------------------------------------------------------------------*/
-/*  interface function */
-/*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[] =
-{
-       {NULL, "export_to_hdf5"},
-       {NULL, "import_from_hdf5"},
-       {NULL, "listvar_in_hdf5"},
-       {NULL, "is_hdf5_file"},
-    {NULL, "h5dump"},
-    {NULL, "h5open"},
-    {NULL, "h5close"},
-    {NULL, "h5read"},
-    {NULL, "h5ls"},
-    {NULL, "%H5Object_p"},
-    {NULL, "%H5Object_e"},
-    {NULL, "h5group"},
-    {NULL, "h5rm"},
-    {NULL, "h5dataset"},
-    {NULL, "h5write"},
-    {NULL, "h5attr"},
-    {NULL, "h5writeattr"},
-    {NULL, "h5ln"},
-    {NULL, "h5readattr"},
-    {NULL, "h5flush"},
-    {NULL, "h5cp"},
-    {NULL, "h5isFile"},
-    {NULL, "h5isGroup"},
-    {NULL, "h5isSet"},
-    {NULL, "h5isAttr"},
-    {NULL, "h5isSpace"},
-    {NULL, "h5isType"},
-    {NULL, "h5isRef"},
-    {NULL, "h5isList"},
-    {NULL, "h5mount"},
-    {NULL, "h5umount"},
-    {NULL, "h5mv"},
-    {NULL, "h5get"},
-    {NULL, "h5label"},
-    {NULL, "h5exists"},
-    {NULL, "h5isCompound"},
-    {NULL, "%H5Object_fieldnames"},
-    {NULL, "%H5Object_fieldnames"},
-    {NULL, "h5isArray"},
-    {NULL, "h5isVlen"}
-};
 /*--------------------------------------------------------------------------*/
 int gw_hdf5(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
 
index 93bdb2e..e0abce2 100644 (file)
 #include "gw_helptools.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
-static BOOL loadedDep = FALSE;
-
-/*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[] =
-{
-       {NULL, ""} // buildDocv2
-};
-
-/*--------------------------------------------------------------------------*/
 int gw_helptools(void)
 {
     return 0;
index 1b629ec..8680437 100644 (file)
@@ -1,28 +1,28 @@
 /*
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) DIGITEO - 2009 - Allan CORNET
-* 
+*
 * This file must be used under the terms of the CeCILL.
 * This source file is licensed as described in the file COPYING, which
 * you should have received as part of this distribution.  The terms
-* are also available at    
+* are also available at
 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 *
 */
 
-/*--------------------------------------------------------------------------*/ 
+/*--------------------------------------------------------------------------*/
 #ifndef __DYNLIB_HISTORY_MANAGER_GW_H__
 #define __DYNLIB_HISTORY_MANAGER_GW_H__
 
 #ifdef _MSC_VER
-#ifdef HISTORY_MANAGER_EXPORTS_GW
+#ifdef HISTORY_MANAGER_GW_EXPORTS
 #define HISTORY_MANAGER_GW_IMPEXP __declspec(dllexport)
 #else
 #define HISTORY_MANAGER_GW_IMPEXP __declspec(dllimport)
 #endif
 #else
-#define HISTORY_MANAGER_GW_IMPEXP 
+#define HISTORY_MANAGER_GW_IMPEXP
 #endif
 
 #endif /* __DYNLIB_HISTORY_MANAGER_GW_H__ */
-/*--------------------------------------------------------------------------*/ 
+/*--------------------------------------------------------------------------*/
index 785c878..4f32276 100644 (file)
 #include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[] =
-{
-       {NULL,""}, // loadhistory
-       {NULL,""}, // savehistory
-       {NULL,""}, // gethistory
-       {NULL,""}, // resethistory
-       {NULL,""}, // displayhistory
-       {NULL,""}, // addhistory
-       {NULL,""}, // saveconsecutivecommands
-       {NULL,""}, // saveafterncommands
-       {NULL,""}, // gethistoryfile
-       {NULL,""}, // sethistoryfile
-       {NULL,""}, // removelinehistory
-       {NULL,""}, // historysize
-       {NULL,""}  // historymanager
-};
-/*--------------------------------------------------------------------------*/
 int gw_history_manager(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index 2169bc1..d834a20 100644 (file)
@@ -19,6 +19,10 @@ extern "C"
 #include "dynlib_history_manager.h"
 #include "BOOL.h"
 }
+
+//disable warnings about exports STL items
+#pragma warning (disable : 4251)
+
 /*------------------------------------------------------------------------*/
 typedef enum
 {
index 07a47b1..a01ac05 100644 (file)
@@ -26,6 +26,10 @@ extern "C"
 #include <list>
 #include "HistoryFile.hxx"
 #include "HistorySearch.hxx"
+
+//disable warnings about exports STL items
+#pragma warning (disable : 4251)
+
 /*------------------------------------------------------------------------*/
 class HISTORY_MANAGER_IMPEXP HistoryManager
 {
index a1ee716..3b5505f 100644 (file)
@@ -19,71 +19,75 @@ extern "C"
 #include "dynlib_history_manager.h"
 #include "BOOL.h"
 }
+
+//disable warnings about exports STL items
+#pragma warning (disable : 4251)
+
 /*------------------------------------------------------------------------*/
 class HISTORY_MANAGER_IMPEXP HistorySearch
 {
-       public:
-               /**
-               * Constructor
-               */
-               HistorySearch();
+public:
+    /**
+    * Constructor
+    */
+    HistorySearch();
 
-               /**
-               * Destructor
-               */
-               ~HistorySearch();
+    /**
+    * Destructor
+    */
+    ~HistorySearch();
 
-               /**
-               * set History to search
-               * @param a list of std::string
-               * @return TRUE or FALSE
-               */
-               BOOL setHistory(std::list<std::string> _lstCommands);
+    /**
+    * set History to search
+    * @param a list of std::string
+    * @return TRUE or FALSE
+    */
+    BOOL setHistory(std::list<std::string> _lstCommands);
 
-               /**
-               * set new token to search in history
-               * @param token (a string)
-               * @return TRUE or FALSE
-               */
-               BOOL setToken(std::string _stToken);
+    /**
+    * set new token to search in history
+    * @param token (a string)
+    * @return TRUE or FALSE
+    */
+    BOOL setToken(std::string _stToken);
 
-               /**
-               * get token searched in history
-               * @return token (a string)
-               */
-               std::string getToken(void);
+    /**
+    * get token searched in history
+    * @return token (a string)
+    */
+    std::string getToken(void);
 
-               /**
-               * returns size of the
-               */
-               int getSize(void);
+    /**
+    * returns size of the
+    */
+    int getSize(void);
 
-               /**
-               * reset HistorySearch Object
-               * @return TRUE or FALSE
-               */
-               BOOL reset(void);
+    /**
+    * reset HistorySearch Object
+    * @return TRUE or FALSE
+    */
+    BOOL reset(void);
 
-               /**
-               * Get the previous line in search
-               * @return a line
-               */
-               std::string getPreviousLine(void);
+    /**
+    * Get the previous line in search
+    * @return a line
+    */
+    std::string getPreviousLine(void);
 
-               /**
-               * Get the next line in search
-               * @return a line
-               */
-               std::string getNextLine(void);
+    /**
+    * Get the next line in search
+    * @return a line
+    */
+    std::string getNextLine(void);
 
-       protected:
+protected:
 
-       private:
-               std::list<std::string> m_Commands;
-               std::string m_stToken;
-               std::vector<std::string> m_vstLines;
-               int m_iPosition;
+private:
+    std::list<std::string> m_Commands;
+    std::string m_stToken;
+    std::vector<std::string> m_vstLines;
+    int m_iPosition;
 
-               BOOL search(void);
+    BOOL search(void);
 };
 /*------------------------------------------------------------------------*/
index f85c905..c6c34a6 100644 (file)
 extern BOOL BuildWithVS8ExpressF2C(void);
 #endif
 /*--------------------------------------------------------------------------*/
-static int C2F(scivoid)(char *fname,unsigned long fname_len)
+static int C2F(scivoid)(char *fname, unsigned long fname_len)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[]=
-{
-  {NULL, ""}, //int32
-  {NULL, ""}, //int16
-  {NULL, ""}, //int8
-  {NULL, ""}, //inttype
-  {NULL, ""}, //double
-  {NULL, ""}, //uint32
-  {NULL, ""}, //uint16
-  {NULL, ""}, //uint8
-  {C2F(scimgeti),"mgeti"},
-  {C2F(scivoid),"sci_void"},
-  {C2F(sciimput),"%i_mput"},
-  {C2F(sciitriu),"%i_triu"},
-  {C2F(sciitril),"%i_tril"},
-  {C2F(sciisum),"%i_sum"},
-//  {C2F(sciimax),"%i_max"},
-//  {C2F(sciimin),"%i_min"},
-  {C2F(sciip),"%i_p"},
-  {C2F(sciiprod),"%i_prod"},
-};
-/*--------------------------------------------------------------------------*/
 int gw_integer(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index fdd9d9a..19f8032 100644 (file)
@@ -39,40 +39,38 @@ static int c__1 = 1;
     }\
 }
 /*--------------------------------------------------------------------------*/
-int C2F(genmsum)(int *typ,int *job, int *a, int *na, int *m, int *n, int *v, int *nv)
+int C2F(genmsum)(int *typ, int *job, int *a, int *na, int *m, int *n, int *v, int *nv)
 {
-  int  i = 0, j = 0, t = 0, iv = 0;
+    int  i = 0, j = 0, t = 0, iv = 0;
 
-  switch (*typ) 
-  {
-  case 1:
-    MSUM(char);
-    break;
-  case 2:
-    MSUM(short);
-    break;
-  case 4:
-    MSUM(int) ;
-    break;
-  case 11:
-    MSUM(unsigned char);
-    break;
-  case 12:
-    MSUM(unsigned short);
-    break;
-  case 14:
-    MSUM(unsigned int);
-    break;
-  }
-  return 0;
+    switch (*typ)
+    {
+        case 1:
+            MSUM(char);
+            break;
+        case 2:
+            MSUM(short);
+            break;
+        case 4:
+            MSUM(int) ;
+            break;
+        case 11:
+            MSUM(unsigned char);
+            break;
+        case 12:
+            MSUM(unsigned short);
+            break;
+        case 14:
+            MSUM(unsigned int);
+            break;
+    }
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
 /* sum of int returning a double */
 #define MSUM_DOUBLE(Type) {\
 Type *A;\
-double *V;\
     A=(Type *)a;\
-    V=(Type *)v;\
     iv = 0;\
     if (*job == 0) {\
        t = 0.0;\
@@ -92,30 +90,30 @@ double *V;\
     }\
 }
 /*--------------------------------------------------------------------------*/
-int C2F(genmsumasdouble)(int *typ,int *job, int *a, int *na, int *m, int *n, double *v, int *nv)
+int C2F(genmsumasdouble)(int *typ, int *job, int *a, int *na, int *m, int *n, double *v, int *nv)
 {
     int  i = 0, j = 0, iv = 0;
     double t = 0.;
-    switch (*typ) 
+    switch (*typ)
     {
-    case 1:
-        MSUM_DOUBLE(char);
-        break;
-    case 2:
-        MSUM_DOUBLE(short);
-        break;
-    case 4:
-        MSUM_DOUBLE(int) ;
-        break;
-    case 11:
-        MSUM_DOUBLE(unsigned char);
-        break;
-    case 12:
-        MSUM_DOUBLE(unsigned short);
-        break;
-    case 14:
-        MSUM_DOUBLE(unsigned int);
-        break;
+        case 1:
+            MSUM_DOUBLE(char);
+            break;
+        case 2:
+            MSUM_DOUBLE(short);
+            break;
+        case 4:
+            MSUM_DOUBLE(int) ;
+            break;
+        case 11:
+            MSUM_DOUBLE(unsigned char);
+            break;
+        case 12:
+            MSUM_DOUBLE(unsigned short);
+            break;
+        case 14:
+            MSUM_DOUBLE(unsigned int);
+            break;
     }
     return 0;
 }
index c073af8..d2a06a8 100644 (file)
@@ -76,7 +76,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../output_stream/includes;../../../../libs/intl;../../../dynamic_link/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../output_stream/includes;../../../../libs/intl;../../../dynamic_link/includes;../../../system_env/includes;../../../threads/includes;../../../string/includes;../../../console/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;INTEGER_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../output_stream/includes;../../../../libs/intl;../../../dynamic_link/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../output_stream/includes;../../../../libs/intl;../../../dynamic_link/includes;../../../system_env/includes;../../../threads/includes;../../../string/includes;../../../console/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;INTEGER_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../output_stream/includes;../../../../libs/intl;../../../dynamic_link/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../output_stream/includes;../../../../libs/intl;../../../dynamic_link/includes;../../../system_env/includes;../../../threads/includes;../../../string/includes;../../../console/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;INTEGER_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
index e0b8dc8..707b43b 100644 (file)
 #include "callFunctionFromGateway.h"
 #include "recursionFunction.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(intsave)(); /* fortran subroutine */
-/*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[] =
-{
-
-{NULL, ""}, //setenv
-{NULL,""}, //read
-{NULL, ""}, //getenv
-{NULL,""}, //getio
-{NULL,""},
-{NULL,""},
-{NULL,""}, //write
-{NULL,""}, //rat
-{NULL, ""}, //file
-{NULL ,""}, //host
-{NULL, ""}, //unix
-{NULL,""}, //readb
-{NULL,""}, //writb
-{NULL,""}, //getpid
-{NULL,""}, //read4b
-{NULL,""}, //write4b
-{NULL,""}, //save
-{NULL, ""}, //load
-{NULL, ""} //%_load
-};
-/*--------------------------------------------------------------------------*/
 int gw_io(void)
 {
     return 0;
index 506b07c..40b44ce 100644 (file)
 #include "gw_jvm.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
-static gw_generic_table  Tab[]=
-{
-       {NULL, ""}, //with_embedded_jre
-       {NULL, ""}, //system_setproperty
-       {NULL, ""}, //system_getproperty
-       {NULL, ""}, //javaclasspath
-       {NULL, ""} //javalibrarypath
-};
-/*--------------------------------------------------------------------------*/
 int gw_jvm(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index a77f814..32094cf 100644 (file)
@@ -78,7 +78,7 @@
     <ClCompile>
       <Optimization>Disabled</Optimization>
       <AdditionalIncludeDirectories>../../includes;../../../localization/includes;../../../core/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../../libs/intl;../../../../java/jdk/include;../../../../java/jdk/include/win32;..\..\..\functions_manager\includes;..\..\..\types\includes;..\..\..\symbol\includes;..\..\..\ast\includes;../../../system_env/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;LIBJVM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;LIBJVM_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
     </ClCompile>
     <ClCompile>
       <Optimization>Disabled</Optimization>
       <AdditionalIncludeDirectories>../../includes;../../../localization/includes;../../../core/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../../libs/intl;../../../../java/jdk/include;../../../../java/jdk/include/win32;..\..\..\functions_manager\includes;..\..\..\types\includes;..\..\..\symbol\includes;..\..\..\ast\includes;../../../system_env/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;LIBJVM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;LIBJVM_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
     </ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
       <AdditionalIncludeDirectories>../../includes;../../../localization/includes;../../../core/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../../libs/intl;../../../../java/jdk/include;../../../../java/jdk/include/win32;..\..\..\functions_manager\includes;..\..\..\types\includes;..\..\..\symbol\includes;..\..\..\ast\includes;../../../system_env/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;LIBJVM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;LIBJVM_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
       <AdditionalIncludeDirectories>../../includes;../../../localization/includes;../../../core/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../../libs/intl;../../../../java/jdk/include;../../../../java/jdk/include/win32;..\..\..\functions_manager\includes;..\..\..\types\includes;..\..\..\symbol\includes;..\..\..\ast\includes;../../../system_env/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;LIBJVM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;LIBJVM_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
   <ItemGroup>
     <None Include="nolibjvm_export.def" />
   </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\includes\jvm_gw.hxx" />
+  </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
index 0a8a56e..efccf60 100644 (file)
@@ -38,4 +38,9 @@
       <Filter>Libraries Dependencies\Exports</Filter>
     </None>
   </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\includes\jvm_gw.hxx">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
 </Project>
\ No newline at end of file
index a225501..00e8381 100644 (file)
@@ -1,28 +1,28 @@
 /*
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) DIGITEO - 2009 - Allan CORNET
-* 
+*
 * This file must be used under the terms of the CeCILL.
 * This source file is licensed as described in the file COPYING, which
 * you should have received as part of this distribution.  The terms
-* are also available at    
+* are also available at
 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 *
 */
 
-/*--------------------------------------------------------------------------*/ 
+/*--------------------------------------------------------------------------*/
 #ifndef __DYNLIB_LINEAR_ALGEBRA_GW_H__
 #define __DYNLIB_LINEAR_ALGEBRA_GW_H__
 
 #ifdef _MSC_VER
-#ifdef LINEAR_ALGEBRA_EXPORTS_GW
+#ifdef LINEAR_ALGEBRA_GW_EXPORTS
 #define LINEAR_ALGEBRA_GW_IMPEXP __declspec(dllexport)
 #else
 #define LINEAR_ALGEBRA_GW_IMPEXP __declspec(dllimport)
 #endif
 #else
-#define LINEAR_ALGEBRA_GW_IMPEXP 
+#define LINEAR_ALGEBRA_GW_IMPEXP
 #endif
 
 #endif /* __DYNLIB_HISTORY_MANAGER_GW_H__ */
-/*--------------------------------------------------------------------------*/ 
+/*--------------------------------------------------------------------------*/
index 126a9ed..00c10d3 100644 (file)
 #include "gw_linear_algebra.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
-static int C2F(intvoid)(char *fname, unsigned long fname_len)
-{
-       return 0;
-}
-/*--------------------------------------------------------------------------*/
-#define LINEAR_ALGEBRA_TAB_SIZE 6
-static gw_generic_table Tab[LINEAR_ALGEBRA_TAB_SIZE]={
-  {NULL, ""}, //hess
-  {NULL, ""}, //schur
-  {NULL, ""}, //spec
-  {NULL, ""}, //bdiag
-  {NULL,""}, //xxxx
-  {NULL, ""} //balanc
-};
-/*--------------------------------------------------------------------------*/
 int gw_linear_algebra(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index 2d91af3..4285aeb 100644 (file)
 #include "api_scilab.h"
 #include "MALLOC.h"
 /*--------------------------------------------------------------------------*/
-#define LINEAR_ALGEBRA2_TAB_SIZE 15
-static gw_generic_table Tab[LINEAR_ALGEBRA2_TAB_SIZE]={
-       {NULL, ""}, //qr
-       {NULL, ""}, //svd
-       {NULL, ""}, //lsq
-       {NULL, ""}, //spec
-       {NULL, ""}, //inv
-       {NULL, ""}, //rcond
-       {NULL, ""}, //chol
-       {NULL, ""}, //lu
-       {NULL, ""}, //slash
-       {NULL, ""}, //backslash
-       {NULL, ""}, //schur
-       {NULL, ""}, //hess
-       {NULL, ""}, //det
-       {NULL, ""} //balanc
-};
-/*--------------------------------------------------------------------------*/
 int gw_linear_algebra2(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index 383cae0..4acf1bc 100644 (file)
     <ClCompile Include="sci_svd.cpp" />
   </ItemGroup>
   <ItemGroup>
+    <ClInclude Include="..\..\includes\dynlib_linear_algebra_gw.h" />
     <ClInclude Include="..\..\includes\linear_algebra_gw.hxx" />
   </ItemGroup>
   <ItemGroup>
index a920da6..26c5917 100644 (file)
@@ -68,6 +68,9 @@
     <ClInclude Include="..\..\includes\linear_algebra_gw.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\includes\dynlib_linear_algebra_gw.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <Library Include="..\..\..\..\bin\libintl.lib" />
index 5dd4a2e..b3b14ec 100644 (file)
 #include "callFunctionFromGateway.h"
 
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[]=
-{
-       {NULL, ""}, // setlanguage
-       {NULL, ""}, // getlanguage
-       {NULL, ""}, // getdefaultlanguage
-       {NULL, ""}, //gettext
-       {NULL, ""}, //dgettext
-       {NULL, ""} //setdefaultlanguage
-};
-/*--------------------------------------------------------------------------*/
 int gw_localization(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index bff1eaf..1326efa 100644 (file)
@@ -1,30 +1,31 @@
 /*
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2008 - INRIA - Vincent COUVERT 
+ * Copyright (C) 2008 - INRIA - Vincent COUVERT
  * Copyright (C) 2010 - DIGITEO - Bruno JOFRET
- * 
+ *
  * This file must be used under the terms of the CeCILL.
  * This source file is licensed as described in the file COPYING, which
  * you should have received as part of this distribution.  The terms
- * are also available at    
+ * are also available at
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  */
 
-/*-----------------------------------------------------------------------------------*/ 
+/*-----------------------------------------------------------------------------------*/
 #include "dynlib_matio.h"
-/*-----------------------------------------------------------------------------------*/ 
+#include "dynlib_matio_gw.h"
+/*-----------------------------------------------------------------------------------*/
 #ifndef __GW_MATIO_H__
 #define __GW_MATIO_H__
 /*-----------------------------------------------------------------------------------*/
 MATIO_IMPEXP int gw_matio(void);
+
 /*-----------------------------------------------------------------------------------*/
-/* interface for the previous function Table */ 
-/*-----------------------------------------------------------------------------------*/ 
-MATIO_IMPEXP int sci_matfile_open(char* fname, void* pvApiCtx);
-MATIO_IMPEXP int sci_matfile_close(char* fname, void* pvApiCtx);
-MATIO_IMPEXP int sci_matfile_listvar(char* fname, void* pvApiCtx);
-MATIO_IMPEXP int sci_matfile_varreadnext(char* fname, void* pvApiCtx);
-MATIO_IMPEXP int sci_matfile_varwrite(char* fname, void* pvApiCtx);
+/* interface for the previous function Table */
 /*-----------------------------------------------------------------------------------*/
+MATIO_GW_IMPEXP int sci_matfile_open(char* fname, void* pvApiCtx);
+MATIO_GW_IMPEXP int sci_matfile_close(char* fname, void* pvApiCtx);
+MATIO_GW_IMPEXP int sci_matfile_listvar(char* fname, void* pvApiCtx);
+MATIO_GW_IMPEXP int sci_matfile_varreadnext(char* fname, void* pvApiCtx);
+MATIO_GW_IMPEXP int sci_matfile_varwrite(char* fname, void* pvApiCtx);
 #endif /* __GW_MATIO_H__ */
index 9b59191..86cd55a 100644 (file)
@@ -20,10 +20,4 @@ extern "C"
 #include "dynlib_matio_gw.h"
 }
 
-//CPP_GATEWAY_PROTOTYPE_EXPORT(sci_matfile_open, MATIO_GW_IMPEXP);
-//CPP_GATEWAY_PROTOTYPE_EXPORT(sci_matfile_close, MATIO_GW_IMPEXP);
-//CPP_GATEWAY_PROTOTYPE_EXPORT(sci_matfile_listvar, MATIO_GW_IMPEXP);
-//CPP_GATEWAY_PROTOTYPE_EXPORT(sci_matfile_varreadnext, MATIO_GW_IMPEXP);
-//CPP_GATEWAY_PROTOTYPE_EXPORT(sci_matfile_varwrite, MATIO_GW_IMPEXP);
-
 #endif /* __MATIO_GW_HXX__ */
index 696202d..886b58b 100644 (file)
 #include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*-----------------------------------------------------------------------------------*/
-int gw_matio(void);
-/*-----------------------------------------------------------------------------------*/
-static gw_generic_table Tab[] =
-{
-  {NULL,""},
-  {NULL,""},
-  {NULL,""},
-  {NULL,""},
-  {NULL,""}
-};
-/*-----------------------------------------------------------------------------------*/
 int gw_matio(void)
 {
-       return 0;
+    return 0;
 }
 /*-----------------------------------------------------------------------------------*/
 
index cc2df28..6245e3d 100644 (file)
@@ -17,6 +17,7 @@
 #include "gw_matio.h"
 #include "localization.h"
 #include "Scierror.h"
+#include <string.h>
 
 /*******************************************************************************
    Interface for MATIO function called Mat_Open
index a76a076..d66fc4f 100644 (file)
 
 void vFreeDoubleComplexFromPointer(doublecomplex *_poComplex)
 {
-       if(_poComplex != NULL)
-               free(_poComplex);
+    if (_poComplex != NULL)
+    {
+        free(_poComplex);
+    }
 }
 
 /*
@@ -28,26 +30,26 @@ Arguments
 */
 void vGetPointerFromDoubleComplex(const doublecomplex *_poComplex, int _iSize, double *_pdblReal, double *_pdblImg)
 {
-       int iIndex = 0;
+    int iIndex = 0;
 
-       int iTwo        = 2;
-       int iOne        = 1;
-       double *pReal = &_poComplex[0].r;
-       double *pImg = &_poComplex[0].i;
+    int iTwo   = 2;
+    int iOne   = 1;
+    double *pReal = (double*)&_poComplex[0].r;
+    double *pImg = (double*)&_poComplex[0].i;
 
-       if(_pdblReal != NULL && _pdblImg != NULL)
-       {
-               C2F(dcopy)(&_iSize, pReal, &iTwo, _pdblReal, &iOne);
-               C2F(dcopy)(&_iSize, pImg, &iTwo, _pdblImg, &iOne);
-       }
-       else if(_pdblReal != NULL && _pdblImg == NULL)
-       {
-               C2F(dcopy)(&_iSize, pReal, &iTwo, _pdblReal, &iOne);
-       }
-       else if(_pdblReal == NULL && _pdblImg != NULL)
-       {
-               C2F(dcopy)(&_iSize, pImg, &iTwo, _pdblImg, &iOne);
-       }
+    if (_pdblReal != NULL && _pdblImg != NULL)
+    {
+        C2F(dcopy)(&_iSize, pReal, &iTwo, _pdblReal, &iOne);
+        C2F(dcopy)(&_iSize, pImg, &iTwo, _pdblImg, &iOne);
+    }
+    else if (_pdblReal != NULL && _pdblImg == NULL)
+    {
+        C2F(dcopy)(&_iSize, pReal, &iTwo, _pdblReal, &iOne);
+    }
+    else if (_pdblReal == NULL && _pdblImg != NULL)
+    {
+        C2F(dcopy)(&_iSize, pImg, &iTwo, _pdblImg, &iOne);
+    }
 }
 /*
 oGetDoubleComplexFromPointer --
@@ -64,35 +66,35 @@ Arguments
 */
 doublecomplex* oGetDoubleComplexFromPointer(double *_pdblReal, double *_pdblImg, int _iSize)
 {
-       int iIndex = 0;
-       doublecomplex *poComplex = (doublecomplex*)malloc(sizeof(doublecomplex) * _iSize);
-       int iTwo        = 2;
-       int iOne        = 1;
-       double *pReal = &poComplex[0].r;
-       double *pImg = &poComplex[0].i;
+    int iIndex = 0;
+    doublecomplex *poComplex = (doublecomplex*)malloc(sizeof(doublecomplex) * _iSize);
+    int iTwo   = 2;
+    int iOne   = 1;
+    double *pReal = &poComplex[0].r;
+    double *pImg = &poComplex[0].i;
 
-       if(_pdblReal != NULL && _pdblImg != NULL)
-       {
+    if (_pdblReal != NULL && _pdblImg != NULL)
+    {
 
-               C2F(dcopy)(&_iSize, _pdblReal, &iOne, pReal, &iTwo);
-               C2F(dcopy)(&_iSize, _pdblImg, &iOne, pImg, &iTwo);
-       }
-       else if(_pdblReal != NULL && _pdblImg == NULL)
-       {
-               double ZERO = 0.;
-               C2F(dcopy)(&_iSize, _pdblReal, &iOne, pReal, &iTwo);
-               C2F(dset)(&_iSize, &ZERO, pImg, &iTwo);
-       }
-       else if(_pdblReal == NULL && _pdblImg != NULL)
-       {
-               double ZERO = 0.;
-               C2F(dset)(&_iSize, &ZERO, pReal, &iTwo);
-               C2F(dcopy)(&_iSize, _pdblImg, &iOne, pImg, &iTwo);
-       }
-       else
-       {
-               free(poComplex);
-               return NULL;
-       }
-       return poComplex;
+        C2F(dcopy)(&_iSize, _pdblReal, &iOne, pReal, &iTwo);
+        C2F(dcopy)(&_iSize, _pdblImg, &iOne, pImg, &iTwo);
+    }
+    else if (_pdblReal != NULL && _pdblImg == NULL)
+    {
+        double ZERO = 0.;
+        C2F(dcopy)(&_iSize, _pdblReal, &iOne, pReal, &iTwo);
+        C2F(dset)(&_iSize, &ZERO, pImg, &iTwo);
+    }
+    else if (_pdblReal == NULL && _pdblImg != NULL)
+    {
+        double ZERO = 0.;
+        C2F(dset)(&_iSize, &ZERO, pReal, &iTwo);
+        C2F(dcopy)(&_iSize, _pdblImg, &iOne, pImg, &iTwo);
+    }
+    else
+    {
+        free(poComplex);
+        return NULL;
+    }
+    return poComplex;
 }
index 12e4a15..6090db9 100644 (file)
@@ -442,7 +442,7 @@ int iRightDivisionOfComplexMatrix(
 
     dblEps             = F2C(dlamch)("eps", 1L);
     cNorm              = '1';
-    dblAnorm   = C2F(zlange)(&cNorm, &_iRows2, &_iCols2, poVar2, &_iRows2, poDwork);
+    dblAnorm   = C2F(zlange)(&cNorm, &_iRows2, &_iCols2, (double*)poVar2, &_iRows2, (double*)poDwork);
 
     //tranpose A and B
 
@@ -467,8 +467,8 @@ int iRightDivisionOfComplexMatrix(
     if (_iRows2 == _iCols2)
     {
         cNorm          = 'F';
-        C2F(zlacpy)(&cNorm, &_iCols2, &_iCols2, poAt, &_iCols2, poAf, &_iCols2);
-        C2F(zgetrf)(&_iCols2, &_iCols2, poAf, &_iCols2, pIpiv, &iInfo);
+        C2F(zlacpy)(&cNorm, &_iCols2, &_iCols2, (double*)poAt, &_iCols2, (double*)poAf, &_iCols2);
+        C2F(zgetrf)(&_iCols2, &_iCols2, (double*)poAf, &_iCols2, pIpiv, &iInfo);
         if (iInfo == 0)
         {
             cNorm = '1';
@@ -476,7 +476,7 @@ int iRightDivisionOfComplexMatrix(
             if (dblRcond > dsqrts(dblEps))
             {
                 cNorm  = 'N';
-                C2F(zgetrs)(&cNorm, &_iCols2, &_iRows1, poAf, &_iCols2, pIpiv, poBt, &_iCols2, &iInfo);
+                C2F(zgetrs)(&cNorm, &_iCols2, &_iRows1, (double*)poAf, &_iCols2, pIpiv, (double*)poBt, &_iCols2, &iInfo);
                 vTransposeDoubleComplexMatrix(poBt, _iCols2, _iRows2, poOut, 1);
                 vGetPointerFromDoubleComplex(poOut, _iRowsOut * _iColsOut, _pdblRealOut, _pdblImgOut);
                 iExit = 1;
@@ -723,14 +723,14 @@ int       iLeftDivisionOfComplexMatrix(
     cNorm              = '1';
     pDwork             = (doublecomplex*)malloc(sizeof(doublecomplex) * iWorkMin);
     dblEps             = F2C(dlamch)("eps", 1L);
-    dblAnorm   = C2F(zlange)(&cNorm, &_iRows1, &_iCols1, poVar1, &_iRows1, pDwork);
+    dblAnorm   = C2F(zlange)(&cNorm, &_iRows1, &_iCols1, (double*)poVar1, &_iRows1, (double*)pDwork);
 
     if (_iRows1 == _iCols1)
     {
         cNorm          = 'F';
-        C2F(zlacpy)(&cNorm, &_iCols1, &_iCols1,        poVar1, &_iCols1, pAf, &_iCols1);
-        C2F(zlacpy)(&cNorm, &_iCols1, &_iCols2,        poVar2, &_iCols1, pXb, &_iCols1);
-        C2F(zgetrf)(&_iCols1, &_iCols1, pAf, &_iCols1, pIpiv, &iInfo);
+        C2F(zlacpy)(&cNorm, &_iCols1, &_iCols1,        (double*)poVar1, &_iCols1, (double*)pAf, &_iCols1);
+        C2F(zlacpy)(&cNorm, &_iCols1, &_iCols2,        (double*)poVar2, &_iCols1, (double*)pXb, &_iCols1);
+        C2F(zgetrf)(&_iCols1, &_iCols1, (double*)pAf, &_iCols1, pIpiv, &iInfo);
         if (iInfo == 0)
         {
             cNorm = '1';
@@ -738,9 +738,9 @@ int iLeftDivisionOfComplexMatrix(
             if (dblRcond > dsqrts(dblEps))
             {
                 cNorm  = 'N';
-                C2F(zgetrs)(&cNorm, &_iCols1, &_iCols2, pAf, &_iCols1, pIpiv, pXb, &_iCols1, &iInfo);
+                C2F(zgetrs)(&cNorm, &_iCols1, &_iCols2, (double*)pAf, &_iCols1, pIpiv, (double*)pXb, &_iCols1, &iInfo);
                 cNorm  = 'F';
-                C2F(zlacpy)(&cNorm, &_iCols1, &_iCols2, pXb, &_iCols1, poOut, &_iCols1);
+                C2F(zlacpy)(&cNorm, &_iCols1, &_iCols2, (double*)pXb, &_iCols1, (double*)poOut, &_iCols1);
                 vGetPointerFromDoubleComplex(poOut, _iRowsOut * _iColsOut, _pdblRealOut, _pdblImgOut);
                 iExit = 1;
             }
@@ -758,7 +758,7 @@ int iLeftDivisionOfComplexMatrix(
         dblRcond = dsqrts(dblEps);
         cNorm = 'F';
         iMax = Max(_iRows1, _iCols1);
-        C2F(zlacpy)(&cNorm, &_iRows1, &_iCols2, poVar2, &_iRows1, pXb, &iMax);
+        C2F(zlacpy)(&cNorm, &_iRows1, &_iCols2, (double*)poVar2, &_iRows1, (double*)pXb, &iMax);
         memset(pJpvt, 0x00, sizeof(int) * _iCols1);
         C2F(zgelsy1)(  &_iRows1, &_iCols1, &_iCols2, poVar1, &_iRows1, pXb, &iMax,
                         pJpvt, &dblRcond, &pRank[0], pDwork, &iWorkMin, pRwork, &iInfo);
@@ -773,7 +773,7 @@ int iLeftDivisionOfComplexMatrix(
             }
 
             cNorm = 'F';
-            C2F(zlacpy)(&cNorm, &_iCols1, &_iCols2, pXb, &iMax, poOut, &_iCols1);
+            C2F(zlacpy)(&cNorm, &_iCols1, &_iCols2, (double*)pXb, &iMax, (double*)poOut, &_iCols1);
             vGetPointerFromDoubleComplex(poOut, _iRowsOut * _iColsOut, _pdblRealOut, _pdblImgOut);
         }
     }
index 7018522..19e6af9 100644 (file)
 #include "callFunctionFromGateway.h"
 #include "recursionFunction.h"
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[]=
-{ 
-       {NULL, ""}, //print
-       {NULL, ""}, //mprintf
-       {NULL, ""}, //msprintf
-       {NULL, ""}, //disp
-       {NULL, ""} //diary
-};
-/*--------------------------------------------------------------------------*/
 int gw_output_stream(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index dad34ac..6f53967 100644 (file)
@@ -11,7 +11,7 @@
  */
 /*--------------------------------------------------------------------------*/
 #ifdef _MSC_VER
-#if POLYNOMIALS_GW_EXPORTS
+#if POLYNOMIALS_EXPORTS
 #define EXTERN_POLYNOMIALS_GW __declspec (dllexport)
 #else
 #define EXTERN_POLYNOMIALS_GW __declspec (dllimport)
index 712cae1..d1f6b50 100644 (file)
@@ -209,6 +209,7 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\includes\dynlib_polynomials.h" />
+    <ClInclude Include="..\..\includes\dynlib_polynomials_gw.h" />
     <ClInclude Include="..\..\includes\polynomials_gw.hxx" />
   </ItemGroup>
   <ItemGroup>
index 38040c5..a7fce74 100644 (file)
@@ -67,6 +67,9 @@
     <ClInclude Include="..\..\includes\polynomials_gw.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\includes\dynlib_polynomials_gw.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="core_import.def">
index 4523dfe..27fc069 100644 (file)
@@ -274,10 +274,6 @@ lib /DEF:"$(ProjectDir)graphics_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platfo
     <Library Include="..\..\bin\libjvm.lib" />
   </ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\..\libs\doublylinkedlist\doublylinkedlist.vcxproj">
-      <Project>{ed02137f-0a4f-4ef0-ac58-97ace37fa89d}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-    </ProjectReference>
     <ProjectReference Include="..\..\tools\Dumpexts\Dumpexts.vcxproj">
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 8d4e438..00f9a76 100644 (file)
 #include "api_scilab.h"
 #include "MALLOC.h"
 #include "callFunctionFromGateway.h"
-
-
-/*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[] =
-{
-       {sci_var2vec,"var2vec"},
-       {sci_vec2var,"vec2var"},
-       {sci_getblocklabel,"getblocklabel"},
-       {sci_scicos_debug,"scicos_debug"},
-       {sci_scicos_debug_count,"scicos_debug_count"},
-       {sci_sctree,"sctree"},
-       {sci_ftree2,"sci_tree2"},
-       {sci_ftree3,"sci_tree3"},
-       {sci_ftree4,"sci_tree4"},
-       {sci_curblock,"curblock"},
-       {sci_scicos_time,"scicos_time"},
-       {sci_duplicate,"duplicate"},
-       {sci_diffobjs,"diffobjs"},
-       {sci_pointer_xproperty,"pointer_xproperty"},
-       {sci_phase_simulation,"phase_simulation"},
-       {sci_set_xproperty,"set_xproperty"},
-       {sci_set_blockerror,"set_blockerror"},
-       {sci_ctree2,"ctree2"},
-       {sci_ctree3,"ctree3"},
-       {sci_ctree4,"ctree4"},
-       {sci_scicosim,"scicosim"},
-       {sci_getscicosvars,"getscicosvars"},
-       {sci_curblockc,"curblockc"},
-       {sci_buildouttb,"buildouttb"},
-       {sci_end_scicosim,"end_scicosim"},
-       {sci_coserror, "coserror"},
-       {sci_haltscicos, "sci_haltscicos"},
-       {sci_data2sig,"data2sig"},
-       {sci_sig2data,"sig2data"},
-       {sci_model2blk,"model2blk"},
-       {sci_callblk,"callblk"},
-       {sci_loadScicos,"loadScicos"}
-};
 /*--------------------------------------------------------------------------*/
 int gw_scicos(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
 
index f7333d6..4640ea8 100644 (file)
@@ -253,7 +253,8 @@ int sci_model2blk(char *fname, unsigned long fname_len)
     else
     {
         lfunpt -= (ntabsim + 1);
-        GetDynFunc(lfunpt, &Block.funpt);
+        //TODO: see in dynamic_lin how to get funcptr from index
+        //GetDynFunc(lfunpt, &Block.funpt);
         if (Block.funpt == (voidf) 0)
         {
             Scierror(888, _("%s : Function not found\n"), fname);
index 1c6ed8a..1454511 100644 (file)
@@ -544,7 +544,6 @@ static char *getAxe(char const* pFigureUID, scicos_block * block)
 static char *getPolyline(char *pAxeUID, scicos_block * block, int row)
 {
     char *pPolyline;
-    static double d__0 = 0.0;
     static BOOL b__true = TRUE;
 
     int color;
index 94dd75d..bf0a940 100644 (file)
 #include "callFunctionFromGateway.h"
 #include "BOOL.h"
 /*--------------------------------------------------------------------------*/
-static BOOL loadedDep = FALSE;
-/*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[]=
-{
-    {NULL, ""}, //"editor"
-    {NULL, ""} // "closeEditor"
-};
-/*--------------------------------------------------------------------------*/
 int gw_scinotes(void)
 {
     return 0;
index 5bc75af..c5cde52 100644 (file)
 #include "callFunctionFromGateway.h"
 #include <stdlib.h>
 
-#define GWTABLE_LENGTH(t) (sizeof(Tab) / sizeof(gw_generic_table))
-
-static gw_generic_table Tab[] = {
-    {NULL, ""}, /* placeholder */
-    {NULL, ""}, //fft
-    {NULL, ""}, /* placeholder */
-    {NULL, ""}, //corr
-    {NULL, ""}, //rpem
-    {NULL, ""}, //amell
-    {NULL, ""}, //delip
-    {NULL, ""}, //remez
-    {NULL, ""},  //syredi
-    {NULL, ""} // conv2
-};
-
 int gw_signal_processing(void)
 {
-  return 0;
+    return 0;
 
 }
index 0152b6a..672f5f4 100644 (file)
@@ -1,11 +1,11 @@
 /*
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Allan CORNET 
- * 
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
  * This file must be used under the terms of the CeCILL.
  * This source file is licensed as described in the file COPYING, which
  * you should have received as part of this distribution.  The terms
- * are also available at    
+ * are also available at
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  */
 #include "MALLOC.h"
 #include "api_scilab.h"
 #include "callFunctionFromGateway.h"
-/*--------------------------------------------------------------------------*/ 
-static gw_generic_table Tab[] = 
-{
-       {NULL, ""}, //PlaySound
-       {NULL, ""}  //beep
-};
-/*--------------------------------------------------------------------------*/ 
+/*--------------------------------------------------------------------------*/
 int gw_sound(void)
-{  
-       return 0;
+{
+    return 0;
 }
-/*--------------------------------------------------------------------------*/ 
+/*--------------------------------------------------------------------------*/
index 7856295..f1211bc 100644 (file)
 #include "api_scilab.h"
 #include "MALLOC.h"
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[]=
-{
-       {NULL, ""}, //sparse
-       {NULL, ""}, //spget
-       {NULL, ""}, //full
-       {sci_lufact,"lufact"},
-       {sci_lusolve,"lusolve"},
-       {sci_ludel,"ludel"},
-       {sci_luget,"luget"},
-       {sci_spclean,"spclean"},
-       {NULL, ""}, //nnz
-       {NULL, ""}, //spmax
-       {NULL, ""}, //spmin
-       {sci_spmatrix,"spmatrix"},
-       {sci_spchol,"spchol"},
-       {sci_fadj2sp,"fadj2sp"},
-       {NULL, ""}, //spcompa
-       {sci_ordmmd,"ordmmd"},
-       {sci_blkfc1i,"blkfc1i"},
-       {sci_blkslvi,"blkslvi"},
-       {sci_inpnvi,"inpnvi"},
-       {sci_sfinit,"sfinit"},
-       {sci_symfcti,"symfcti"},
-       {sci_bfinit,"bfinit"},
-       {NULL, ""}, //msparse
-       {NULL, ""}, //mspget
-       {NULL, ""}, //mfull
-       {C2F(scita2lpd),"ta2lpd"}
-};
-/*--------------------------------------------------------------------------*/
 int gw_sparse(void)
 {
     return 0;
index 3822f7f..8fa89a4 100644 (file)
@@ -26,7 +26,7 @@ using namespace std;
 
 namespace
 {
-size_t nonZeros(types::Double CONST& d)
+size_t nonZeros(types::Double SPARSE_CONST& d)
 {
     size_t res = 0;
     size_t n = d.getSize();
index 4d143b0..6967401 100644 (file)
@@ -45,7 +45,7 @@ Function::ReturnValue sci_sp2adj(typed_list &in, int nbRes, typed_list &out)
         return Function::Error;
     }
 
-    Sparse* CONST sp = in[0]->getAs<Sparse>();
+    Sparse* SPARSE_CONST sp = in[0]->getAs<Sparse>();
     std::size_t const nonZeros = sp->nonZeros();
 
     types::Double* res = new Double(sp->getCols() + 1, 1);
index 0e07805..eb3375b 100644 (file)
@@ -26,7 +26,7 @@ using namespace types;
 namespace
 {
 template<typename DenseType>
-GenericType* buildSparse(Double CONST& indices, DenseType CONST& vals, Double CONST* pDim)
+GenericType* buildSparse(Double SPARSE_CONST& indices, DenseType SPARSE_CONST& vals, Double SPARSE_CONST* pDim)
 {
     GenericType* pRes = NULL;
     InternalType* pVals = (InternalType*)&vals;
index 97531ed..3a14fc6 100644 (file)
 #include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[] =
-{
-    {NULL, ""}, // "xls_open"
-    {NULL, ""}, // "xls_read"
-    {NULL, ""}, // "csvDefault"
-    {NULL, ""}, // "csvRead"
-    {NULL, ""}, // "csvStringToDouble"
-    {NULL, ""}, // "csvTextScan"
-    {NULL, ""}, // "csvWrite"
-    {NULL, ""}, // "write_csv"
-    {NULL, ""} // "read_csv"
-};
-/*--------------------------------------------------------------------------*/
 int gw_spreadsheet(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index 46c6596..7e7386d 100644 (file)
@@ -26,6 +26,7 @@
 #include "splitLine.h"
 #include "os_strdup.h"
 #include "csvDefault.h"
+#include "strsubst.h"
 // =============================================================================
 #if _MSC_VER
 #define READ_ONLY_TEXT_MODE "rt"
@@ -56,7 +57,8 @@ csvResult* csvRead(const char *filename, const char *separator, const char *deci
     double res = 0.0;
     int errMOPEN = MOPEN_INVALID_STATUS;
     int errMGETL = MGETL_ERROR;
-    char **lines = NULL;
+    wchar_t **pwstLines = NULL;
+    char **pstLines = NULL;
     int nblines = 0;
     char **replacedInLines = NULL;
     char **pComments = NULL;
@@ -114,13 +116,15 @@ csvResult* csvRead(const char *filename, const char *separator, const char *deci
         return result;
     }
 
-    lines = mgetl(fd, -1, &nblines, &errMGETL);
+    pwstLines = mgetl(fd, -1, &nblines, &errMGETL);
+    pstLines = (char**)MALLOC(sizeof(char*) * nblines);
 
     {
         int i = 0;
         for (i = 0 ; i < nblines ; i++)
         {
-            printf("mgetl %s\n", lines[i]);
+            pstLines[i] = wide_string_to_UTF8(pwstLines[i]);
+            printf("mgetl %s\n", pstLines[i]);
         }
 
     }
@@ -129,10 +133,10 @@ csvResult* csvRead(const char *filename, const char *separator, const char *deci
 
     if (errMGETL != MGETL_NO_ERROR)
     {
-        if (lines)
+        if (pwstLines)
         {
-            freeArrayOfString(lines, nblines);
-            lines = NULL;
+            freeArrayOfWideString(pwstLines, nblines);
+            pwstLines = NULL;
         }
 
         result = (csvResult*)(MALLOC(sizeof(csvResult)));
@@ -152,7 +156,7 @@ csvResult* csvRead(const char *filename, const char *separator, const char *deci
     {
         int iErr = 0;
 
-        pComments = extractComments((const char**)lines, nblines, regexpcomments, &nbComments, &iErr);
+        pComments = extractComments((const char**)pstLines, nblines, regexpcomments, &nbComments, &iErr);
 
         if ((iErr == CAN_NOT_COMPILE_PATTERN) || (iErr == DELIMITER_NOT_ALPHANUMERIC))
         {
@@ -179,11 +183,12 @@ csvResult* csvRead(const char *filename, const char *separator, const char *deci
             int nbCleanedLines = 0;
             int i = 0;
 
-            pCleanedLines = removeComments((const char**)lines, nblines, (const char*)regexpcomments, &nbCleanedLines, &iErr);
+            pCleanedLines = removeComments((const char**)pstLines, nblines, (const char*)regexpcomments, &nbCleanedLines, &iErr);
             if (pCleanedLines)
             {
-                FREE(lines);
-                lines = pCleanedLines;
+                FREE(pwstLines);
+                FREE(pstLines);
+                pstLines = pCleanedLines;
                 nblines = nbCleanedLines;
             }
 
@@ -192,11 +197,11 @@ csvResult* csvRead(const char *filename, const char *separator, const char *deci
 
     if (toreplace && (sizetoreplace > 0))
     {
-        replacedInLines = replaceStrings((const char**)lines, nblines, toreplace, sizetoreplace);
+        replacedInLines = replaceStrings((const char**)pstLines, nblines, toreplace, sizetoreplace);
         if (replacedInLines)
         {
-            freeArrayOfString(lines, nblines);
-            lines = replacedInLines;
+            freeArrayOfString(pstLines, nblines);
+            pstLines = replacedInLines;
         }
     }
 
@@ -204,15 +209,21 @@ csvResult* csvRead(const char *filename, const char *separator, const char *deci
         int i = 0;
         for (i = 0 ; i < nblines ; i++)
         {
-            printf("csvtextscan %s\n", lines[i]);
+            printf("csvtextscan %s\n", pstLines[i]);
         }
 
     }
-    result = csvTextScan((const char**)lines, nblines, (const char*)separator, (const char*)decimal);
-    if (lines)
+    result = csvTextScan((const char**)pstLines, nblines, (const char*)separator, (const char*)decimal);
+    if (pstLines)
+    {
+        freeArrayOfString(pstLines, nblines);
+        pstLines = NULL;
+    }
+
+    if (pwstLines)
     {
-        freeArrayOfString(lines, nblines);
-        lines = NULL;
+        freeArrayOfWideString(pwstLines, nblines);
+        pwstLines = NULL;
     }
 
     if (result)
index f53c39b..53a419d 100644 (file)
@@ -26,6 +26,7 @@
 #include "core_math.h"
 #include "csvDefault.h"
 #include "utftolatin.h"
+#include "strsubst.h"
 // =============================================================================
 #define DEFAULT_CSV_WRITE_STRING_FORMAT "%s"
 #define DEFAULT_CSV_WRITE_DOUBLE_FORMAT "%.lg"
index febfea5..ca9ab55 100644 (file)
@@ -85,13 +85,19 @@ void xls_read(int *fd, int *cur_pos, double **data, int **chainesind, int *N, in
     *err = 0;
 
     *cur_pos = *cur_pos;
-    err = mseek(*fd, *cur_pos, SEEK_SET);
-    if (*err > 0) goto ErrL;
+    *err = mseek(*fd, *cur_pos, SEEK_SET);
+    if (*err > 0)
+    {
+        goto ErrL;
+    }
 
     /* first record should be a BOF */
     getBOF(fd , BOFData, err);
 
-    if (*err > 0) return;
+    if (*err > 0)
+    {
+        return;
+    }
     if (BOFData[0] < 0) /* not a BOF */
     {
         *err = 2;
@@ -104,18 +110,30 @@ void xls_read(int *fd, int *cur_pos, double **data, int **chainesind, int *N, in
     }
 
     pos = mtell(*fd);
-    if (*err > 0) goto ErrL;
+    if (*err > 0)
+    {
+        goto ErrL;
+    }
     *cur_pos = (int)pos;
 
     while (1)
     {
-        err = mseek(*fd, *cur_pos, SEEK_SET);
-        if (*err > 0) goto ErrL;
+        *err = mseek(*fd, *cur_pos, SEEK_SET);
+        if (*err > 0)
+        {
+            goto ErrL;
+        }
         /*Enregistrement de l'Opcode et de la Len du tag*/
         C2F(mgetnc) (fd, &Opcode, &one, typ_ushort, err);
-        if (*err > 0) goto ErrL;
+        if (*err > 0)
+        {
+            goto ErrL;
+        }
         C2F(mgetnc) (fd, &Len, &one, typ_ushort, err);
-        if (*err > 0) goto ErrL;
+        if (*err > 0)
+        {
+            goto ErrL;
+        }
         switch (Opcode)
         {
             case 10:/*EOF */
@@ -126,9 +144,15 @@ void xls_read(int *fd, int *cur_pos, double **data, int **chainesind, int *N, in
                 return;
             case 638: /*RK*/
                 C2F(mgetnc) (fd, (void*)&row, &one, typ_ushort, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 C2F(mgetnc) (fd, (void*)&col, &one, typ_ushort, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 // Check col and row are in bounds
                 if ((col >= longueur) || (row >= hauteur))
                 {
@@ -136,16 +160,28 @@ void xls_read(int *fd, int *cur_pos, double **data, int **chainesind, int *N, in
                     goto ErrL;
                 }
                 C2F(mgetnc) (fd, (void*)&xf , &one, typ_ushort, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 C2F(mgetnc) (fd, (void*) &rkvalue , &one, typ_int, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 valeur[col * (hauteur) + row] = NumFromRk2(rkvalue);
                 break;
             case 515: /*Number*/
                 C2F(mgetnc) (fd, (void*)&row, &one, typ_ushort, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 C2F(mgetnc) (fd, (void*)&col, &one, typ_ushort, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 // Check col and row are in bounds
                 if ((col >= longueur) || (row >= hauteur))
                 {
@@ -153,17 +189,29 @@ void xls_read(int *fd, int *cur_pos, double **data, int **chainesind, int *N, in
                     goto ErrL;
                 }
                 C2F(mgetnc) (fd, (void*)&xf , &one, typ_ushort, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 C2F(mgetnc) (fd, (void*) &resultat , &one, typ_double, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 valeur[col * (hauteur) + row] = resultat ;
                 break;
 
             case 189: /*MULRK*/
                 C2F(mgetnc) (fd, (void*)&row, &one, typ_ushort, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 C2F(mgetnc) (fd,  (void*)&colFirst, &one, typ_short, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 // Check col and row are in bounds
                 if ((colFirst >= longueur) || (row >= hauteur))
                 {
@@ -175,22 +223,37 @@ void xls_read(int *fd, int *cur_pos, double **data, int **chainesind, int *N, in
                 for (i = 0; i < ncol; i++)
                 {
                     C2F(mgetnc) (fd, (void*) &ixfe, &one, typ_short, err);
-                    if (*err > 0) goto ErrL;
+                    if (*err > 0)
+                    {
+                        goto ErrL;
+                    }
                     C2F(mgetnc) (fd, (void*) &rkvalue, &one, typ_int, err);
-                    if (*err > 0) goto ErrL;
+                    if (*err > 0)
+                    {
+                        goto ErrL;
+                    }
                     valeur[row + (colFirst + i)*hauteur] = NumFromRk2(rkvalue);
                 }
 
                 /*Index of last column*/
                 C2F(mgetnc) (fd, (void*) &colLast, &one, typ_ushort, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 break;
 
             case 253:/*LABELSST*/
                 C2F(mgetnc) (fd, (void*) labelsst1, &three, typ_short, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 C2F(mgetnc) (fd, (void*) &indsst , &one, typ_int, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 /*Allocation dans le tableau final*/
                 col = labelsst1[1];
                 row = labelsst1[0];
@@ -204,15 +267,30 @@ void xls_read(int *fd, int *cur_pos, double **data, int **chainesind, int *N, in
                 break;
             case 512:/* DIMENSIONS*/
                 C2F(mgetnc) (fd, (void*) &f_row, &one, typ_int, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 C2F(mgetnc) (fd, (void*) &l_row, &one, typ_int, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 C2F(mgetnc) (fd, (void*) &f_col, &one, typ_ushort, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 C2F(mgetnc) (fd, (void*) &l_col, &one, typ_ushort, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 C2F(mgetnc) (fd, (void*) &notused, &one, typ_ushort, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
 
                 /*Calcul de longueur, hauteur et capacite de la feuille*/
                 hauteur = l_row; /*-f_row;*/
@@ -236,9 +314,15 @@ void xls_read(int *fd, int *cur_pos, double **data, int **chainesind, int *N, in
                 break;
             case 6:/* FORMULA*/
                 C2F(mgetnc) (fd, (void*) &row, &one, typ_ushort, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 C2F(mgetnc) (fd, (void*) &col, &one, typ_ushort, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 // Check col and row are in bounds
                 if ((col >= longueur) || (row >= hauteur))
                 {
@@ -246,18 +330,30 @@ void xls_read(int *fd, int *cur_pos, double **data, int **chainesind, int *N, in
                     goto ErrL;
                 }
                 C2F(mgetnc) (fd, (void*) &xf, &one, typ_ushort, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
 
                 C2F(mgetnc) (fd, (void*) &resultat, &one, typ_double, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
 
                 valeur[(col * hauteur + row)] = resultat;
 
                 C2F(mgetnc) (fd, (void*)&optionflag, &one, typ_short, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
 
                 C2F(mgetnc) (fd, (void*) &formula_notused, &one, typ_int, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
 
                 /*Formuled data*/
 
@@ -277,9 +373,13 @@ ErrL:
         FREE(valeur);
         FREE(*chainesind);
         if (*err == 0)
-            *err = 1; /* malloc problem */
+        {
+            *err = 1;    /* malloc problem */
+        }
         else
-            *err = 2; /* read problem */
+        {
+            *err = 2;    /* read problem */
+        }
         return;
     }
 }
@@ -326,7 +426,10 @@ void xls_open(int *err, int *fd, char ***sst, int *ns, char ***Sheetnames, int**
 
     /* first record should be a BOF */
     getBOF(fd , BOFData, err);
-    if (*err > 0) return;
+    if (*err > 0)
+    {
+        return;
+    }
 
     if (BOFData[0] < 0) /* not a BOF */
     {
@@ -340,19 +443,31 @@ void xls_open(int *err, int *fd, char ***sst, int *ns, char ***Sheetnames, int**
     }
 
     pos = mtell(*fd);
-    if (*err > 0) goto Err2;
+    if (*err > 0)
+    {
+        goto Err2;
+    }
     cur_pos = (int)pos;
 
     /* loops on records till an EOF is found */
     while (1)
     {
         *err = mseek(*fd, cur_pos, SEEK_SET);
-        if (*err > 0) goto Err2;
+        if (*err > 0)
+        {
+            goto Err2;
+        }
         /*Enregistrement de l'Opcode et de la Len du tag*/
         C2F(mgetnc) (fd, &Opcode, &one, typ_ushort, err);
-        if (*err > 0) goto Err2;
+        if (*err > 0)
+        {
+            goto Err2;
+        }
         C2F(mgetnc) (fd, &Len, &one, typ_ushort, err);
-        if (*err > 0) goto Err2;
+        if (*err > 0)
+        {
+            goto Err2;
+        }
 
         switch (Opcode)
         {
@@ -361,12 +476,21 @@ void xls_open(int *err, int *fd, char ***sst, int *ns, char ***Sheetnames, int**
                 return ;
             case 133: /* Boundsheets */
                 getBoundsheets(fd, Sheetnames, Abspos, nsheets, &cur_pos, err);
-                for (k = 0; k < *nsheets; k++) (*Abspos)[k] += init_pos;
-                if (*err > 0) return;
+                for (k = 0; k < *nsheets; k++)
+                {
+                    (*Abspos)[k] += init_pos;
+                }
+                if (*err > 0)
+                {
+                    return;
+                }
                 break;
             case 252: /* SST= Shared String table*/
                 getSST(fd, Len, BOFData[0], ns, sst, err);
-                if (*err > 0) return;
+                if (*err > 0)
+                {
+                    return;
+                }
                 cur_pos = cur_pos + 4 + Len;
                 break;
             default:
@@ -396,7 +520,9 @@ static double NumFromRk2(long rk)
     }
     if (rk & 0x01)
         /* divide by 100*/
+    {
         num /= 100;
+    }
     return num;
 }
 
@@ -417,52 +543,99 @@ static void getBOF(int *fd , int* Data, int *err)
     int one = 1;
 
     C2F(mgetnc) (fd, (void*)&Opcode, &one, typ_ushort, err);
-    if (*err > 0) return;
+    if (*err > 0)
+    {
+        return;
+    }
     C2F(mgetnc) (fd, (void*)&Len, &one, typ_ushort, err);
-    if (*err > 0) return;
+    if (*err > 0)
+    {
+        return;
+    }
 
     switch (Opcode)
     {
         case 2057:     /*Begin of file, BOF for BIFF5 BIFF7 BIFF8 BIFF8X*/
             C2F(mgetnc) (fd, (void*)&Version, &one, typ_short, err);
-            if (*err > 0) return;
+            if (*err > 0)
+            {
+                return;
+            }
             C2F(mgetnc) (fd, (void*)&DataType, &one, typ_short, err);
-            if (*err > 0) return;
+            if (*err > 0)
+            {
+                return;
+            }
             C2F(mgetnc) (fd, (void*)&Identifier, &one, typ_short, err);
-            if (*err > 0) return;
+            if (*err > 0)
+            {
+                return;
+            }
             C2F(mgetnc) (fd, (void*)&Year, &one, typ_short, err);
-            if (*err > 0) return;
+            if (*err > 0)
+            {
+                return;
+            }
             if (Len == 16)
             {
                 C2F(mgetnc) (fd, (void*)&HistoryFlags, &one, typ_int, err);
-                if (*err > 0) return;
+                if (*err > 0)
+                {
+                    return;
+                }
                 C2F(mgetnc) (fd, (void*)&LowestXlsVersion, &one, typ_int, err);
-                if (*err > 0) return;
+                if (*err > 0)
+                {
+                    return;
+                }
                 BIFF = 8;
-                if (Version != 1536) return;
+                if (Version != 1536)
+                {
+                    return;
+                }
             }
             else
+            {
                 BIFF = 7;
+            }
             break;
         case 1033 : /*Interpr�tation du BIFF4  0409 H*/
             C2F(mgetnc) (fd, (void*)&Version, &one, typ_short, err);
-            if (*err > 0) return;
+            if (*err > 0)
+            {
+                return;
+            }
             C2F(mgetnc) (fd, (void*)&DataType, &one, typ_short, err);
-            if (*err > 0) return;
+            if (*err > 0)
+            {
+                return;
+            }
             BIFF = 4;
             break;
         case 521 : /*Interpr�tation du BIFF3  0209 H*/
             C2F(mgetnc) (fd, (void*)&Version, &one, typ_short, err);
-            if (*err > 0) return;
+            if (*err > 0)
+            {
+                return;
+            }
             C2F(mgetnc) (fd, (void*)&DataType, &one, typ_short, err);
-            if (*err > 0) return;
+            if (*err > 0)
+            {
+                return;
+            }
             BIFF = 3;
             break;
         case 9 : /*Interpr�tation du BIFF2  0009 H*/
             C2F(mgetnc) (fd, (void*)&Version, &one, typ_short, err);
-            if (*err > 0) return;
+            if (*err > 0)
+            {
+                return;
+            }
             C2F(mgetnc) (fd, (void*)&DataType, &one, typ_short, err);
-            if (*err > 0) return;
+            if (*err > 0)
+            {
+                return;
+            }
             BIFF = 2;
             break;
         default:
@@ -495,20 +668,35 @@ static void getSST(int *fd, short Len, int BIFF, int *ns, char ***sst, int *err)
     {
         /*Total number of strings in the workbook*/
         C2F(mgetnc) (fd, (void*)&ntot, &one, typ_int, err);
-        if (*err > 0) goto ErrL;
+        if (*err > 0)
+        {
+            goto ErrL;
+        }
         C2F(mgetnc) (fd, (void*)&nm, &one, typ_int, err);
-        if (*err > 0) goto ErrL;
+        if (*err > 0)
+        {
+            goto ErrL;
+        }
         *ns = nm;
         count += 8;
         if (nm != 0)
         {
-            if ( (*sst = (char **)MALLOC(nm * sizeof(char*))) == NULL)  goto ErrL;
-            for (i = 0; i < nm; i++) (*sst)[i] = NULL;
+            if ( (*sst = (char **)MALLOC(nm * sizeof(char*))) == NULL)
+            {
+                goto ErrL;
+            }
+            for (i = 0; i < nm; i++)
+            {
+                (*sst)[i] = NULL;
+            }
             for (i = 0; i < nm; i++) /* LOOP ON STRINGS */
             {
                 *err = i; /*for debug*/
                 getString(fd, &count, &Len, 1, &((*sst)[i]), err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 /*printf("i=%d, %s\n",i,(*sst)[i]);*/
             }
         }
@@ -518,14 +706,21 @@ ErrL:
     if (*sst != NULL)
     {
         for (i = 0; i < nm; i++)
-            if ( (*sst)[i] != NULL ) FREE((*sst)[i]);
+            if ( (*sst)[i] != NULL )
+            {
+                FREE((*sst)[i]);
+            }
         FREE(*sst);
     }
 
     if (*err == 0)
-        *err = 3; /* malloc problem */
+    {
+        *err = 3;    /* malloc problem */
+    }
     else
-        *err = 4; /* read problem */
+    {
+        *err = 4;    /* read problem */
+    }
 }
 
 static void getString(int *fd, short *PosInRecord, short *RecordLen, int flag, char **str, int *err)
@@ -549,9 +744,15 @@ static void getString(int *fd, short *PosInRecord, short *RecordLen, int flag, c
         /*check for continue tag */
         /*lecture de l'Opcode et de la RecordLen du tag*/
         C2F(mgetnc) (fd, &Opcode, &one, typ_ushort, err);
-        if ((*err > 0) || (Opcode != 60)) goto ErrL;
+        if ((*err > 0) || (Opcode != 60))
+        {
+            goto ErrL;
+        }
         C2F(mgetnc) (fd, RecordLen, &one, typ_ushort, err);
-        if (*err > 0) goto ErrL;
+        if (*err > 0)
+        {
+            goto ErrL;
+        }
         *PosInRecord = 0;
     }
 
@@ -559,19 +760,28 @@ static void getString(int *fd, short *PosInRecord, short *RecordLen, int flag, c
     if (flag)   /* getString called by getSST */
     {
         C2F(mgetnc) (fd, (void*)&ln, &one, typ_short, err);
-        if (*err > 0) goto ErrL;
+        if (*err > 0)
+        {
+            goto ErrL;
+        }
         *PosInRecord += 2;
     }
     else   /* getString called by getBoundsheets */
     {
         C2F(mgetnc) (fd, (void*)&ln, &one, typ_char, err);
-        if (*err > 0) goto ErrL;
+        if (*err > 0)
+        {
+            goto ErrL;
+        }
         *PosInRecord += 1;
     }
 
     /*get the encoding options */
     C2F(mgetnc) (fd, (void*)&OptionFlag, &one, typ_char, err);
-    if (*err > 0) goto ErrL;
+    if (*err > 0)
+    {
+        goto ErrL;
+    }
     *PosInRecord += 1;
 
     UTFEncoding = (OptionFlag & 0x01) == 1;
@@ -582,13 +792,19 @@ static void getString(int *fd, short *PosInRecord, short *RecordLen, int flag, c
     {
         C2F(mgetnc) (fd, (void*)&rt, &one, typ_short, err);
         *PosInRecord += 2;
-        if (*err > 0) goto ErrL;
+        if (*err > 0)
+        {
+            goto ErrL;
+        }
     }
 
     if (extendedString)  /* extendedString */
     {
         C2F(mgetnc) (fd, (void*)&sz, &one, typ_int, err);
-        if (*err > 0) goto ErrL;
+        if (*err > 0)
+        {
+            goto ErrL;
+        }
         *PosInRecord += 4;
     }
 
@@ -596,14 +812,20 @@ static void getString(int *fd, short *PosInRecord, short *RecordLen, int flag, c
     BytesToBeRead = (UTFEncoding) ? ln * 2 : ln;
 
 
-    if ((*str = (char*) MALLOC((BytesToBeRead + 1) * sizeof(char))) == NULL)  goto ErrL;
+    if ((*str = (char*) MALLOC((BytesToBeRead + 1) * sizeof(char))) == NULL)
+    {
+        goto ErrL;
+    }
     /* read the bytes */
 
     if (!flag || (*PosInRecord + BytesToBeRead <= *RecordLen))
     {
         /* all bytes are in the same record */
         C2F(mgetnc) (fd, (void*)*str, &BytesToBeRead, typ_char, err);
-        if (*err > 0) goto ErrL;
+        if (*err > 0)
+        {
+            goto ErrL;
+        }
         *PosInRecord += (short)BytesToBeRead;
     }
     else  /* char stream contains at least one "continue" */
@@ -613,20 +835,32 @@ static void getString(int *fd, short *PosInRecord, short *RecordLen, int flag, c
         /* read bytes before the "continue"  */
         /* according to documentation  bytesRead should be strictly positive */
         C2F(mgetnc) (fd, (void*)(*str + strindex), &bytesRead, typ_char, err);
-        if (*err > 0) goto ErrL;
+        if (*err > 0)
+        {
+            goto ErrL;
+        }
         strindex += bytesRead;
         *PosInRecord += (short)bytesRead;
         while (BytesToBeRead - bytesRead > 0)
         {
             /*"continue" tag assumed, verify */
             C2F(mgetnc) (fd, &Opcode, &one, typ_ushort, err);
-            if ((*err > 0) || (Opcode != 60)) goto ErrL;
+            if ((*err > 0) || (Opcode != 60))
+            {
+                goto ErrL;
+            }
             C2F(mgetnc) (fd, RecordLen, &one, typ_ushort, err);
-            if (*err > 0) goto ErrL;
+            if (*err > 0)
+            {
+                goto ErrL;
+            }
             *PosInRecord = 0;
             /* encoding option may change !!!! */
             C2F(mgetnc) (fd, (void*)&OptionFlag, &one, typ_char, err);
-            if (*err > 0) goto ErrL;
+            if (*err > 0)
+            {
+                goto ErrL;
+            }
             *PosInRecord += 1;
 
             if ((!UTFEncoding && (OptionFlag == 0)) || (UTFEncoding && (OptionFlag != 0)))
@@ -634,7 +868,10 @@ static void getString(int *fd, short *PosInRecord, short *RecordLen, int flag, c
                 /*string encoding does not change */
                 l1 = Min(BytesToBeRead - bytesRead, *RecordLen - *PosInRecord);
                 C2F(mgetnc) (fd, (void*)(*str + strindex), &l1, typ_char, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 bytesRead += l1;
                 strindex += l1;
                 *PosInRecord += (short)l1;
@@ -647,7 +884,10 @@ static void getString(int *fd, short *PosInRecord, short *RecordLen, int flag, c
                 for (j = 0; j < l1; j++)
                 {
                     C2F(mgetnc) (fd, (void*)(*str + strindex), &one, typ_char, err);
-                    if (*err > 0) goto ErrL;
+                    if (*err > 0)
+                    {
+                        goto ErrL;
+                    }
                     (*str)[strindex + 1] = '\0';
                     strindex += 2;
                     *PosInRecord += 2;
@@ -661,7 +901,10 @@ static void getString(int *fd, short *PosInRecord, short *RecordLen, int flag, c
                 char *str1 = *str;
                 strindex = 0;
                 str = (char**) MALLOC((2 * BytesToBeRead + 1) * sizeof(char*));
-                if (str == NULL)  goto ErrL;
+                if (str == NULL)
+                {
+                    goto ErrL;
+                }
                 for (j = 0; j < bytesRead; j++)
                 {
                     (*str)[strindex] = str1[j];
@@ -674,7 +917,10 @@ static void getString(int *fd, short *PosInRecord, short *RecordLen, int flag, c
                 /* read following two bytes characters */
                 l1 = Min((BytesToBeRead - bytesRead) * 2, *RecordLen - *PosInRecord);
                 C2F(mgetnc) (fd, (void*)(*str + strindex), &l1, typ_char, err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
                 bytesRead += l1;
                 strindex += l1;
                 *PosInRecord += (short)l1;
@@ -722,7 +968,9 @@ ErrL:
         *err = 3; /* malloc problem */
     }
     else
-        *err = 4; /* read problem */
+    {
+        *err = 4;    /* read problem */
+    }
 }
 
 static void getBoundsheets(int * fd, char ***Sheetnames, int** Abspos, int *nsheets, int *cur_pos, int *err)
@@ -748,17 +996,32 @@ static void getBoundsheets(int * fd, char ***Sheetnames, int** Abspos, int *nshe
     while (1)
     {
         *err = mseek(*fd, *cur_pos, SEEK_SET);
-        if (*err > 0) goto ErrL;
+        if (*err > 0)
+        {
+            goto ErrL;
+        }
         C2F(mgetnc) (fd, &Opcode, &one, typ_ushort, err);
-        if (*err > 0) goto ErrL;
+        if (*err > 0)
+        {
+            goto ErrL;
+        }
         C2F(mgetnc) (fd, &Len, &one, typ_ushort, err);
-        if (*err > 0) goto ErrL;
+        if (*err > 0)
+        {
+            goto ErrL;
+        }
         if (Opcode == 133)
         {
             C2F(mgetnc) (fd, (void*)&abspos, &one, typ_int, err);
-            if (*err > 0) goto ErrL;
+            if (*err > 0)
+            {
+                goto ErrL;
+            }
             C2F(mgetnc) (fd, (void*)&visibility, &one, typ_char, err);
-            if (*err > 0) goto ErrL;
+            if (*err > 0)
+            {
+                goto ErrL;
+            }
             C2F(mgetnc) (fd, (void*)&sheettype, &one, typ_char, err);
             if (sheettype == 0) /* worksheet */
             {
@@ -767,14 +1030,22 @@ static void getBoundsheets(int * fd, char ***Sheetnames, int** Abspos, int *nshe
             *cur_pos = *cur_pos + 4 + Len;
         }
         else
+        {
             break;
+        }
 
     }
 
     *nsheets = ns;
     /*alloc the Sheetnames ans Abspos arrays */
-    if ( (*Sheetnames = (char **)MALLOC(ns * sizeof(char*))) == NULL)  goto ErrL;
-    if ( (*Abspos = (int *)MALLOC(ns * sizeof(int))) == NULL)  goto ErrL;
+    if ( (*Sheetnames = (char **)MALLOC(ns * sizeof(char*))) == NULL)
+    {
+        goto ErrL;
+    }
+    if ( (*Abspos = (int *)MALLOC(ns * sizeof(int))) == NULL)
+    {
+        goto ErrL;
+    }
 
     /* rescan boundsheet sequence to get the data */
     *cur_pos = pos;
@@ -782,15 +1053,24 @@ static void getBoundsheets(int * fd, char ***Sheetnames, int** Abspos, int *nshe
     while (1)
     {
         *err = mseek(*fd, *cur_pos, SEEK_SET);
-        if (*err > 0) goto ErrL;
+        if (*err > 0)
+        {
+            goto ErrL;
+        }
         C2F(mgetnc) (fd, &Opcode, &one, typ_ushort, err);
         C2F(mgetnc) (fd, &Len, &one, typ_ushort, err);
         if (Opcode == 133)
         {
             C2F(mgetnc) (fd, (void*)&abspos, &one, typ_int, err);
-            if (*err > 0) goto ErrL;
+            if (*err > 0)
+            {
+                goto ErrL;
+            }
             C2F(mgetnc) (fd, (void*)&visibility, &one, typ_char, err);
-            if (*err > 0) goto ErrL;
+            if (*err > 0)
+            {
+                goto ErrL;
+            }
             C2F(mgetnc) (fd, (void*)&sheettype, &one, typ_char, err);
             if (sheettype == 0) /* worksheet */
             {
@@ -798,12 +1078,17 @@ static void getBoundsheets(int * fd, char ***Sheetnames, int** Abspos, int *nshe
                 i++;
                 (*Abspos)[i] = abspos;
                 getString(fd, &count, (short *) &Len, 0, &((*Sheetnames)[i]), err);
-                if (*err > 0) goto ErrL;
+                if (*err > 0)
+                {
+                    goto ErrL;
+                }
             }
             *cur_pos = *cur_pos + 4 + Len;
         }
         else
+        {
             break;
+        }
 
     }
     return;
@@ -811,14 +1096,21 @@ ErrL:
     if (*Sheetnames != NULL)
     {
         for (i = 0; i < ns; i++)
-            if ( (*Sheetnames)[i] != NULL ) FREE((*Sheetnames)[i]);
+            if ( (*Sheetnames)[i] != NULL )
+            {
+                FREE((*Sheetnames)[i]);
+            }
         FREE(*Sheetnames);
     }
     FREE(*Abspos);
     if (*err == 0)
-        *err = 3; /* malloc problem */
+    {
+        *err = 3;    /* malloc problem */
+    }
     else
-        *err = 4; /* read problem */
+    {
+        *err = 4;    /* read problem */
+    }
 }
 
 /**
index 6e0507c..113b0e3 100644 (file)
 #include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[] =
-{
-       {NULL, ""}, //cdfbet
-       {NULL, ""}, //cdfbin
-       {NULL, ""}, //cdfchi
-       {NULL, ""}, //cdfchn
-       {NULL, ""}, //cdff
-       {NULL, ""}, //cdffnc
-       {NULL, ""}, //cdfgam
-       {NULL , ""}, //cdfnbn
-       {NULL, ""}, //cdfnor
-       {NULL, ""}, //cdfpoi
-       {NULL, ""} //cdft
-};
-/*--------------------------------------------------------------------------*/
 int gw_statistics()
 {
-       return 0;
+    return 0;
 }
index ffbbddc..8c30550 100644 (file)
@@ -874,7 +874,7 @@ SKIP_DATA:
                             *_pstCapturedString = (char**)MALLOC(sizeof(char*) * *_piCapturedStringCount);
                             for (i = 0 ; i < *_piCapturedStringCount ; i++)
                             {
-                                char* pstSubstring = NULL;
+                                const char* pstSubstring = NULL;
                                 pcre_get_substring(bptr, use_offsets, count, i + 1, &pstSubstring);
                                 if (pstSubstring != NULL)
                                 {
index 25f4c82..b60e90a 100644 (file)
 #include "gw_symbolic.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[] =
-{
-{sci_addf,"addf"},
-{sci_subf,"subf"},
-{sci_mulf,"mulf"},
-{sci_ldivf,"ldivf"},
-{sci_rdivf,"rdivf"}
-};
-/*--------------------------------------------------------------------------*/
 int gw_symbolic(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index 6a45901..13c5eba 100644 (file)
@@ -13,6 +13,9 @@
 #ifndef __CONFIGVARIABLE_HXX__
 #define __CONFIGVARIABLE_HXX__
 
+//disable warnings about exports STL items
+#pragma warning (disable : 4251)
+
 #include <list>
 #include <map>
 #include <string>
index 5825933..074fc57 100644 (file)
 #include "InitializeTclTk.h"
 #include "BOOL.h"
 /*--------------------------------------------------------------------------*/
-static BOOL bFirstTclInit = TRUE;
-/*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[]=
-{
-  {sci_TCL_DoOneEvent,"TCL_DoOneEvent"},
-  {sci_TCL_EvalStr,"TCL_EvalStr"},
-  {sci_TCL_GetVar,"TCL_GetVar"},
-  {sci_TCL_SetVar,"TCL_SetVar"},
-  {sci_opentk,"opentk"},
-  {sci_TCL_GetVersion,"TCL_GetVersion"},
-  {sci_TCL_UnsetVar,"TCL_UnsetVar"},
-  {sci_TCL_ExistVar,"TCL_ExistVar"},
-  {sci_TCL_UpVar,"TCL_UpVar"},
-  {sci_TCL_DeleteInterp,"TCL_DeleteInterp"},
-  {sci_TCL_ExistInterp,"TCL_ExistInterp"},
-  {sci_TCL_ExistArray,"TCL_ExistArray"},
-  {sci_TCL_EvalFile,"TCL_EvalFile"}
- };
-/*--------------------------------------------------------------------------*/
 int gw_tclsci(void)
 {
-  return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index dc6cdfb..291d217 100644 (file)
 int TCL_EvalScilabCmd(ClientData clientData, Tcl_Interp * theinterp, int objc, CONST char ** argv)
 {
     int ierr = 0, seq = 0;
-    char *command;
+    wchar_t *pwstCommand = NULL;
+    char *pstCommand = NULL;
 
+    wchar_t* pwstComm = NULL;
     char *comm[arbitrary_max_queued_callbacks];
     int   seqf[arbitrary_max_queued_callbacks];
     int nc, ncomm = -1;
@@ -47,15 +49,20 @@ int TCL_EvalScilabCmd(ClientData clientData, Tcl_Interp * theinterp, int objc, C
 
         sciprint_full(msg, argv[1]);
 
-        while (argv[++argc]) sciprint(" %s", argv[argc]);
+        while (argv[++argc])
+        {
+            sciprint(" %s", argv[argc]);
+        }
         sciprint("\n");
 
     }
 
     if (argv[1] != (char *)0)
     {
-        command = os_strdup(argv[1]);
-        if (command == (char *) 0)
+        pwstCommand = to_wide_string(argv[1]);
+        pstCommand = os_strdup(argv[1]);
+
+        if (pwstCommand == NULL || pstCommand == NULL)
         {
             sciprint(_("%s: No more memory.\n"), "TCL_EvalScilabCmd");
             return TCL_ERROR;
@@ -74,7 +81,7 @@ int TCL_EvalScilabCmd(ClientData clientData, Tcl_Interp * theinterp, int objc, C
             if (C2F(iop).ddt == -1)
             {
                 char *msg = _("Execution starts for %s");
-                sciprint_full(msg, command);
+                sciprint_full(msg, pstCommand);
                 sciprint("\n");
             }
 
@@ -84,23 +91,29 @@ int TCL_EvalScilabCmd(ClientData clientData, Tcl_Interp * theinterp, int objc, C
             So far as Tcl has it's own thread now mixing global values
             and threads within parse makes Scilab crash often.
             */
-            StorePrioritaryCommandWithFlag(command, seq);
+            StorePrioritaryCommandWithFlag(pwstCommand, seq);
             ierr = 0;
 
             if (C2F(iop).ddt == -1)
             {
                 char *msg = _("Execution ends for %s");
-                sciprint_full(msg, command);
+                sciprint_full(msg, pstCommand);
                 sciprint("\n");
             }
             // TODO : Scilab is supposed to be busy there. Add mutex lock...
             // C2F(tksynchro)(&C2F(recu).paus);
-            if (ierr != 0) return TCL_ERROR;
+            if (ierr != 0)
+            {
+                return TCL_ERROR;
+            }
         }
-        else if (strncmp(command, "flush", 5) == 0)
+        else if (strncmp(pstCommand, "flush", 5) == 0)
         {
             /* flush */
-            if (C2F(iop).ddt == -1) sciprint(_(" Flushing starts for queued commands.\n"));
+            if (C2F(iop).ddt == -1)
+            {
+                sciprint(_(" Flushing starts for queued commands.\n"));
+            }
             while (ismenu() && ncomm < arbitrary_max_queued_callbacks - 1)
             {
                 ncomm++;
@@ -108,7 +121,8 @@ int TCL_EvalScilabCmd(ClientData clientData, Tcl_Interp * theinterp, int objc, C
                 if (comm[ncomm] == (char *) 0)
                 {
                     sciprint(_("%s: No more memory.\n"), "TCL_EvalScilabCmd");
-                    FREE(command);
+                    FREE(pwstCommand);
+                    FREE(pstCommand);
                     return TCL_ERROR;
                 }
                 seqf[ncomm] = GetCommand (comm[ncomm]);
@@ -141,7 +155,9 @@ int TCL_EvalScilabCmd(ClientData clientData, Tcl_Interp * theinterp, int objc, C
                 So far as Tcl has it's own thread now mixing global values
                 and threads within parse makes Scilab crash often.
                 */
-                StorePrioritaryCommandWithFlag(comm[nc], seqf[nc]);
+                pwstComm = to_wide_string(comm[nc]);
+                StorePrioritaryCommandWithFlag(pwstComm, seqf[nc]);
+                FREE(pwstComm);
                 if (C2F(iop).ddt == -1)
                 {
                     char *msg = _("Flushed execution ends for %s");
@@ -151,25 +167,32 @@ int TCL_EvalScilabCmd(ClientData clientData, Tcl_Interp * theinterp, int objc, C
                 FREE(comm[nc]);
                 // TODO : Scilab is supposed to be busy there. Add mutex lock...
                 // C2F(tksynchro)(&C2F(recu).paus);
-                if (ierr != 0) return TCL_ERROR;
+                if (ierr != 0)
+                {
+                    return TCL_ERROR;
+                }
+            }
+            if (C2F(iop).ddt == -1)
+            {
+                sciprint(_("Flushing ends\n"));
             }
-            if (C2F(iop).ddt == -1) sciprint(_("Flushing ends\n"));
         }
         else
         {
             if ( (argv[2] != (char *)0) && (strncmp(argv[2], "seq", 3) == 0) )
             {
                 /* seq */
-                StoreCommandWithFlag(command, 1);
+                StoreCommandWithFlag(pwstCommand, 1);
             }
             else
             {
                 /* no option or unknown option (TODO: no error for this latter case?) */
-                StoreCommand(command);
+                StoreCommand(pwstCommand);
                 Tcl_SetResult(theinterp, NULL, NULL);
             }
         }
-        FREE(command);
+        FREE(pwstCommand);
+        FREE(pstCommand);
 
     }
     else
index 16b1702..a5da21e 100644 (file)
 #include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
-#define TIME_TAB_SIZE 7
-static gw_generic_table Tab[TIME_TAB_SIZE]={
-       {NULL, ""}, //getdate
-       {NULL, ""}, //Calendar
-       {NULL, ""}, //timer
-       {NULL, ""}, //sleep
-       {NULL, ""}, //xpause
-       {NULL, ""}, //realtimeinit
-       {NULL, ""}, //realtime
-};
-/*--------------------------------------------------------------------------*/
 int gw_time(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index 032d472..e35c8a3 100644 (file)
 #include "visitor.hxx"
 #include "dynlib_types.h"
 
+//disable warnings about exports STL items
+#pragma warning (disable : 4251)
+
 using namespace ast;
 namespace types
 {
-  class TYPES_IMPEXP Callable : public InternalType
-  {
-  public :
-      enum ReturnValue
-      {
-          OK,
-          OK_NoResult,
-          Error
-      };
-    
-                            Callable(): InternalType() {}
-      virtual               ~Callable() {}
-
-      bool                  isCallable() { return true; }
-
-      virtual ReturnValue   call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc) = 0;
-
-      void                  setName(std::wstring _wstName) { m_wstName = _wstName; }
-      std::wstring          getName() { return m_wstName; }
-      void                  setModule(std::wstring _wstModule) { m_wstModule = _wstModule; }
-      std::wstring          getModule() { return m_wstModule; }
-
-      /* return type as string ( double, int, cell, list, ... )*/
-      virtual std::wstring  getTypeStr() {return L"callable";}
-      /* return type as short string ( s, i, ce, l, ... )*/
-      virtual std::wstring  getShortTypeStr() = 0;
-      virtual InternalType* clone(void) = 0;
-
-  protected :
-      std::wstring           m_wstName;
-      std::wstring           m_wstModule;
-  };
+class TYPES_IMPEXP Callable : public InternalType
+{
+public :
+    enum ReturnValue
+    {
+        OK,
+        OK_NoResult,
+        Error
+    };
+
+    Callable(): InternalType() {}
+    virtual               ~Callable() {}
+
+    bool                  isCallable()
+    {
+        return true;
+    }
+
+    virtual ReturnValue   call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc) = 0;
+
+    void                  setName(std::wstring _wstName)
+    {
+        m_wstName = _wstName;
+    }
+    std::wstring          getName()
+    {
+        return m_wstName;
+    }
+    void                  setModule(std::wstring _wstModule)
+    {
+        m_wstModule = _wstModule;
+    }
+    std::wstring          getModule()
+    {
+        return m_wstModule;
+    }
+
+    /* return type as string ( double, int, cell, list, ... )*/
+    virtual std::wstring  getTypeStr()
+    {
+        return L"callable";
+    }
+    /* return type as short string ( s, i, ce, l, ... )*/
+    virtual std::wstring  getShortTypeStr() = 0;
+    virtual InternalType* clone(void) = 0;
+
+protected :
+    std::wstring           m_wstName;
+    std::wstring           m_wstModule;
+};
 }
 
 
index 4a47b42..e997afb 100644 (file)
 #ifndef __INSPECTOR_HXX__
 #define __INSPECTOR_HXX__
 
+//disable warnings about exports STL items
+#pragma warning (disable : 4251)
+
 #include <vector>
 #include <string>
 
 extern "C"
 {
-    #include "dynlib_types.h"
+#include "dynlib_types.h"
 }
 
 #include "internal.hxx"
@@ -26,25 +29,25 @@ extern "C"
 namespace types
 {
 #ifndef NDEBUG
-    class TYPES_IMPEXP Inspector
-    {
-    protected :
-        static std::vector<InternalType*> m_vIT;
+class TYPES_IMPEXP Inspector
+{
+protected :
+    static std::vector<InternalType*> m_vIT;
 
-    public : 
-        static int getItemCount();
-        static int getUnreferencedItemCount();
+public :
+    static int getItemCount();
+    static int getUnreferencedItemCount();
 
-        static void addItem(InternalType* _pIT);
-        static void removeItem(InternalType* _pIT);
+    static void addItem(InternalType* _pIT);
+    static void removeItem(InternalType* _pIT);
 
-        static InternalType* getItem(int _iPos);
-        static InternalType* getUnreferencedItem(int _iPos);
+    static InternalType* getItem(int _iPos);
+    static InternalType* getUnreferencedItem(int _iPos);
 
-        static std::wstring showItem(int _iPos);
-        static std::wstring showUnreferencedItem(int _iPos);
-        static void deleteItems();
-    };
+    static std::wstring showItem(int _iPos);
+    static std::wstring showUnreferencedItem(int _iPos);
+    static void deleteItems();
+};
 #endif
 }
 #endif /* !__INSPECTOR_HXX__ */
\ No newline at end of file
index f09d27a..f05c320 100644 (file)
 
 namespace types
 {
-    class TYPES_IMPEXP Int16 : public ArrayOf<short>
-    {
-    public :
-                                    Int16(short _sVal);
-                                    Int16(int _iRows, int _iCols);
-                                    Int16(int _iDims, int* _piDims);
-                                    Int16(int _iRows, int _iCols, short **_psData);
-                                    ~Int16();
-
-        InternalType*               clone();
-
+class TYPES_IMPEXP Int16 : public ArrayOf<short>
+{
+public :
+    Int16(short _sVal);
+    Int16(int _iRows, int _iCols);
+    Int16(int _iDims, int* _piDims);
+    Int16(int _iRows, int _iCols, short **_psData);
+    ~Int16();
 
-        /*Config management*/
-        void                        whoAmI();
+    InternalType*               clone();
 
-        bool                        isInt() { return true; }
-        bool                        isInt16() { return true; }
 
-        bool                        operator==(const InternalType& it);
-        bool                        operator!=(const InternalType& it);
+    /*Config management*/
+    void                        whoAmI();
 
-        /* return type as string ( double, int, cell, list, ... )*/
-        virtual std::wstring        getTypeStr() {return L"int16";}
-        /* return type as short string ( s, i, ce, l, ... )*/
-        virtual std::wstring        getShortTypeStr() {return L"i";}
+    bool                        isInt()
+    {
+        return true;
+    }
+    bool                        isInt16()
+    {
+        return true;
+    }
 
-    protected :
-        RealType                                   getType(void){return InternalType::RealInt16;}
+    bool                        operator==(const InternalType& it);
+    bool                        operator!=(const InternalType& it);
 
-    private :
-        virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+    /* return type as string ( double, int, cell, list, ... )*/
+    virtual std::wstring        getTypeStr()
+    {
+        return L"int16";
+    }
+    /* return type as short string ( s, i, ce, l, ... )*/
+    virtual std::wstring        getShortTypeStr()
+    {
+        return L"i";
+    }
 
-        virtual short               getNullValue();
-        virtual Int16*              createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
-        virtual short               copyValue(short _sData);
-        virtual void                deleteAll();
-        virtual void                deleteImg();
-        virtual short*              allocData(int _iSize);
-    };
+protected :
+    RealType                               getType(void)
+    {
+        return InternalType::RealInt16;
+    }
+
+private :
+    virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+
+    virtual short               getNullValue();
+    virtual Int16*              createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
+    virtual short               copyValue(short _sData);
+    virtual void                deleteAll();
+    virtual void                deleteImg();
+    virtual short*              allocData(int _iSize);
+};
 }
 
 #ifdef _MSC_VER
 template class TYPES_IMPEXP types::ArrayOf<short>; //Int16
 #endif
-
 #endif /* !__INT16_HXX__ */
index 4a1c830..21fd0d1 100644 (file)
 
 namespace types
 {
-    class TYPES_IMPEXP Int32 : public ArrayOf<int>
-    {
-    public :
-                                    Int32(int _iVal);
-                                    Int32(int _iRows, int _iCols);
-                                    Int32(int _iDims, int* _piDims);
-                                    Int32(int _iRows, int _iCols, int **_piData);
-                                    ~Int32();
-
-        InternalType*               clone();
-
+class TYPES_IMPEXP Int32 : public ArrayOf<int>
+{
+public :
+    Int32(int _iVal);
+    Int32(int _iRows, int _iCols);
+    Int32(int _iDims, int* _piDims);
+    Int32(int _iRows, int _iCols, int **_piData);
+    ~Int32();
 
-        /*Config management*/
-        void                        whoAmI();
+    InternalType*               clone();
 
-        bool                        isInt() { return true; }
-        bool                        isInt32() { return true; }
 
-        bool                        operator==(const InternalType& it);
-        bool                        operator!=(const InternalType& it);
+    /*Config management*/
+    void                        whoAmI();
 
-        /* return type as string ( double, int, cell, list, ... )*/
-        virtual std::wstring        getTypeStr() {return L"int32";}
-        /* return type as short string ( s, i, ce, l, ... )*/
-        virtual std::wstring        getShortTypeStr() {return L"i";}
+    bool                        isInt()
+    {
+        return true;
+    }
+    bool                        isInt32()
+    {
+        return true;
+    }
 
-    protected :
-        RealType                                   getType(void){return InternalType::RealInt32;}
+    bool                        operator==(const InternalType& it);
+    bool                        operator!=(const InternalType& it);
 
-    private :
-        virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+    /* return type as string ( double, int, cell, list, ... )*/
+    virtual std::wstring        getTypeStr()
+    {
+        return L"int32";
+    }
+    /* return type as short string ( s, i, ce, l, ... )*/
+    virtual std::wstring        getShortTypeStr()
+    {
+        return L"i";
+    }
 
-        virtual int                 getNullValue();
-        virtual Int32*              createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
-        virtual int                 copyValue(int _iData);
-        virtual void                deleteAll();
-        virtual void                deleteImg();
-        virtual int*                allocData(int _iSize);
-    };
+protected :
+    RealType                               getType(void)
+    {
+        return InternalType::RealInt32;
+    }
+
+private :
+    virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+
+    virtual int                 getNullValue();
+    virtual Int32*              createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
+    virtual int                 copyValue(int _iData);
+    virtual void                deleteAll();
+    virtual void                deleteImg();
+    virtual int*                allocData(int _iSize);
+};
 }
 
 #ifdef _MSC_VER
 template class TYPES_IMPEXP types::ArrayOf<int>; //Int32
 #endif
-
 #endif /* !__INT32_HXX__ */
index aaf53f3..21232ad 100644 (file)
 
 namespace types
 {
-    class TYPES_IMPEXP Int64 : public ArrayOf<long long>
-    {
-    public :
-                                    Int64(long long _llVal);
-                                    Int64(int _iRows, int _iCols);
-                                    Int64(int _iDims, int* _piDims);
-                                    Int64(int _iRows, int _iCols, long long **_pllData);
-                                    ~Int64();
-
-        InternalType*               clone();
-
+class TYPES_IMPEXP Int64 : public ArrayOf<long long>
+{
+public :
+    Int64(long long _llVal);
+    Int64(int _iRows, int _iCols);
+    Int64(int _iDims, int* _piDims);
+    Int64(int _iRows, int _iCols, long long **_pllData);
+    ~Int64();
 
-        /*Config management*/
-        void                        whoAmI();
+    InternalType*               clone();
 
-        bool                        isInt() { return true; }
-        bool                        isInt64() { return true; }
 
-        bool                        operator==(const InternalType& it);
-        bool                        operator!=(const InternalType& it);
+    /*Config management*/
+    void                        whoAmI();
 
-        /* return type as string ( double, int, cell, list, ... )*/
-        virtual std::wstring        getTypeStr() {return L"int64";}
-        /* return type as short string ( s, i, ce, l, ... )*/
-        virtual std::wstring        getShortTypeStr() {return L"i";}
+    bool                        isInt()
+    {
+        return true;
+    }
+    bool                        isInt64()
+    {
+        return true;
+    }
 
-    protected :
-        RealType                                   getType(void){return InternalType::RealInt64;}
+    bool                        operator==(const InternalType& it);
+    bool                        operator!=(const InternalType& it);
 
-    private :
-        virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+    /* return type as string ( double, int, cell, list, ... )*/
+    virtual std::wstring        getTypeStr()
+    {
+        return L"int64";
+    }
+    /* return type as short string ( s, i, ce, l, ... )*/
+    virtual std::wstring        getShortTypeStr()
+    {
+        return L"i";
+    }
 
-        virtual long long           getNullValue();
-        virtual Int64*              createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
-        virtual long long           copyValue(long long _llData);
-        virtual void                deleteAll();
-        virtual void                deleteImg();
-        virtual long long*          allocData(int _iSize);
-    };
+protected :
+    RealType                               getType(void)
+    {
+        return InternalType::RealInt64;
+    }
+
+private :
+    virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+
+    virtual long long           getNullValue();
+    virtual Int64*              createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
+    virtual long long           copyValue(long long _llData);
+    virtual void                deleteAll();
+    virtual void                deleteImg();
+    virtual long long*          allocData(int _iSize);
+};
 }
 
 #ifdef _MSC_VER
 template class TYPES_IMPEXP types::ArrayOf<long long>; //Int64
 #endif
-
 #endif /* !__INT64_HXX__ */
index 9ab8989..958624c 100644 (file)
 
 namespace types
 {
-    class TYPES_IMPEXP Int8 : public ArrayOf<char>
-    {
-    public :
-                                    Int8(char _cVal);
-                                    Int8(int _iRows, int _iCols);
-                                    Int8(int _iDims, int* _piDims);
-                                    Int8(int _iRows, int _iCols, char** _pcData);
-                                    ~Int8();
-
-        InternalType*               clone();
-
+class TYPES_IMPEXP Int8 : public ArrayOf<char>
+{
+public :
+    Int8(char _cVal);
+    Int8(int _iRows, int _iCols);
+    Int8(int _iDims, int* _piDims);
+    Int8(int _iRows, int _iCols, char** _pcData);
+    ~Int8();
 
-        /*Config management*/
-        void                        whoAmI();
+    InternalType*               clone();
 
-        bool                        isInt() { return true; }
-        bool                        isInt8() { return true; }
 
-        bool                        operator==(const InternalType& it);
-        bool                        operator!=(const InternalType& it);
+    /*Config management*/
+    void                        whoAmI();
 
-        /* return type as string ( double, int, cell, list, ... )*/
-        virtual std::wstring        getTypeStr() {return L"int8";}
-        /* return type as short string ( s, i, ce, l, ... )*/
-        virtual std::wstring        getShortTypeStr() {return L"i";}
+    bool                        isInt()
+    {
+        return true;
+    }
+    bool                        isInt8()
+    {
+        return true;
+    }
 
-    protected :
-        RealType                                   getType(void){return InternalType::RealInt8;}
+    bool                        operator==(const InternalType& it);
+    bool                        operator!=(const InternalType& it);
 
-    private :
-        virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+    /* return type as string ( double, int, cell, list, ... )*/
+    virtual std::wstring        getTypeStr()
+    {
+        return L"int8";
+    }
+    /* return type as short string ( s, i, ce, l, ... )*/
+    virtual std::wstring        getShortTypeStr()
+    {
+        return L"i";
+    }
 
-        virtual char                getNullValue();
-        virtual Int8*               createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
-        virtual char                copyValue(char _cData);
-        virtual void                deleteAll();
-        virtual void                deleteImg();
-        virtual char*               allocData(int _iSize);
-    };
+protected :
+    RealType                               getType(void)
+    {
+        return InternalType::RealInt8;
+    }
+
+private :
+    virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+
+    virtual char                getNullValue();
+    virtual Int8*               createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
+    virtual char                copyValue(char _cData);
+    virtual void                deleteAll();
+    virtual void                deleteImg();
+    virtual char*               allocData(int _iSize);
+};
 }
 
 #ifdef _MSC_VER
 template class TYPES_IMPEXP types::ArrayOf<char>; //Int8
 #endif
-
 #endif /* !__INT8_HXX__ */
index 2529c9e..78dee45 100644 (file)
@@ -44,65 +44,65 @@ struct UndefinedAccessorForType {};
    @return : the value of type V at row r and column c of structure s
 */
 
-template<typename V, typename S> V get(S CONST&, int, int)
+template<typename V, typename S> V get(S SPARSE_CONST&, int, int)
 {
     return UndefinedAccessorForType<S>();
 }
 
-template<> double get(types::Double CONST& d, int r, int c)
+template<> double get(types::Double SPARSE_CONST& d, int r, int c)
 {
     return d.getReal(r, c);
 }
-template<> std::complex<double> get(types::Double CONST& d, int r, int c)
+template<> std::complex<double> get(types::Double SPARSE_CONST& d, int r, int c)
 {
     return std::complex<double>(d.getReal(r, c), d.getImg(r, c));
 }
 
-template<> bool get(types::Bool CONST& d, int r, int c)
+template<> bool get(types::Bool SPARSE_CONST& d, int r, int c)
 {
     return d.get(r, c) == 1;
 }
-template<> int get(types::Bool CONST& d, int r, int c)
+template<> int get(types::Bool SPARSE_CONST& d, int r, int c)
 {
     return d.get(r, c);
 }
-template<> bool get(types::SparseBool CONST& d, int r, int c)
+template<> bool get(types::SparseBool SPARSE_CONST& d, int r, int c)
 {
     return d.get(r, c);
 }
-template<> int get(types::SparseBool CONST& d, int r, int c)
+template<> int get(types::SparseBool SPARSE_CONST& d, int r, int c)
 {
     return d.get(r, c);
 }
 
-template<> double get(types::Sparse CONST& s, int r, int c)
+template<> double get(types::Sparse SPARSE_CONST& s, int r, int c)
 {
     return s.getReal(r, c);
 }
-template<> std::complex<double> get(types::Sparse CONST& s, int r, int c)
+template<> std::complex<double> get(types::Sparse SPARSE_CONST& s, int r, int c)
 {
     return s.get(r, c);
 }
 
-template<> double get(Eigen::SparseMatrix<double, 0, int> CONST&s, int r, int c)
+template<> double get(Eigen::SparseMatrix<double, 0, int> SPARSE_CONST&s, int r, int c)
 {
     return s.coeff(r, c);
 }
-template<> std::complex<double> get(Eigen::SparseMatrix<double, 0, int> CONST&s, int r, int c)
+template<> std::complex<double> get(Eigen::SparseMatrix<double, 0, int> SPARSE_CONST&s, int r, int c)
 {
     return std::complex<double>(s.coeff(r, c), 0.);
 }
 
-template<> bool get(Eigen::SparseMatrix<bool> CONST& d, int r, int c)
+template<> bool get(Eigen::SparseMatrix<bool> SPARSE_CONST& d, int r, int c)
 {
     return d.coeff(r, c);
 }
 
-template<> double get(Eigen::SparseMatrix<std::complex<double>, 0, int> CONST&s, int r, int c)
+template<> double get(Eigen::SparseMatrix<std::complex<double>, 0, int> SPARSE_CONST&s, int r, int c)
 {
     return s.coeff(r, c).real();
 }
-template<> std::complex<double> get(Eigen::SparseMatrix<std::complex<double>, 0, int> CONST&s, int r, int c)
+template<> std::complex<double> get(Eigen::SparseMatrix<std::complex<double>, 0, int> SPARSE_CONST&s, int r, int c)
 {
     return s.coeff(r, c);
 }
@@ -212,44 +212,44 @@ template<> bool set(Eigen::SparseMatrix<bool>& s, int r, int c, bool v)
 
 
 
-template<typename S> int rows(S CONST&s)
+template<typename S> int rows(S SPARSE_CONST&s)
 {
     return s.rows();
 }
-template<typename S> int cols(S CONST&s)
+template<typename S> int cols(S SPARSE_CONST&s)
 {
     return s.cols();
 }
 
-template<> int rows(types::Double CONST&d)
+template<> int rows(types::Double SPARSE_CONST&d)
 {
     return d.getRows();
 }
-template<> int cols(types::Double CONST&d)
+template<> int cols(types::Double SPARSE_CONST&d)
 {
     return d.getCols();
 }
-template<> int rows(types::Sparse CONST&s)
+template<> int rows(types::Sparse SPARSE_CONST&s)
 {
     return s.getRows();
 }
-template<> int cols(types::Sparse CONST&s)
+template<> int cols(types::Sparse SPARSE_CONST&s)
 {
     return s.getCols();
 }
-template<> int rows(types::Bool CONST&s)
+template<> int rows(types::Bool SPARSE_CONST&s)
 {
     return s.getRows();
 }
-template<> int cols(types::Bool CONST&s)
+template<> int cols(types::Bool SPARSE_CONST&s)
 {
     return s.getCols();
 }
-template<> int rows(types::SparseBool CONST&s)
+template<> int rows(types::SparseBool SPARSE_CONST&s)
 {
     return s.getRows();
 }
-template<> int cols(types::SparseBool CONST&s)
+template<> int cols(types::SparseBool SPARSE_CONST&s)
 {
     return s.getCols();
 }
@@ -262,8 +262,8 @@ template<> int cols(types::SparseBool CONST&s)
    @param s : 2D structure to query
    @return : nb of rows
 */
-template<typename S> inline int rows(S CONST&s);
-template<> inline int rows(types::Double CONST&d);
+template<typename S> inline int rows(S SPARSE_CONST&s);
+template<> inline int rows(types::Double SPARSE_CONST&d);
 
 /**
   These free function overloads handle nb of cols size queries for 2D containers
@@ -271,8 +271,8 @@ template<> inline int rows(types::Double CONST&d);
    @param s : 2D structure to query
    @return : nb of cols
 */
-template<typename S> inline int cols(S CONST&s);
-template<> inline int cols(types::Double CONST&d);
+template<typename S> inline int cols(S SPARSE_CONST&s);
+template<> inline int cols(types::Double SPARSE_CONST&d);
 
 /* this proxy struct provides read and write access (using set and get)
    with the usual operators (operator*() and operator=() )*/
@@ -288,7 +288,7 @@ template<typename S, typename V> struct Accessor
        read accessor as a casting operator
        @return : value of s at (r,c)
      */
-    operator V() CONST
+    operator V() SPARSE_CONST
     {
         //        std::cerr<<"reading "<<get<S,V>(s, r, c)<<" @("<<r<<","<<c<<")\n";
         return ::get<V>(s, r, c);
@@ -478,7 +478,7 @@ private:
  */
 template<bool AsVector = false> struct Coords : Coords2DIterator
 {
-    Coords(int CONST* coords, int unused = 0): coords(coords)
+    Coords(int SPARSE_CONST* coords, int unused = 0): coords(coords)
     {
     }
 
@@ -509,7 +509,7 @@ private:
  */
 template<> struct Coords<true> : Coords2DIterator
 {
-    Coords(int CONST* coords, int rMax): coords(coords), rMax(rMax)
+    Coords(int SPARSE_CONST* coords, int rMax): coords(coords), rMax(rMax)
     {
     }
 
@@ -593,15 +593,15 @@ Out mycopy_n(In i, Sz n, Out o)
     return o;
 }
 
-template<typename T> std::size_t nonZeros(T CONST& t)
+template<typename T> std::size_t nonZeros(T SPARSE_CONST& t)
 {
     return t.getSize();
 }
-template<> std::size_t nonZeros(types::Sparse CONST& sp)
+template<> std::size_t nonZeros(types::Sparse SPARSE_CONST& sp)
 {
     return sp.nonZeros();
 }
-template<typename Scalar, int Options, typename Index> std::size_t nonZeros(Eigen::SparseMatrix<Scalar, Options, Index> CONST& sp)
+template<typename Scalar, int Options, typename Index> std::size_t nonZeros(Eigen::SparseMatrix<Scalar, Options, Index> SPARSE_CONST& sp)
 {
     return sp.nonZeros();
 }
@@ -609,11 +609,11 @@ template<typename Scalar, int Options, typename Index> std::size_t nonZeros(Eige
 
 /* Default for dense matrix Scilab matrix types
  */
-template<typename D> RowWiseFullIterator makeNonZerosIterator(D CONST& d)
+template<typename D> RowWiseFullIterator makeNonZerosIterator(D SPARSE_CONST& d)
 {
     return RowWiseFullIterator(d.getRows(), d.getCols());
 }
-template<typename Scalar, int Options, typename Index> RowWiseSparseIterator<Eigen::SparseMatrix<Scalar, Options, Index> > makeNonZerosIterator(Eigen::SparseMatrix<Scalar, Options, Index> CONST& sp)
+template<typename Scalar, int Options, typename Index> RowWiseSparseIterator<Eigen::SparseMatrix<Scalar, Options, Index> > makeNonZerosIterator(Eigen::SparseMatrix<Scalar, Options, Index> SPARSE_CONST& sp)
 {
     return RowWiseSparseIterator<Eigen::SparseMatrix<Scalar, Options, Index> >(sp);
 }
index 3a9382d..2197f97 100644 (file)
@@ -28,6 +28,9 @@
 #include "dynlib_types.h"
 #include "dynlib_types.h"
 
+//disable warnings about exports STL items
+#pragma warning (disable : 4251)
+
 namespace types
 {
 class TYPES_IMPEXP Polynom : public ArrayOf<SinglePoly*>
@@ -108,5 +111,4 @@ private :
 #ifdef _MSC_VER
 template class TYPES_IMPEXP types::ArrayOf<types::SinglePoly*>; //Polynom
 #endif
-
 #endif /* !__POLYNOM_HXX__ */
index 0b79240..c13525d 100644 (file)
@@ -18,7 +18,7 @@
 #include "double.hxx"
 #include "bool.hxx"
 
-#define CONST
+#define SPARSE_CONST
 
 #include "dynlib_types.h"
 
@@ -40,16 +40,16 @@ struct TYPES_IMPEXP Sparse : GenericType
     virtual ~Sparse();
     /* @param src: Double matrix to copy into a new sparse matrix
     **/
-    Sparse(Double CONST& src);
+    Sparse(Double SPARSE_CONST& src);
     /* @param src : Double matrix to copy into a new sparse matrix
        @param idx : Double matrix to use as indexes to get values from the src
     **/
-    Sparse(Double CONST& src, Double CONST& idx);
+    Sparse(Double SPARSE_CONST& src, Double SPARSE_CONST& idx);
     /* @param src : Double matrix to copy into a new sparse matrix
        @param idx : Double matrix to use as indexes to get values from the src
        @param dims : Double matrix containing the dimensions of the new matrix
     **/
-    Sparse(Double CONST& src, Double CONST& idx, Double CONST& dims);
+    Sparse(Double SPARSE_CONST& src, Double SPARSE_CONST& idx, Double SPARSE_CONST& dims);
     /*
       @param rows : nb of rows of the new matrix
       @param rows : nb of columns of the new matrix
@@ -64,7 +64,7 @@ struct TYPES_IMPEXP Sparse : GenericType
       @param r : nb of rows for the new matrix
       @param c : nb of columns for the new matrix
     **/
-    Sparse(Double CONST& xadj, Double CONST& adjncy, Double CONST& src, std::size_t r, std::size_t c);
+    Sparse(Double SPARSE_CONST& xadj, Double SPARSE_CONST& adjncy, Double SPARSE_CONST& src, std::size_t r, std::size_t c);
 
 
     bool isSparse()
@@ -136,7 +136,7 @@ struct TYPES_IMPEXP Sparse : GenericType
     /*
       Config management and GenericType methods overrides
     */
-    void whoAmI() CONST;
+    void whoAmI() SPARSE_CONST;
     bool isExtract() const;
     Sparse* clone(void) const;
     Sparse* clone(void)
@@ -189,7 +189,7 @@ struct TYPES_IMPEXP Sparse : GenericType
        @param _iCols col to append from
        @param _poSource src data to append
      */
-    bool append(int r, int c, types::Sparse CONST* src);
+    bool append(int r, int c, types::Sparse SPARSE_CONST* src);
 
     /*
       extract a submatrix
@@ -201,7 +201,7 @@ struct TYPES_IMPEXP Sparse : GenericType
 
      */
     InternalType* extract(typed_list* _pArgs);
-    Sparse* extract(int _iSeqCount, int* _piSeqCoord, int* _piMaxDim, int* _piDimSize, bool _bAsVector) CONST;
+    Sparse* extract(int _iSeqCount, int* _piSeqCoord, int* _piMaxDim, int* _piDimSize, bool _bAsVector) SPARSE_CONST;
 
     /*
        change the sign (inplace).
@@ -212,21 +212,21 @@ struct TYPES_IMPEXP Sparse : GenericType
       compares with an other value for equality (same nb of elts, with same values)
       TODO: should it handle other types ?
      */
-    bool operator==(const InternalType& it) CONST;
+    bool operator==(const InternalType& it) SPARSE_CONST;
     /*
       compares with an other value for inequality (same nb of elts, with same values)
       TODO: should it handle other types ?
      */
-    bool operator!=(const InternalType& it) CONST
+    bool operator!=(const InternalType& it) SPARSE_CONST
     {
         return !(*this == it);
     }
 
 
     /* return type as string ( double, int, cell, list, ... )*/
-    virtual std::wstring         getTypeStr() CONST {return std::wstring(L"sparse");}
+    virtual std::wstring         getTypeStr() SPARSE_CONST {return std::wstring(L"sparse");}
     /* return type as short string ( s, i, ce, l, ... ), as in overloading macros*/
-    virtual std::wstring         getShortTypeStr() CONST {return std::wstring(L"sp");}
+    virtual std::wstring         getShortTypeStr() SPARSE_CONST {return std::wstring(L"sp");}
 
     /* create a new sparse matrix containing the result of an addition
        @param o other matrix to add
@@ -290,7 +290,7 @@ struct TYPES_IMPEXP Sparse : GenericType
        @param o sparse matrix to .*
        @return ptr to the new matrix, 0 in case of failure
      */
-    Sparse* dotMultiply(Sparse CONST& o) const;
+    Sparse* dotMultiply(Sparse SPARSE_CONST& o) const;
 
     /* create a new sparse matrix containing the result of a transposition
        @return ptr to the new matrix, 0 in case of failure
@@ -425,10 +425,10 @@ struct TYPES_IMPEXP Sparse : GenericType
     /**
        @param dest Double to be filled with values from the current sparse matrix.
      */
-    void fill(Double& dest, int r = 0, int c = 0) CONST;
+    void fill(Double& dest, int r = 0, int c = 0) SPARSE_CONST;
 
 
-    RealType getType(void) CONST;
+    RealType getType(void) SPARSE_CONST;
 
 
     SparseBool* newLesserThan(Sparse const&o);
@@ -456,7 +456,7 @@ private :
         @param n : nb of elements to copy from data source.
      */
     template<typename DestIter>
-    void create(int rows, int cols, Double CONST& src, DestIter o, std::size_t n);
+    void create(int rows, int cols, Double SPARSE_CONST& src, DestIter o, std::size_t n);
 
     /** utility function used by insert functions conceptually : sp[destTrav]= src[srcTrav]
         @param src : data source
@@ -466,7 +466,7 @@ private :
         @param destTrav : iterator over the data sink (i.e. sp)
      */
     template<typename Src, typename SrcTraversal, typename Sz, typename DestTraversal>
-    static bool copyToSparse(Src CONST& src, SrcTraversal srcTrav, Sz n, Sparse& sp, DestTraversal destTrav);
+    static bool copyToSparse(Src SPARSE_CONST& src, SrcTraversal srcTrav, Sz n, Sparse& sp, DestTraversal destTrav);
 };
 /*
   Implement sparse boolean matrix
@@ -476,16 +476,16 @@ struct TYPES_IMPEXP SparseBool : GenericType
 
     /* @param src: Bool matrix to copy into a new sparse matrix
     **/
-    SparseBool(Bool CONST& src);
+    SparseBool(Bool SPARSE_CONST& src);
     /* @param src : Bool matrix to copy into a new sparse matrix
        @param idx : Double matrix to use as indexes to get values from the src
     **/
-    SparseBool(Bool CONST& src, Double CONST& idx);
+    SparseBool(Bool SPARSE_CONST& src, Double SPARSE_CONST& idx);
     /* @param src : Bool matrix to copy into a new sparse matrix
        @param idx : Double matrix to use as indexes to get values from the src
        @param dims : Double matrix containing the dimensions of the new matrix
     **/
-    SparseBool(Bool CONST& src, Double CONST& idx, Double CONST& dims);
+    SparseBool(Bool SPARSE_CONST& src, Double SPARSE_CONST& idx, Double SPARSE_CONST& dims);
     /*
        @param rows : nb of rows of the new matrix
        @param rows : nb of columns of the new matrix
@@ -521,10 +521,10 @@ struct TYPES_IMPEXP SparseBool : GenericType
     SparseBool* insert(typed_list* _pArgs, SparseBool* _pSource);
     SparseBool* remove(typed_list* _pArgs);
 
-    bool append(int _iRows, int _iCols, SparseBool CONST* _poSource);
+    bool append(int _iRows, int _iCols, SparseBool SPARSE_CONST* _poSource);
 
     static InternalType* insertNew(typed_list* _pArgs, InternalType* _pSource);
-    SparseBool* extract(int _iSeqCount, int* _piSeqCoord, int* _piMaxDim, int* _piDimSize, bool _bAsVector) CONST;
+    SparseBool* extract(int _iSeqCount, int* _piSeqCoord, int* _piMaxDim, int* _piDimSize, bool _bAsVector) SPARSE_CONST;
     InternalType* extract(typed_list* _pArgs);
 
     SparseBool* getColumnValues(int _iPos)
@@ -555,36 +555,36 @@ struct TYPES_IMPEXP SparseBool : GenericType
 
     int* outputRowCol(int* out)const;
 
-    bool operator==(const InternalType& it) CONST;
-    bool operator!=(const InternalType& it) CONST;
+    bool operator==(const InternalType& it) SPARSE_CONST;
+    bool operator!=(const InternalType& it) SPARSE_CONST;
 
     /* return type as string ( double, int, cell, list, ... )*/
-    virtual std::wstring getTypeStr() CONST {return std::wstring(L"boolean sparse");}
+    virtual std::wstring getTypeStr() SPARSE_CONST {return std::wstring(L"boolean sparse");}
     /* return type as short string ( s, i, ce, l, ... )*/
-    virtual std::wstring getShortTypeStr() CONST {return std::wstring(L"spb");}
+    virtual std::wstring getShortTypeStr() SPARSE_CONST {return std::wstring(L"spb");}
 
-    RealType getType(void) CONST;
+    RealType getType(void) SPARSE_CONST;
 
     bool isScalar()
     {
         return (getRows() == 1 && getCols() == 1);
     }
 
-    void whoAmI() CONST;
+    void whoAmI() SPARSE_CONST;
 
-    bool get(int r, int c) CONST;
-    bool get(int _iIndex) CONST
+    bool get(int r, int c) SPARSE_CONST;
+    bool get(int _iIndex) SPARSE_CONST
     {
         return get(_iIndex % m_iRows, _iIndex / m_iRows);
     }
 
-    bool set(int r, int c, bool b, bool _bFinalize = true) CONST;
-    bool set(int _iIndex, bool b, bool _bFinalize = true) CONST
+    bool set(int r, int c, bool b, bool _bFinalize = true) SPARSE_CONST;
+    bool set(int _iIndex, bool b, bool _bFinalize = true) SPARSE_CONST
     {
         return set(_iIndex % m_iRows, _iIndex / m_iRows, b, _bFinalize);
     }
 
-    void fill(Bool& dest, int r = 0, int c = 0) CONST;
+    void fill(Bool& dest, int r = 0, int c = 0) SPARSE_CONST;
 
     Sparse* newOnes() const;
     SparseBool* newNotEqualTo(SparseBool const&o) const;
@@ -599,7 +599,7 @@ struct TYPES_IMPEXP SparseBool : GenericType
 
 private:
     template<typename DestIter>
-    void create(int rows, int cols, Bool CONST& src, DestIter o, std::size_t n);
+    void create(int rows, int cols, Bool SPARSE_CONST& src, DestIter o, std::size_t n);
 
 };
 template<typename T>
index 2727849..ffaf942 100644 (file)
 
 namespace types
 {
-    class TYPES_IMPEXP String : public ArrayOf<wchar_t*>
-    {
-    public :
-                                String(int _iRows, int _iCols);
-                                String(int _iDims, int* _piDims);
-                                String(int _iRows, int _iCols, wchar_t** _pstData);
-                                String(const wchar_t *_pstData);
-                               String(const char *_pstData);
-        virtual                 ~String();
+class TYPES_IMPEXP String : public ArrayOf<wchar_t*>
+{
+public :
+    String(int _iRows, int _iCols);
+    String(int _iDims, int* _piDims);
+    String(int _iRows, int _iCols, wchar_t** _pstData);
+    String(const wchar_t *_pstData);
+    String(const char *_pstData);
+    virtual                 ~String();
 
-        void                    whoAmI();
+    void                    whoAmI();
 
-        virtual bool            set(int _iPos, wchar_t* _pwstData);
-        virtual bool            set(int _iPos, const wchar_t* _pwstData);
-        virtual bool            set(int _iRows, int _iCols, const wchar_t* _pwstData);
-        virtual bool            set(int _iRows, int _iCols, wchar_t* _pwstData);
-        virtual bool            set(wchar_t** _pwstData);
+    virtual bool            set(int _iPos, wchar_t* _pwstData);
+    virtual bool            set(int _iPos, const wchar_t* _pwstData);
+    virtual bool            set(int _iRows, int _iCols, const wchar_t* _pwstData);
+    virtual bool            set(int _iRows, int _iCols, wchar_t* _pwstData);
+    virtual bool            set(wchar_t** _pwstData);
 
-        bool                    operator==(const InternalType& it);
-        bool                    operator!=(const InternalType& it);
+    bool                    operator==(const InternalType& it);
+    bool                    operator!=(const InternalType& it);
 
-        bool                    subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
-        /* return type as string ( double, int, cell, list, ... )*/
-        virtual std::wstring    getTypeStr() {return L"string";}
-        /* return type as short string ( s, i, ce, l, ... )*/
-        virtual std::wstring    getShortTypeStr() {return L"c";}
-        InternalType*           clone();
+    bool                    subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+    /* return type as string ( double, int, cell, list, ... )*/
+    virtual std::wstring    getTypeStr()
+    {
+        return L"string";
+    }
+    /* return type as short string ( s, i, ce, l, ... )*/
+    virtual std::wstring    getShortTypeStr()
+    {
+        return L"c";
+    }
+    InternalType*           clone();
 
-        RealType                getType();//                   { return RealString; }
-        bool                    isString() { return true; }
+    RealType                getType();//                       { return RealString; }
+    bool                    isString()
+    {
+        return true;
+    }
 
-    private :
-        void                    deleteString(int _iRows, int _iCols);
-        void                    deleteString(int _iPos);
+private :
+    void                    deleteString(int _iRows, int _iCols);
+    void                    deleteString(int _iPos);
 
-        void                    createString(int _iDims, int* _piDims);
-        virtual wchar_t*        copyValue(wchar_t* _pwstData);
-        virtual wchar_t*        copyValue(const wchar_t* _pwstData);
-        virtual String*         createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
-        virtual wchar_t*        getNullValue();
-        virtual void            deleteAll();
-        virtual void            deleteImg();
-        virtual wchar_t**       allocData(int _iSize);
-    };
+    void                    createString(int _iDims, int* _piDims);
+    virtual wchar_t*        copyValue(wchar_t* _pwstData);
+    virtual wchar_t*        copyValue(const wchar_t* _pwstData);
+    virtual String*         createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
+    virtual wchar_t*        getNullValue();
+    virtual void            deleteAll();
+    virtual void            deleteImg();
+    virtual wchar_t**       allocData(int _iSize);
+};
 }
 
 #ifdef _MSC_VER
 template class TYPES_IMPEXP types::ArrayOf<wchar_t*>; //String
 #endif
-
 #endif /* !__STRING_HXX__ */
index 1c459b3..c9e0cc3 100644 (file)
@@ -106,5 +106,4 @@ private :
 #ifdef _MSC_VER
 template class TYPES_IMPEXP types::ArrayOf<types::SingleStruct*>; //Struct
 #endif
-
 #endif /* !__STRUCT_HXX__ */
index d47eeee..75e6960 100644 (file)
 
 namespace types
 {
-    class TYPES_IMPEXP UInt16 : public ArrayOf<unsigned short>
-    {
-    public :
-                                    UInt16(unsigned short _usVal);
-                                    UInt16(int _iRows, int _iCols);
-                                    UInt16(int _iDims, int* _piDims);
-                                    UInt16(int _iRows, int _iCols, unsigned short** _pusData);
-                                    ~UInt16();
-
-        InternalType*               clone();
-
+class TYPES_IMPEXP UInt16 : public ArrayOf<unsigned short>
+{
+public :
+    UInt16(unsigned short _usVal);
+    UInt16(int _iRows, int _iCols);
+    UInt16(int _iDims, int* _piDims);
+    UInt16(int _iRows, int _iCols, unsigned short** _pusData);
+    ~UInt16();
 
-        /*Config management*/
-        void                        whoAmI();
+    InternalType*               clone();
 
-        bool                        isInt() { return true; }
-        bool                        isUInt16() { return true; }
 
-        bool                        operator==(const InternalType& it);
-        bool                        operator!=(const InternalType& it);
+    /*Config management*/
+    void                        whoAmI();
 
-        /* return type as string ( double, int, cell, list, ... )*/
-        virtual std::wstring        getTypeStr() {return L"uint16";}
-        /* return type as short string ( s, i, ce, l, ... )*/
-        virtual std::wstring        getShortTypeStr() {return L"i";}
+    bool                        isInt()
+    {
+        return true;
+    }
+    bool                        isUInt16()
+    {
+        return true;
+    }
 
-    protected :
-        RealType                                   getType(void){return InternalType::RealUInt16;}
+    bool                        operator==(const InternalType& it);
+    bool                        operator!=(const InternalType& it);
 
-    private :
-        virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+    /* return type as string ( double, int, cell, list, ... )*/
+    virtual std::wstring        getTypeStr()
+    {
+        return L"uint16";
+    }
+    /* return type as short string ( s, i, ce, l, ... )*/
+    virtual std::wstring        getShortTypeStr()
+    {
+        return L"i";
+    }
 
-        virtual unsigned short      getNullValue();
-        virtual UInt16*             createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
-        virtual unsigned short      copyValue(unsigned short _usData);
-        virtual void                deleteAll();
-        virtual void                deleteImg();
-        virtual unsigned short*     allocData(int _iSize);
-    };
+protected :
+    RealType                               getType(void)
+    {
+        return InternalType::RealUInt16;
+    }
+
+private :
+    virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+
+    virtual unsigned short      getNullValue();
+    virtual UInt16*             createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
+    virtual unsigned short      copyValue(unsigned short _usData);
+    virtual void                deleteAll();
+    virtual void                deleteImg();
+    virtual unsigned short*     allocData(int _iSize);
+};
 }
 
 #ifdef _MSC_VER
 template class TYPES_IMPEXP types::ArrayOf<unsigned short>; //UInt16
 #endif
-
 #endif /* !__UINT16_HXX__ */
index edd2075..47215f8 100644 (file)
 
 namespace types
 {
-    class TYPES_IMPEXP UInt32 : public ArrayOf<unsigned int>
-    {
-    public :
-                                    UInt32(unsigned int _uiVal);
-                                    UInt32(int _iRows, int _iCols);
-                                    UInt32(int _iDims, int* _piDims);
-                                    UInt32(int _iRows, int _iCols, unsigned int** _puiData);
-                                    ~UInt32();
-
-        InternalType*               clone();
-
+class TYPES_IMPEXP UInt32 : public ArrayOf<unsigned int>
+{
+public :
+    UInt32(unsigned int _uiVal);
+    UInt32(int _iRows, int _iCols);
+    UInt32(int _iDims, int* _piDims);
+    UInt32(int _iRows, int _iCols, unsigned int** _puiData);
+    ~UInt32();
 
-        /*Config management*/
-        void                        whoAmI();
+    InternalType*               clone();
 
-        bool                        isInt() { return true; }
-        bool                        isUInt32() { return true; }
 
-        bool                        operator==(const InternalType& it);
-        bool                        operator!=(const InternalType& it);
+    /*Config management*/
+    void                        whoAmI();
 
-        /* return type as string ( double, int, cell, list, ... )*/
-        virtual std::wstring        getTypeStr() {return L"uint32";}
-        /* return type as short string ( s, i, ce, l, ... )*/
-        virtual std::wstring        getShortTypeStr() {return L"i";}
+    bool                        isInt()
+    {
+        return true;
+    }
+    bool                        isUInt32()
+    {
+        return true;
+    }
 
-    protected :
-        RealType                                   getType(void){return InternalType::RealUInt32;}
+    bool                        operator==(const InternalType& it);
+    bool                        operator!=(const InternalType& it);
 
-    private :
-        virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+    /* return type as string ( double, int, cell, list, ... )*/
+    virtual std::wstring        getTypeStr()
+    {
+        return L"uint32";
+    }
+    /* return type as short string ( s, i, ce, l, ... )*/
+    virtual std::wstring        getShortTypeStr()
+    {
+        return L"i";
+    }
 
-        virtual unsigned int        getNullValue();
-        virtual UInt32*             createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
-        virtual unsigned int        copyValue(unsigned int _uiData);
-        virtual void                deleteAll();
-        virtual void                deleteImg();
-        virtual unsigned int*       allocData(int _iSize);
-    };
+protected :
+    RealType                               getType(void)
+    {
+        return InternalType::RealUInt32;
+    }
+
+private :
+    virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+
+    virtual unsigned int        getNullValue();
+    virtual UInt32*             createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
+    virtual unsigned int        copyValue(unsigned int _uiData);
+    virtual void                deleteAll();
+    virtual void                deleteImg();
+    virtual unsigned int*       allocData(int _iSize);
+};
 }
 
 #ifdef _MSC_VER
 template class TYPES_IMPEXP types::ArrayOf<unsigned int>;//UInt32
 #endif
-
 #endif /* !__UINT32_HXX__ */
index 5c08add..62caa9c 100644 (file)
 
 namespace types
 {
-    class TYPES_IMPEXP UInt64 : public ArrayOf<unsigned long long>
-    {
-    public :
-                                    UInt64(unsigned long long _ullVal);
-                                    UInt64(int _iRows, int _iCols);
-                                    UInt64(int _iDims, int* _piDims);
-                                    UInt64(int _iRows, int _iCols, unsigned long long** _pullData);
-                                    ~UInt64();
-
-        InternalType*               clone();
-
+class TYPES_IMPEXP UInt64 : public ArrayOf<unsigned long long>
+{
+public :
+    UInt64(unsigned long long _ullVal);
+    UInt64(int _iRows, int _iCols);
+    UInt64(int _iDims, int* _piDims);
+    UInt64(int _iRows, int _iCols, unsigned long long** _pullData);
+    ~UInt64();
 
-        /*Config management*/
-        void                        whoAmI();
+    InternalType*               clone();
 
-        bool                        isInt() { return true; }
-        bool                        isUInt64() { return true; }
 
-        bool                        operator==(const InternalType& it);
-        bool                        operator!=(const InternalType& it);
+    /*Config management*/
+    void                        whoAmI();
 
-        /* return type as string ( double, int, cell, list, ... )*/
-        virtual std::wstring        getTypeStr() {return L"uint64";}
-        /* return type as short string ( s, i, ce, l, ... )*/
-        virtual std::wstring        getShortTypeStr() {return L"i";}
+    bool                        isInt()
+    {
+        return true;
+    }
+    bool                        isUInt64()
+    {
+        return true;
+    }
 
-    protected :
-        RealType                                   getType(void){return InternalType::RealUInt64;}
+    bool                        operator==(const InternalType& it);
+    bool                        operator!=(const InternalType& it);
 
-    private :
-        virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+    /* return type as string ( double, int, cell, list, ... )*/
+    virtual std::wstring        getTypeStr()
+    {
+        return L"uint64";
+    }
+    /* return type as short string ( s, i, ce, l, ... )*/
+    virtual std::wstring        getShortTypeStr()
+    {
+        return L"i";
+    }
 
-        virtual unsigned long long  getNullValue();
-        virtual UInt64*             createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
-        virtual unsigned long long  copyValue(unsigned long long _ullData);
-        virtual void                deleteAll();
-        virtual void                deleteImg();
-        virtual unsigned long long* allocData(int _iSize);
-    };
+protected :
+    RealType                               getType(void)
+    {
+        return InternalType::RealUInt64;
+    }
+
+private :
+    virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+
+    virtual unsigned long long  getNullValue();
+    virtual UInt64*             createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
+    virtual unsigned long long  copyValue(unsigned long long _ullData);
+    virtual void                deleteAll();
+    virtual void                deleteImg();
+    virtual unsigned long long* allocData(int _iSize);
+};
 }
 
 #ifdef _MSC_VER
 template class TYPES_IMPEXP types::ArrayOf<unsigned long long>; //UInt64
 #endif
-
 #endif /* !__UINT64_HXX__ */
index eb56c38..d57b360 100644 (file)
 
 namespace types
 {
-    class TYPES_IMPEXP UInt8 : public ArrayOf<unsigned char>
-    {
-    public :
-                                    UInt8(unsigned char _ucVal);
-                                    UInt8(int _iRows, int _iCols);
-                                    UInt8(int _iDims, int* _piDims);
-                                    UInt8(int _iRows, int _iCols, unsigned char** _pucData);
-                                    ~UInt8();
-
-        InternalType*               clone();
-
+class TYPES_IMPEXP UInt8 : public ArrayOf<unsigned char>
+{
+public :
+    UInt8(unsigned char _ucVal);
+    UInt8(int _iRows, int _iCols);
+    UInt8(int _iDims, int* _piDims);
+    UInt8(int _iRows, int _iCols, unsigned char** _pucData);
+    ~UInt8();
 
-        /*Config management*/
-        void                        whoAmI();
+    InternalType*               clone();
 
-        bool                        isInt() { return true; }
-        bool                        isUInt8() { return true; }
 
-        bool                        operator==(const InternalType& it);
-        bool                        operator!=(const InternalType& it);
+    /*Config management*/
+    void                        whoAmI();
 
-        /* return type as string ( double, int, cell, list, ... )*/
-        virtual std::wstring        getTypeStr() {return L"uint8";}
-        /* return type as short string ( s, i, ce, l, ... )*/
-        virtual std::wstring        getShortTypeStr() {return L"i";}
+    bool                        isInt()
+    {
+        return true;
+    }
+    bool                        isUInt8()
+    {
+        return true;
+    }
 
-    protected :
-        RealType                                   getType(void){return InternalType::RealUInt8;}
+    bool                        operator==(const InternalType& it);
+    bool                        operator!=(const InternalType& it);
 
-    private :
-        virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+    /* return type as string ( double, int, cell, list, ... )*/
+    virtual std::wstring        getTypeStr()
+    {
+        return L"uint8";
+    }
+    /* return type as short string ( s, i, ce, l, ... )*/
+    virtual std::wstring        getShortTypeStr()
+    {
+        return L"i";
+    }
 
-        virtual unsigned char       getNullValue();
-        virtual UInt8*              createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
-        virtual unsigned char       copyValue(unsigned char _ucData);
-        virtual void                deleteAll();
-        virtual void                deleteImg();
-        virtual unsigned char*      allocData(int _iSize);
-    };
+protected :
+    RealType                               getType(void)
+    {
+        return InternalType::RealUInt8;
+    }
+
+private :
+    virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+
+    virtual unsigned char       getNullValue();
+    virtual UInt8*              createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
+    virtual unsigned char       copyValue(unsigned char _ucData);
+    virtual void                deleteAll();
+    virtual void                deleteImg();
+    virtual unsigned char*      allocData(int _iSize);
+};
 }
 
 #ifdef _MSC_VER
 template class TYPES_IMPEXP types::ArrayOf<unsigned char>; //UInt8
 #endif
-
 #endif /* !__UINT8_HXX__ */
index fe936b8..bd4735e 100644 (file)
@@ -211,7 +211,7 @@ template<typename T> bool setNonZero(T& s, typename Eigen::internal::traits<T>::
 
 
 template<typename Src, typename Sp>
-void doAppend(Src CONST& src, int r, int c, Sp& dest)
+void doAppend(Src SPARSE_CONST& src, int r, int c, Sp& dest)
 {
     typedef typename Eigen::internal::traits<Sp>::Scalar data_t;
     mycopy_n(makeMatrixIterator<data_t>(src, makeNonZerosIterator(src)), nonZeros(src)
@@ -220,7 +220,7 @@ void doAppend(Src CONST& src, int r, int c, Sp& dest)
 
 // TODO : awaiting ggael's response to bug for [sp, sp]
 template<typename Scalar1, typename Scalar2>
-void doAppend(Eigen::SparseMatrix<Scalar1> CONST& src, int r, int c, Eigen::SparseMatrix<Scalar2>& dest)
+void doAppend(Eigen::SparseMatrix<Scalar1> SPARSE_CONST& src, int r, int c, Eigen::SparseMatrix<Scalar2>& dest)
 {
     typedef typename Eigen::SparseMatrix<Scalar1>::InnerIterator srcIt_t;
     typedef Eigen::SparseMatrix<Scalar2> dest_t;
@@ -236,7 +236,7 @@ void doAppend(Eigen::SparseMatrix<Scalar1> CONST& src, int r, int c, Eigen::Spar
 Sp is an Eigen::SparseMatrix
 */
 template<typename Sp, typename M>
-void cwiseInPlaceProduct(Sp& sp, M CONST& m)
+void cwiseInPlaceProduct(Sp& sp, M SPARSE_CONST& m)
 {
     // should be a transform_n() over makeNonZerosIterator(src)
     for (std::size_t k = 0; k != sp.outerSize(); ++k)
@@ -313,20 +313,20 @@ Sparse::Sparse(int _iRows, int _iCols, bool cplx)
     m_piDims[1] = _iCols;
 }
 
-Sparse::Sparse(Double CONST& src)
+Sparse::Sparse(Double SPARSE_CONST& src)
 {
     create(src.getRows(), src.getCols(), src, RowWiseFullIterator(src.getRows(), src.getCols()), src.getSize());
 }
 
-Sparse::Sparse(Double CONST& src, Double CONST& idx)
+Sparse::Sparse(Double SPARSE_CONST& src, Double SPARSE_CONST& idx)
 {
-    double CONST* const endOfRow(idx.getReal() + idx.getRows());
+    double SPARSE_CONST* const endOfRow(idx.getReal() + idx.getRows());
     create( static_cast<int>(*std::max_element(idx.getReal(), endOfRow))
             , static_cast<int>(*std::max_element(endOfRow, endOfRow + idx.getRows()))
             , src, makeIteratorFromVar(idx), idx.getSize() / 2 );
 }
 
-Sparse::Sparse(Double CONST& src, Double CONST& idx, Double CONST& dims)
+Sparse::Sparse(Double SPARSE_CONST& src, Double SPARSE_CONST& idx, Double SPARSE_CONST& dims)
 {
     create(static_cast<int>(dims.getReal(0, 0))
            , static_cast<int>(dims.getReal(0, 1))
@@ -351,14 +351,14 @@ Sparse::Sparse(RealSparse_t* realSp, CplxSparse_t* cplxSp):  matrixReal(realSp),
     m_piDims[1] = m_iCols;
 }
 
-Sparse::Sparse(Double CONST& xadj, Double CONST& adjncy, Double CONST& src, std::size_t r, std::size_t c)
+Sparse::Sparse(Double SPARSE_CONST& xadj, Double SPARSE_CONST& adjncy, Double SPARSE_CONST& src, std::size_t r, std::size_t c)
 {
     Adjacency a(xadj.getReal(), adjncy.getReal());
     create(static_cast<int>(r), static_cast<int>(c), src, makeIteratorFromVar(a), src.getSize());
 }
 
 template<typename DestIter>
-void Sparse::create(int rows, int cols, Double CONST& src, DestIter o, std::size_t n)
+void Sparse::create(int rows, int cols, Double SPARSE_CONST& src, DestIter o, std::size_t n)
 {
     m_iCols = cols;
     m_iRows = rows;
@@ -385,7 +385,7 @@ void Sparse::create(int rows, int cols, Double CONST& src, DestIter o, std::size
     finalize();
 }
 
-void Sparse::fill(Double& dest, int r, int c) CONST
+void Sparse::fill(Double& dest, int r, int c) SPARSE_CONST
 {
     Sparse & cthis(const_cast<Sparse&>(*this));
     if (isComplex())
@@ -502,7 +502,7 @@ std::complex<double> Sparse::getImg(int _iRows, int _iCols) const
     return res;
 }
 
-void Sparse::whoAmI() CONST
+void Sparse::whoAmI() SPARSE_CONST
 {
     std::cout << "types::Sparse";
 }
@@ -512,7 +512,7 @@ Sparse* Sparse::clone(void) const
     return new Sparse(*this);
 }
 
-GenericType::RealType Sparse::getType(void) CONST
+GenericType::RealType Sparse::getType(void) SPARSE_CONST
 {
     return RealSparse;
 }
@@ -646,7 +646,7 @@ bool Sparse::resize(int _iNewRows, int _iNewCols)
 }
 // TODO decide if a complex matrix with 0 imag can be == to a real matrix
 // not true for dense (cf double.cpp)
-bool Sparse::operator==(const InternalType& it) CONST
+bool Sparse::operator==(const InternalType& it) SPARSE_CONST
 {
     Sparse* otherSparse = const_cast<Sparse*>(dynamic_cast<Sparse const*>(&it));/* types::GenericType is not const-correct :( */
     Sparse & cthis (const_cast<Sparse&>(*this));
@@ -1369,7 +1369,7 @@ Sparse* Sparse::remove(typed_list* _pArgs)
     return pOut;
 }
 
-bool Sparse::append(int r, int c, types::Sparse CONST* src)
+bool Sparse::append(int r, int c, types::Sparse SPARSE_CONST* src)
 {
     //        std::wcerr << L"to a sparse of size"<<getRows() << L","<<getCols() << L" should append @"<<r << L","<<c<< "a sparse:"<< src->toString(32,80)<<std::endl;
     if (src->isComplex())
@@ -1527,7 +1527,7 @@ InternalType* Sparse::extract(typed_list* _pArgs)
     return pOut;
 }
 
-Sparse* Sparse::extract(int nbCoords, int CONST* coords, int CONST* maxCoords, int CONST* resSize, bool asVector) CONST
+Sparse* Sparse::extract(int nbCoords, int SPARSE_CONST* coords, int SPARSE_CONST* maxCoords, int SPARSE_CONST* resSize, bool asVector) SPARSE_CONST
 {
     if ( (asVector && maxCoords[0] > getSize()) ||
     (asVector == false && maxCoords[0] > getRows()) ||
@@ -1563,7 +1563,7 @@ coords are Scilab 1-based
 extract std::make_pair(coords, asVector), rowIter
 */
 template<typename Src, typename SrcTraversal, typename Sz, typename DestTraversal>
-bool Sparse::copyToSparse(Src CONST& src, SrcTraversal srcTrav, Sz n, Sparse& sp, DestTraversal destTrav)
+bool Sparse::copyToSparse(Src SPARSE_CONST& src, SrcTraversal srcTrav, Sz n, Sparse& sp, DestTraversal destTrav)
 {
     if (!(src.isComplex() || sp.isComplex()))
     {
@@ -1673,7 +1673,7 @@ Sparse* Sparse::multiply(Sparse const& o) const
     return new Sparse(realSp, cplxSp);
 }
 
-Sparse* Sparse::dotMultiply(Sparse CONST& o) const
+Sparse* Sparse::dotMultiply(Sparse SPARSE_CONST& o) const
 {
     RealSparse_t* realSp(0);
     CplxSparse_t* cplxSp(0);
@@ -2054,16 +2054,16 @@ bool Sparse::reshape(int _iNewRows, int _iNewCols)
 
 //    SparseBool* SparseBool::new
 
-SparseBool::SparseBool(Bool CONST& src)
+SparseBool::SparseBool(Bool SPARSE_CONST& src)
 {
     create(src.getRows(), src.getCols(), src, RowWiseFullIterator(src.getRows(), src.getCols()), src.getSize());
 }
 /* @param src : Bool matrix to copy into a new sparse matrix
 @param idx : Double matrix to use as indexes to get values from the src
 **/
-SparseBool::SparseBool(Bool CONST& src, Double CONST& idx)
+SparseBool::SparseBool(Bool SPARSE_CONST& src, Double SPARSE_CONST& idx)
 {
-    double CONST* const endOfRow(idx.getReal() + idx.getRows());
+    double SPARSE_CONST* const endOfRow(idx.getReal() + idx.getRows());
     create( static_cast<int>(*std::max_element(idx.getReal(), endOfRow))
             , static_cast<int>(*std::max_element(endOfRow, endOfRow + idx.getRows()))
             , src, makeIteratorFromVar(idx), idx.getSize() / 2 );
@@ -2073,7 +2073,7 @@ SparseBool::SparseBool(Bool CONST& src, Double CONST& idx)
 @param idx : Double matrix to use as indexes to get values from the src
 @param dims : Double matrix containing the dimensions of the new matrix
 **/
-SparseBool::SparseBool(Bool CONST& src, Double CONST& idx, Double CONST& dims)
+SparseBool::SparseBool(Bool SPARSE_CONST& src, Double SPARSE_CONST& idx, Double SPARSE_CONST& dims)
 {
     create((int)dims.getReal(0, 0) , (int)dims.getReal(0, 1) , src, makeIteratorFromVar(idx), (int)idx.getSize() / 2);
 }
@@ -2109,7 +2109,7 @@ SparseBool::SparseBool(BoolSparse_t* src) : matrixBool(src)
 }
 
 template<typename DestIter>
-void SparseBool::create(int rows, int cols, Bool CONST& src, DestIter o, std::size_t n)
+void SparseBool::create(int rows, int cols, Bool SPARSE_CONST& src, DestIter o, std::size_t n)
 {
     m_iCols = cols;
     m_iRows = rows;
@@ -2133,7 +2133,7 @@ bool SparseBool::toString(std::wostringstream& ostr) const
     return true;
 }
 
-void SparseBool::whoAmI() CONST
+void SparseBool::whoAmI() SPARSE_CONST
 {
     std::cout << "types::SparseBool";
 }
@@ -2667,7 +2667,7 @@ SparseBool* SparseBool::remove(typed_list* _pArgs)
     return pOut;
 }
 
-bool SparseBool::append(int r, int c, SparseBool CONST* src)
+bool SparseBool::append(int r, int c, SparseBool SPARSE_CONST* src)
 {
     doAppend(*src, r, c, *matrixBool);
     finalize();
@@ -2781,7 +2781,7 @@ InternalType* SparseBool::insertNew(typed_list* _pArgs, InternalType* _pSource)
     return pOut2;
 }
 
-SparseBool* SparseBool::extract(int nbCoords, int CONST* coords, int CONST* maxCoords, int CONST* resSize, bool asVector) CONST
+SparseBool* SparseBool::extract(int nbCoords, int SPARSE_CONST* coords, int SPARSE_CONST* maxCoords, int SPARSE_CONST* resSize, bool asVector) SPARSE_CONST
 {
     if ( (asVector && maxCoords[0] > getSize()) ||
     (asVector == false && maxCoords[0] > getRows()) ||
@@ -2958,7 +2958,7 @@ int* SparseBool::outputRowCol(int* out)const
     return sparseTransform(*matrixBool, sparseTransform(*matrixBool, out, GetRow<BoolSparse_t>()), GetCol<BoolSparse_t>());
 }
 
-bool SparseBool::operator==(const InternalType& it) CONST
+bool SparseBool::operator==(const InternalType& it) SPARSE_CONST
 {
     SparseBool* otherSparse = const_cast<SparseBool*>(dynamic_cast<SparseBool const*>(&it));/* types::GenericType is not const-correct :( */
     return (otherSparse
@@ -2967,7 +2967,7 @@ bool SparseBool::operator==(const InternalType& it) CONST
     && equal(*matrixBool, *otherSparse->matrixBool));
 }
 
-bool SparseBool::operator!=(const InternalType& it) CONST
+bool SparseBool::operator!=(const InternalType& it) SPARSE_CONST
 {
     return !(*this == it);
 }
@@ -2978,17 +2978,17 @@ void SparseBool::finalize()
     matrixBool->finalize();
 }
 
-GenericType::RealType SparseBool::getType(void) CONST
+GenericType::RealType SparseBool::getType(void) SPARSE_CONST
 {
     return InternalType::RealSparseBool;
 }
 
-bool SparseBool::get(int r, int c) CONST
+bool SparseBool::get(int r, int c) SPARSE_CONST
 {
     return matrixBool->coeff(r, c);
 }
 
-bool SparseBool::set(int _iRows, int _iCols, bool _bVal, bool _bFinalize) CONST
+bool SparseBool::set(int _iRows, int _iCols, bool _bVal, bool _bFinalize) SPARSE_CONST
 {
     matrixBool->coeffRef(_iRows, _iCols) = _bVal;
 
@@ -2999,7 +2999,7 @@ bool SparseBool::set(int _iRows, int _iCols, bool _bVal, bool _bFinalize) CONST
     return true;
 }
 
-void SparseBool::fill(Bool& dest, int r, int c) CONST
+void SparseBool::fill(Bool& dest, int r, int c) SPARSE_CONST
 {
     mycopy_n(makeMatrixIterator<bool >(*matrixBool, RowWiseFullIterator(getRows(), getCols())), getSize()
     , makeMatrixIterator<bool >(dest, RowWiseFullIterator(dest.getRows(), dest.getCols(), r, c)));
index 8b5a1ad..a55491e 100644 (file)
 #include "callFunctionFromGateway.h"
 #include "BOOL.h"
 /*--------------------------------------------------------------------------*/
-/*static BOOL loadedDep = FALSE;*/
-/*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[]=
-{
-    {NULL, ""}, //"editvar"
-    {NULL, ""}, //"browsevar"
-    {NULL, ""}, //filebrowser
-    {NULL, ""} //updatebrowsevar
-};
-/*--------------------------------------------------------------------------*/
 int gw_ui_data(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index e2cd099..231b437 100644 (file)
 #include "api_scilab.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
-static gw_generic_table Tab[] =
-{
-{sci_winopen,"winopen"},
-{NULL, ""}, // winqueryreg
-{sci_findfileassociation,"findfileassociation"},
-{NULL, ""}, //dos
-{sci_mcisendstring,"mcisendstring"},
-{sci_consolebox,"consolebox"},
-{NULL, ""}, //win64
-{sci_istssession,"istssession"},
-{sci_getsystemmetrics,"getsystemmetrics"},
-{sci_createGUID,"createGUID"}
-};
-/*--------------------------------------------------------------------------*/
 int gw_windows_tools(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
index 1e73952..bf8d925 100644 (file)
@@ -152,7 +152,7 @@ int CommandByFileExtension(char *fichier, int OpenCode, char *Cmd)
             {
                 if (!HaveAnotherWindowScilab() || haveMutexClosingScilab())
                 {
-                    if (with_module("scinotes"))
+                    if (with_module(L"scinotes"))
                     {
                         wsprintf(Cmd, MSG_SCIMSG5_EDITOR, PathWScilex, FinalFileName);
                     }
@@ -166,7 +166,7 @@ int CommandByFileExtension(char *fichier, int OpenCode, char *Cmd)
                 {
                     char *ScilabDestination = NULL;
 
-                    if (with_module("scinotes"))
+                    if (with_module(L"scinotes"))
                     {
                         wsprintf(Cmd, MSG_SCIMSG6_EDITOR, FinalFileName);
                     }
@@ -185,7 +185,7 @@ int CommandByFileExtension(char *fichier, int OpenCode, char *Cmd)
                     }
                     else
                     {
-                        if (with_module("scinotes"))
+                        if (with_module(L"scinotes"))
                         {
                             wsprintf(Cmd, MSG_SCIMSG5_EDITOR, PathWScilex, FinalFileName);
                         }
@@ -213,7 +213,7 @@ int CommandByFileExtension(char *fichier, int OpenCode, char *Cmd)
                         ExtensionFileIntoLowerCase(FinalFileName);
                         if (!HaveAnotherWindowScilab() || haveMutexClosingScilab())
                         {
-                            if (with_module("xcos"))
+                            if (with_module(L"xcos"))
                             {
                                 wsprintf(Cmd, MSG_SCIMSG2_XCOS, PathWScilex, FinalFileName);
                             }
@@ -227,7 +227,7 @@ int CommandByFileExtension(char *fichier, int OpenCode, char *Cmd)
                         {
                             char *ScilabDestination = NULL;
 
-                            if (with_module("xcos"))
+                            if (with_module(L"xcos"))
                             {
                                 wsprintf(Cmd, MSG_SCIMSG3_XCOS, FinalFileName);
                             }
@@ -246,7 +246,7 @@ int CommandByFileExtension(char *fichier, int OpenCode, char *Cmd)
                             }
                             else
                             {
-                                if (with_module("xcos"))
+                                if (with_module(L"xcos"))
                                 {
                                     wsprintf(Cmd, MSG_SCIMSG2_XCOS, PathWScilex, FinalFileName);
                                 }
index 34f08d8..17a5a76 100644 (file)
@@ -1,11 +1,11 @@
 /*
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) INRIA - Allan CORNET
-* 
+*
 * This file must be used under the terms of the CeCILL.
 * This source file is licensed as described in the file COPYING, which
 * you should have received as part of this distribution.  The terms
-* are also available at    
+* are also available at
 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 *
 */
@@ -20,6 +20,7 @@
 #include "wmcopydata.h"
 #include "storeCommand.h"
 #include "os_strdup.h"
+#include "charEncoding.h"
 /*--------------------------------------------------------------------------*/
 static HWND hWndScilab = NULL;
 HANDLE HandleThreadWnd = NULL;
@@ -29,126 +30,134 @@ static int ScilabId = -1;
 static DWORD WINAPI WndThread(LPVOID lpParam);
 static void RegisterWindowClass(void);
 static void GetFreeTitleOfWindowHidden(void);
-static BOOL ON_WND_HIDDEN_WM_COPYDATA(HWND hwnd,HWND hWndSend,PCOPYDATASTRUCT MyCopyDataStruct);
+static BOOL ON_WND_HIDDEN_WM_COPYDATA(HWND hwnd, HWND hWndSend, PCOPYDATASTRUCT MyCopyDataStruct);
 /*--------------------------------------------------------------------------*/
 BOOL CreateScilabHiddenWndThread(void)
 {
-       BOOL bOK = FALSE;
-
-       if (!HandleThreadWnd) HandleThreadWnd = CreateThread( NULL, 0, WndThread, NULL, 0, NULL);  
-       if (HandleThreadWnd) bOK = TRUE;
-
-       return bOK;
+    BOOL bOK = FALSE;
+
+    if (!HandleThreadWnd)
+    {
+        HandleThreadWnd = CreateThread( NULL, 0, WndThread, NULL, 0, NULL);
+    }
+    if (HandleThreadWnd)
+    {
+        bOK = TRUE;
+    }
+
+    return bOK;
 }
 /*--------------------------------------------------------------------------*/
-static DWORD WINAPI WndThread(LPVOID lpParam) 
+static DWORD WINAPI WndThread(LPVOID lpParam)
 {
-       HANDLE hWndScilab = NULL;
-       HINSTANCE hInstanceThisDll = (HINSTANCE)GetModuleHandle("scilab_windows");
+    HANDLE hWndScilab = NULL;
+    HINSTANCE hInstanceThisDll = (HINSTANCE)GetModuleHandle("scilab_windows");
 
-       RegisterWindowClass();
+    RegisterWindowClass();
 
-       GetFreeTitleOfWindowHidden();
+    GetFreeTitleOfWindowHidden();
 
-       hWndScilab = CreateWindow(HiddenWindowClassName, 
-       titleHiddenScilabWindow, WS_OVERLAPPEDWINDOW, 
-       0, 0,350, 0,
-       NULL, NULL, hInstanceThisDll, NULL);
+    hWndScilab = CreateWindow(HiddenWindowClassName,
+                              titleHiddenScilabWindow, WS_OVERLAPPEDWINDOW,
+                              0, 0, 350, 0,
+                              NULL, NULL, hInstanceThisDll, NULL);
 
-       ShowWindow (hWndScilab,SW_HIDE);
-       UpdateWindow (hWndScilab);
+    ShowWindow (hWndScilab, SW_HIDE);
+    UpdateWindow (hWndScilab);
 
-       if(hWndScilab) 
-       {
-               MSG Msg;
-               while(GetMessage(&Msg,NULL, 0, 0)) 
-               {
-                       TranslateMessage(&Msg);
-                       DispatchMessage(&Msg);
-               }
-       }
+    if (hWndScilab)
+    {
+        MSG Msg;
+        while (GetMessage(&Msg, NULL, 0, 0))
+        {
+            TranslateMessage(&Msg);
+            DispatchMessage(&Msg);
+        }
+    }
 
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
-LRESULT CALLBACK HiddenWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) 
+LRESULT CALLBACK HiddenWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 {
-       switch (Msg)
-       {
-               HANDLE_MSG(hWnd,WM_COPYDATA,ON_WND_HIDDEN_WM_COPYDATA);
-       }
-       return DefWindowProc(hWnd, Msg, wParam, lParam);
+    switch (Msg)
+    {
+            HANDLE_MSG(hWnd, WM_COPYDATA, ON_WND_HIDDEN_WM_COPYDATA);
+    }
+    return DefWindowProc(hWnd, Msg, wParam, lParam);
 }
 /*--------------------------------------------------------------------------*/
 static void RegisterWindowClass(void)
 {
-       WNDCLASSEX wcex;
-
-       wcex.cbSize = sizeof(WNDCLASSEX); 
-       wcex.style                      = CS_HREDRAW | CS_VREDRAW;
-       wcex.lpfnWndProc        = HiddenWndProc;
-       wcex.cbClsExtra         = 0;
-       wcex.cbWndExtra         = 0;
-       wcex.hInstance          = (HINSTANCE)GetModuleHandle("scilab_windows");
-       wcex.hIcon                      = 0;
-       wcex.hCursor            = 0;
-       wcex.hbrBackground      = (HBRUSH)(COLOR_WINDOW + 1);
-       wcex.lpszMenuName       = 0;
-       wcex.lpszClassName      = HiddenWindowClassName;
-       wcex.hIconSm            = 0;
-
-       RegisterClassEx(&wcex);
+    WNDCLASSEX wcex;
+
+    wcex.cbSize = sizeof(WNDCLASSEX);
+    wcex.style                 = CS_HREDRAW | CS_VREDRAW;
+    wcex.lpfnWndProc   = HiddenWndProc;
+    wcex.cbClsExtra            = 0;
+    wcex.cbWndExtra            = 0;
+    wcex.hInstance             = (HINSTANCE)GetModuleHandle("scilab_windows");
+    wcex.hIcon                 = 0;
+    wcex.hCursor               = 0;
+    wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
+    wcex.lpszMenuName  = 0;
+    wcex.lpszClassName = HiddenWindowClassName;
+    wcex.hIconSm               = 0;
+
+    RegisterClassEx(&wcex);
 }
 /*--------------------------------------------------------------------------*/
 static void GetFreeTitleOfWindowHidden(void)
 {
-       HWND hWndScilab = NULL;
-       int Number_of_Scilab = 0;
+    HWND hWndScilab = NULL;
+    int Number_of_Scilab = 0;
 
-       char SearchedScilabWindow[MAX_PATH];
+    char SearchedScilabWindow[MAX_PATH];
 
-       wsprintf(SearchedScilabWindow,FORMAT_TITLE_HIDDEN_WINDOWS,SCI_VERSION_STRING, Number_of_Scilab);
+    wsprintf(SearchedScilabWindow, FORMAT_TITLE_HIDDEN_WINDOWS, SCI_VERSION_STRING, Number_of_Scilab);
 
-       hWndScilab = FindWindow(NULL,SearchedScilabWindow);
+    hWndScilab = FindWindow(NULL, SearchedScilabWindow);
 
-       while ( hWndScilab )
-       {
-               Number_of_Scilab++;
-               wsprintf(SearchedScilabWindow,FORMAT_TITLE_HIDDEN_WINDOWS,SCI_VERSION_STRING, Number_of_Scilab);
-               hWndScilab = FindWindow(NULL,SearchedScilabWindow);
-       }
+    while ( hWndScilab )
+    {
+        Number_of_Scilab++;
+        wsprintf(SearchedScilabWindow, FORMAT_TITLE_HIDDEN_WINDOWS, SCI_VERSION_STRING, Number_of_Scilab);
+        hWndScilab = FindWindow(NULL, SearchedScilabWindow);
+    }
 
-       strcpy(titleHiddenScilabWindow,SearchedScilabWindow);
-       ScilabId = Number_of_Scilab;
+    strcpy(titleHiddenScilabWindow, SearchedScilabWindow);
+    ScilabId = Number_of_Scilab;
 }
 /*--------------------------------------------------------------------------*/
-static BOOL ON_WND_HIDDEN_WM_COPYDATA(HWND hwnd,HWND hWndSend,PCOPYDATASTRUCT MyCopyDataStruct)
+static BOOL ON_WND_HIDDEN_WM_COPYDATA(HWND hwnd, HWND hWndSend, PCOPYDATASTRUCT MyCopyDataStruct)
 {
-       char Command[MAX_PATH];
-       char TitleWndSend[MAX_PATH];
+    char Command[MAX_PATH];
+    char TitleWndSend[MAX_PATH];
 
-       ReceiveFromAnotherScilab(hWndSend,MyCopyDataStruct);
+    ReceiveFromAnotherScilab(hWndSend, MyCopyDataStruct);
 
-       if ( GetCommandFromAnotherScilab(TitleWndSend,Command) ) 
-       {
-               StoreCommand (Command);
-       }
+    if ( GetCommandFromAnotherScilab(TitleWndSend, Command) )
+    {
+        wchar_t* pwstCommand = to_wide_string(Command);
+        StoreCommand (pwstCommand);
+        FREE(pwstCommand);
+    }
 
-       return TRUE;
+    return TRUE;
 }
 /*--------------------------------------------------------------------------*/
 char *getCurrentTitleScilabHiddenWindow(void)
 {
-       char *currentTitle = NULL;
-       if ( strcmp(titleHiddenScilabWindow,"") )
-       {
-               currentTitle = os_strdup(titleHiddenScilabWindow);
-       }
-       return currentTitle;
+    char *currentTitle = NULL;
+    if ( strcmp(titleHiddenScilabWindow, "") )
+    {
+        currentTitle = os_strdup(titleHiddenScilabWindow);
+    }
+    return currentTitle;
 }
 /*--------------------------------------------------------------------------*/
 int getCurrentScilabId(void)
 {
-       return ScilabId;
+    return ScilabId;
 }
 /*--------------------------------------------------------------------------*/
index c1be09b..7921258 100644 (file)
@@ -129,7 +129,7 @@ int Console_Main(int argc, char **argv)
         else if ( _stricmp(my_argv[argcount], "-L") == 0 && argcount + 1 < my_argc)
         {
             char *language = my_argv[argcount + 1];
-            setLanguageFromCommandLine(language);
+            //setLanguageFromCommandLine(language);
         }
         else if ( (_stricmp (my_argv[argcount], "-H") == 0) ||
                   (_stricmp (my_argv[argcount], "-?") == 0) ||
@@ -155,7 +155,7 @@ int Console_Main(int argc, char **argv)
         }
     }
 
-    if (!with_module("jvm"))
+    if (!with_module(L"jvm"))
     {
         /* no module jvm then we force NWNI mode */
         setScilabMode(SCILAB_NWNI);
index add2c05..b61bf87 100644 (file)
@@ -46,7 +46,7 @@ void splashScreen(void)
 
     if (!haveConsoleWindow() && !haveInnosetupMutex())
     {
-        HANDLE hThreadSplashScreen = CreateThread(NULL,0, ThreadSplashScreen, &dwThrdParam, 0, &dwThreadId);
+        HANDLE hThreadSplashScreen = CreateThread(NULL, 0, ThreadSplashScreen, &dwThrdParam, 0, &dwThreadId);
     }
 }
 /*--------------------------------------------------------------------------*/
@@ -54,7 +54,7 @@ LRESULT CALLBACK SplashWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara
 {
     switch (uMsg)
     {
-    case WM_PAINT:
+        case WM_PAINT:
         {
             if (pImage)
             {
@@ -65,7 +65,7 @@ LRESULT CALLBACK SplashWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara
             return 0;
         }
         break;
-    case WM_DESTROY:
+        case WM_DESTROY:
         {
             if (pImage)
             {
@@ -93,11 +93,17 @@ static DWORD WINAPI ThreadSplashScreen(LPVOID lpParam)
     HINSTANCE hInstanceThisDll = (HINSTANCE)GetModuleHandle("scilab_windows");
 
     ScilabDirectory = getScilabDirectory(TRUE);
-    if (ScilabDirectory == NULL) return 0;
+    if (ScilabDirectory == NULL)
+    {
+        return 0;
+    }
 
     len = strlen(FORMAT_FULLPATH_SPLASH_IMAGE) + strlen(ScilabDirectory) + 1;
     ImageFilename = (char*)MALLOC(sizeof(char) * len);
-    if (ImageFilename == NULL) return 0;
+    if (ImageFilename == NULL)
+    {
+        return 0;
+    }
 
     sprintf(ImageFilename, FORMAT_FULLPATH_SPLASH_IMAGE, ScilabDirectory);
     FREE(ScilabDirectory);
@@ -106,12 +112,18 @@ static DWORD WINAPI ThreadSplashScreen(LPVOID lpParam)
     wImageFilename = to_wide_string(ImageFilename);
     FREE(ImageFilename);
     ImageFilename = NULL;
-    if (wImageFilename == NULL) return 0;
+    if (wImageFilename == NULL)
+    {
+        return 0;
+    }
 
     pImage = Gdiplus::Image::FromFile((const WCHAR *)wImageFilename);
     FREE(wImageFilename);
     wImageFilename = NULL;
-    if (pImage == NULL) return 0;
+    if (pImage == NULL)
+    {
+        return 0;
+    }
 
     WNDCLASS wndcls = {0};
 
@@ -121,7 +133,7 @@ static DWORD WINAPI ThreadSplashScreen(LPVOID lpParam)
     wndcls.hCursor = LoadCursor(NULL, IDC_APPSTARTING);
     wndcls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
     wndcls.lpszClassName = SPLASH_WINDOW_CLASSNAME;
-    wndcls.hIcon = LoadIcon(wndcls.hInstance, (char*)MAKEINTRESOURCE(IDI_APPLICATION));
+    wndcls.hIcon = LoadIcon(wndcls.hInstance, MAKEINTRESOURCE(IDI_APPLICATION));
 
     if (!RegisterClass(&wndcls))
     {
@@ -141,34 +153,37 @@ static DWORD WINAPI ThreadSplashScreen(LPVOID lpParam)
     hMonitor = ::MonitorFromPoint(point, MONITOR_DEFAULTTONEAREST);
     if (::GetMonitorInfo(hMonitor, &mi))
     {
-        rcArea.left = (mi.rcMonitor.right + mi.rcMonitor.left - pImage->GetWidth())/2;
-        rcArea.top = (mi.rcMonitor.top + mi.rcMonitor.bottom - pImage->GetHeight())/2;
+        rcArea.left = (mi.rcMonitor.right + mi.rcMonitor.left - pImage->GetWidth()) / 2;
+        rcArea.top = (mi.rcMonitor.top + mi.rcMonitor.bottom - pImage->GetHeight()) / 2;
     }
     else
     {
         SystemParametersInfo(SPI_GETWORKAREA, NULL, &rcArea, NULL);
-        rcArea.left = (rcArea.right + rcArea.left - pImage->GetWidth())/2;
-        rcArea.top = (rcArea.top + rcArea.bottom - pImage->GetHeight())/2;
+        rcArea.left = (rcArea.right + rcArea.left - pImage->GetWidth()) / 2;
+        rcArea.top = (rcArea.top + rcArea.bottom - pImage->GetHeight()) / 2;
     }
 
     HWND hdlg = CreateWindowEx(WS_EX_TOOLWINDOW,
-        SPLASH_WINDOW_CLASSNAME,
-        SPLASH_WINDOW_CLASSNAME,
-        WS_CLIPCHILDREN|WS_POPUP,
-        rcArea.left,
-        rcArea.top,
-        pImage->GetWidth(),
-        pImage->GetHeight(),
-        NULL,
-        NULL,
-        wndcls.hInstance,
-        NULL);
-
-    if (hdlg == NULL) return 0;
+                               SPLASH_WINDOW_CLASSNAME,
+                               SPLASH_WINDOW_CLASSNAME,
+                               WS_CLIPCHILDREN | WS_POPUP,
+                               rcArea.left,
+                               rcArea.top,
+                               pImage->GetWidth(),
+                               pImage->GetHeight(),
+                               NULL,
+                               NULL,
+                               wndcls.hInstance,
+                               NULL);
+
+    if (hdlg == NULL)
+    {
+        return 0;
+    }
 
     ShowWindow(hdlg, SW_SHOWNORMAL);
     UpdateWindow(hdlg);
-    SetWindowPos(hdlg, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE);
+    SetWindowPos(hdlg, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
 
     while (!stopSplashScreen(20, 1000))
     {
@@ -201,7 +216,7 @@ static BOOL haveConsoleWindow(void)
     char titleMainWindow[MAX_PATH];
     int id = getCurrentScilabId();
 
-    wsprintf(titleMainWindow,"%s (%d)", SCI_VERSION_STRING, id);
+    wsprintf(titleMainWindow, "%s (%d)", SCI_VERSION_STRING, id);
     hWndMainScilab = FindWindow(NULL, titleMainWindow);
 
     if (hWndMainScilab == NULL)
@@ -210,6 +225,6 @@ static BOOL haveConsoleWindow(void)
         hWndMainScilab = FindWindow(NULL, titleMainWindow);
     }
 
-    return (hWndMainScilab == NULL) ? FALSE:TRUE;
+    return (hWndMainScilab == NULL) ? FALSE : TRUE;
 }
 /*--------------------------------------------------------------------------*/
index 7a5c2d9..e6b3b8d 100644 (file)
@@ -233,7 +233,7 @@ int Windows_Main (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine,
             else if ( _stricmp(ArgTmp, "-L") == 0 && argcount + 1 < my_argc)
             {
                 char *language = my_argv[argcount + 1];
-                setLanguageFromCommandLine(language);
+                //setLanguageFromCommandLine(language);
             }
         }