fix windows compilation 34/13934/2
Antoine ELIAS [Thu, 6 Mar 2014 14:31:11 +0000 (15:31 +0100)]
Change-Id: I314cc8088c373784bacb809407fb8939fd25385a

scilab/modules/core/sci_gateway/c/sci_getscilabmode.c
scilab/modules/core/src/c/InitializePreferences.c
scilab/modules/core/src/c/core.vcxproj
scilab/modules/core/src/c/core.vcxproj.filters
scilab/modules/core/src/c/sciquit.c
scilab/modules/preferences/includes/getScilabPreference.h
scilab/modules/preferences/src/c/getScilabPreference.c

index ddea2fa..ae0a17e 100644 (file)
@@ -46,7 +46,7 @@ int C2F(sci_getscilabmode)(char *fname, unsigned long fname_len)
 
     /* Create the string matrix as return of the function */
     iRet = createSingleString(pvApiCtx, nbInputArgument(pvApiCtx) + 1, output);
-    free(output); // Data have been copied into Scilab memory
+    FREE(output); // Data have been copied into Scilab memory
     if (iRet)
     {
         return 1;
index 4b16888..dfb24d8 100644 (file)
@@ -90,11 +90,11 @@ void InitializePreferences()
             // Not in cwd
             if (stricmp(prefs->startup_dir_use, "previous") == 0 && prefs->startup_dir_previous && *prefs->startup_dir_previous)
             {
-                scichdir(prefs->startup_dir_previous);
+                scichdir((char*)prefs->startup_dir_previous);
             }
             else if (stricmp(prefs->startup_dir_use, "default") == 0 && prefs->startup_dir_default && *prefs->startup_dir_default)
             {
-                scichdir(prefs->startup_dir_default);
+                scichdir((char*)prefs->startup_dir_default);
             }
         }
     }
index fe4859a..28f9208 100644 (file)
@@ -351,6 +351,7 @@ cd ..
     <ClCompile Include="..\..\sci_gateway\c\sci_where.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_who.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_with_module.c" />
+    <ClCompile Include="saveCWDInPreferences.c" />
     <ClCompile Include="SCIHOME.c" />
     <ClCompile Include="scilabmode.c" />
     <ClCompile Include="scimem.c" />
@@ -479,6 +480,7 @@ cd ..
     <ClInclude Include="..\..\includes\stack3.h" />
     <ClInclude Include="..\..\includes\stackinfo.h" />
     <ClInclude Include="..\..\includes\storeCommand.h" />
+    <ClInclude Include="saveCWDInPreferences.h" />
     <ClInclude Include="str2sci.h" />
     <ClInclude Include="..\..\includes\syncexec.h" />
     <ClInclude Include="terme.h" />
index d5d666c..20e01f7 100644 (file)
     <ClCompile Include="hashtable\hashtable_utility.c">
       <Filter>Source Files\hashtable</Filter>
     </ClCompile>
+    <ClCompile Include="saveCWDInPreferences.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="banier.h">
     <ClInclude Include="..\..\includes\hashtable_utility.h">
       <Filter>Header Files\hashtable</Filter>
     </ClInclude>
+    <ClInclude Include="saveCWDInPreferences.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\core.iss" />
index 2f2dacb..8549f48 100644 (file)
 #include "../../../gui/includes/TerminateGui.h"
 #include "../../../jvm/includes/TerminateJVM.h"
 #include "getScilabPreference.h"
+#include "../../../gui/includes/TerminateGui.h"
+#include "scilabmode.h"
+#include "saveCWDInPreferences.h"
+
 #ifdef _MSC_VER
 #include "../../../windows_tools/includes/TerminateWindows_tools.h"
 #include "../../../windows_tools/includes/MutexClosingScilab.h"
 #include "../../../windows_tools/src/c/scilab_windows/killScilabProcess.h"
-#endif
-#include "../../../gui/includes/TerminateGui.h"
-#include "scilabmode.h"
-#ifndef _MSC_VER
+#else
 #include "initConsoleMode.h"
-#include "saveCWDInPreferences.h"
 #endif
 /*--------------------------------------------------------------------------*/
 int ExitScilab(void)
index fd07cf0..15cb5a0 100644 (file)
@@ -56,5 +56,6 @@ PREFERENCES_SCILAB_IMPEXP void clearScilabPreferences(void);
 PREFERENCES_SCILAB_IMPEXP char * getPrefAttributeValue(const char * xpath, const char * attribute);
 PREFERENCES_SCILAB_IMPEXP char ** getPrefAttributesValues(const char * xpath, const char ** attributes, const unsigned int attrLen);
 PREFERENCES_SCILAB_IMPEXP void setAttributesValues(const char * xpath, const char ** attributes, const unsigned int kvLen);
+PREFERENCES_SCILAB_IMPEXP void setPrefAttributesValues(const char * xpath, const char ** kv, const unsigned int kvLen);
 
 #endif // __GETSCILABPREFERENCES_H__
index 89bc85b..0c0e206 100644 (file)
@@ -257,8 +257,8 @@ char * getPrefAttributeValue(const char * xpath, const char * attribute)
         return NULL;
     }
 
-    xlen = strlen(xpath);
-    alen = strlen(attribute);
+    xlen = (unsigned int) strlen(xpath);
+    alen = (unsigned int) strlen(attribute);
 
     getDocAndCtxt(&doc, &xpathCtxt);
     if (doc == NULL)
@@ -305,7 +305,7 @@ char ** getPrefAttributesValues(const char * xpath, const char ** attributes, co
     {
         int i;
         xmlNode * node = (xmlNode*)xpathObj->nodesetval->nodeTab[0];
-        for (i = 0; i < attrLen; i++)
+        for (i = 0; i < (int)attrLen; i++)
         {
             xmlAttr * attrs = xmlHasProp(node, (const xmlChar *)attributes[i]);
             if (attrs)
@@ -363,7 +363,7 @@ void setPrefAttributesValues(const char * xpath, const char ** kv, const unsigne
     {
         int i;
         xmlNode * node = (xmlNode*)xpathObj->nodesetval->nodeTab[0];
-        for (i = 0; i < kvLen / 2; i++)
+        for (i = 0; i < (int)kvLen / 2; i++)
         {
             xmlAttr * attrs = xmlHasProp(node, (const xmlChar *)kv[2 * i]);
             if (attrs)