fix build on windows + warnings 69/4969/1
Allan CORNET [Fri, 16 Sep 2011 12:13:52 +0000 (14:13 +0200)]
Change-Id: I9bfe1edeb032b14655a5c726414615005ee75173

scilab/modules/xml/sci_gateway/cpp/sci_xmlDump.cpp
scilab/modules/xml/sci_gateway/cpp/sci_xmlValidate.cpp
scilab/modules/xml/src/cpp/VariableScope.cpp
scilab/modules/xml/src/cpp/XMLNodeList.cpp
scilab/modules/xml/src/cpp/XMLValidation.cpp
scilab/modules/xml/src/cpp/XMLValidationRelaxNG.cpp
scilab/modules/xml/src/cpp/XMLValidationSchema.cpp
scilab/modules/xml/xml.vcxproj
scilab/modules/xml/xml.vcxproj.filters

index d93c67d..a94a7bf 100644 (file)
@@ -79,7 +79,7 @@ int sci_xmlDump(char *fname, unsigned long fname_len)
 
     if (clines.size())
     {
-        err = createMatrixOfString(pvApiCtx, Rhs + 1, lines.size(), 1, const_cast<const char * const *>(&(clines[0])));
+        err = createMatrixOfString(pvApiCtx, Rhs + 1, (int)lines.size(), 1, const_cast<const char * const *>(&(clines[0])));
     }
     else
     {
index 77d152c..0f9b18e 100644 (file)
@@ -139,7 +139,7 @@ int sci_xmlValidate(char * fname, unsigned long fname_len)
 
         if (clines.size())
         {
-            err = createMatrixOfString(pvApiCtx, Rhs + 1, lines.size(), 1, const_cast<const char * const *>(&(clines[0])));
+            err = createMatrixOfString(pvApiCtx, Rhs + 1, (int)lines.size(), 1, const_cast<const char * const *>(&(clines[0])));
         }
         else
         {
index 7c528f6..6ade1b3 100644 (file)
@@ -60,7 +60,7 @@ namespace org_modules_xml
         }
         else
         {
-            returnValue = scope->size();
+            returnValue = (int)scope->size();
             scope->push_back(const_cast<XMLObject *>(&obj));
         }
 
index 2b10654..58aa567 100644 (file)
@@ -161,7 +161,7 @@ namespace org_modules_xml
     {
         if (list.getSize() && list.getRealNode() != parent)
         {
-            int pos = index;
+            int pos = (int)index;
 
             if (index < 1)
             {
index 4619f58..a3c29f9 100644 (file)
@@ -37,14 +37,18 @@ namespace org_modules_xml
         va_list args;
 
         va_start(args, msg);
+#ifdef _MSC_VER
+        _vsnprintf(str, BUFFER_SIZE, msg, args);
+#else
         std::vsnprintf(str, BUFFER_SIZE, msg, args);
+#endif
         va_end(args);
         errorBuffer->append(str);
     }
 
     bool XMLValidation::validate(const std::string & xmlCode, std::string * error) const
     {
-        xmlParserInputBuffer * buffer = xmlParserInputBufferCreateMem(xmlCode.c_str(), xmlCode.size(), (xmlCharEncoding)0);
+        xmlParserInputBuffer * buffer = xmlParserInputBufferCreateMem(xmlCode.c_str(), (int)xmlCode.size(), (xmlCharEncoding)0);
         bool valid = validate(xmlNewTextReader(buffer, 0), error);
         xmlFreeParserInputBuffer(buffer);
 
index f933b36..e59a1bd 100644 (file)
@@ -20,6 +20,7 @@ extern "C" {
 #include "expandPathVariable.h"
 #include "MALLOC.h"
 #include "localization.h"
+#include "BOOL.h"
 }
 
 namespace org_modules_xml
@@ -102,7 +103,7 @@ namespace org_modules_xml
 
         xmlRelaxNGSetValidErrors(vctxt, (xmlRelaxNGValidityErrorFunc)XMLValidation::errorFunction, 0, 0);
 
-        ret = xmlRelaxNGValidateDoc(vctxt, doc.getRealDocument());
+        ret = BOOLtobool(xmlRelaxNGValidateDoc(vctxt, doc.getRealDocument()));
 
         xmlRelaxNGSetValidErrors(vctxt, 0, 0, 0);
         xmlRelaxNGFreeValidCtxt(vctxt);
index 64a3410..a81ce25 100644 (file)
@@ -20,6 +20,7 @@ extern "C" {
 #include "expandPathVariable.h"
 #include "MALLOC.h"
 #include "localization.h"
+#include "BOOL.h"
 }
 
 namespace org_modules_xml
@@ -102,7 +103,7 @@ namespace org_modules_xml
 
         xmlSchemaSetValidErrors(vctxt, (xmlSchemaValidityErrorFunc)XMLValidation::errorFunction, 0, 0);
 
-        ret = xmlSchemaValidateDoc(vctxt, doc.getRealDocument());
+        ret = BOOLtobool(xmlSchemaValidateDoc(vctxt, doc.getRealDocument()));
 
         xmlSchemaSetValidErrors(vctxt, 0, 0, 0);
         xmlSchemaFreeValidCtxt(vctxt);
index 3be3122..5e70ae2 100644 (file)
     <ClCompile Include="sci_gateway\cpp\sci_xmlNs.cpp" />
     <ClCompile Include="sci_gateway\cpp\sci_xmlRead.cpp" />
     <ClCompile Include="sci_gateway\cpp\sci_xmlReadStr.cpp" />
+    <ClCompile Include="sci_gateway\cpp\sci_xmlValidate.cpp" />
+    <ClCompile Include="sci_gateway\cpp\sci_xmlValidationFile.cpp" />
     <ClCompile Include="sci_gateway\cpp\sci_xmlWrite.cpp" />
     <ClCompile Include="sci_gateway\cpp\sci_xmlXPath.cpp" />
     <ClCompile Include="sci_gateway\c\gw_xml.c" />
     <ClCompile Include="src\cpp\XMLNotHandledElement.cpp" />
     <ClCompile Include="src\cpp\XMLNs.cpp" />
     <ClCompile Include="src\cpp\XMLObject.cpp" />
+    <ClCompile Include="src\cpp\XMLValidation.cpp" />
+    <ClCompile Include="src\cpp\XMLValidationDTD.cpp" />
+    <ClCompile Include="src\cpp\XMLValidationRelaxNG.cpp" />
+    <ClCompile Include="src\cpp\XMLValidationSchema.cpp" />
     <ClCompile Include="src\cpp\XMLXPath.cpp" />
     <ClCompile Include="src\c\DllmainXml.c" />
     <ClCompile Include="src\c\XMLMlistsManagement.c" />
index c57b2ce..ce41783 100644 (file)
     <ClCompile Include="sci_gateway\cpp\sci_xmlWrite.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="sci_gateway\cpp\sci_xmlValidate.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_gateway\cpp\sci_xmlValidationFile.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="src\cpp\XMLValidation.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="src\cpp\XMLValidationDTD.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="src\cpp\XMLValidationRelaxNG.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="src\cpp\XMLValidationSchema.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file