Browse Source

HPCC-13531 Fix various windows compile warnings

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 10 năm trước cách đây
mục cha
commit
977027aed7

+ 3 - 3
dali/datest/datest.cpp

@@ -1730,7 +1730,7 @@ void TestExternal()
             Owned<IFileIO> fileIO = ifile->open(IFOread);
             assertex(fileIO);
 
-            sz = ifile->size();
+            sz = (size32_t)ifile->size();
             void *mem = malloc(sz);
 
             fileIO->read(0, sz, mem);
@@ -2587,13 +2587,13 @@ NULL
         if (0 == l)
         {
             OwnedIFileIO newFileIO = newFile->open(IFOread);
-            read(newFileIO, 0, newFile->size(), newOutput);
+            read(newFileIO, 0, (size32_t)newFile->size(), newOutput);
             newFileIO.clear();
         }
         else
         {
             OwnedIFileIO newFileSecondaryIO = newFileSecondary->open(IFOread);
-            read(newFileSecondaryIO, 0, newFileSecondary->size(), secondary);
+            read(newFileSecondaryIO, 0, (size32_t)newFileSecondary->size(), secondary);
             newFileSecondaryIO.clear();
 
             if (newOutput.length() != secondary.length() || 0 != memcmp(newOutput.toByteArray(), secondary.toByteArray(), newOutput.length()))

+ 2 - 2
ecl/eclagent/eclagent.cpp

@@ -2297,7 +2297,7 @@ void EclAgentWorkflowMachine::doExecutePersistItem(IRuntimeWorkflowItem & item)
         if (agent.queryWorkUnit()->getDebugValueBool("expandPersistInputDependencies", false))
             doExecuteItemDependencies(item, wfid);
         if (maxPersistCopies > 0)
-            agent.deleteLRUPersists(logicalName, maxPersistCopies-1);
+            agent.deleteLRUPersists(logicalName, (unsigned)(maxPersistCopies-1));
         doExecuteItem(item, wfid);
         agent.updatePersist(persistLock, logicalName, thisPersist->eclCRC, thisPersist->allCRC);
     }
@@ -2715,7 +2715,7 @@ static int comparePersistAccess(IInterface * const *_a, IInterface * const *_b)
 
 }
 
-void EclAgent::deleteLRUPersists(const char * logicalName, int keep)
+void EclAgent::deleteLRUPersists(const char * logicalName, unsigned keep)
 {
     StringBuffer lfn;
     expandLogicalName(lfn, logicalName);

+ 1 - 1
ecl/eclagent/eclagent.ipp

@@ -495,7 +495,7 @@ public:
     void finishPersist(const char * persistName, IRemoteConnection *persistLock);
     void updatePersist(IRemoteConnection *persistLock, const char * logicalName, unsigned eclCRC, unsigned __int64 allCRC);
     void checkPersistMatches(const char * logicalName, unsigned eclCRC);
-    virtual void deleteLRUPersists(const char * logicalName, int keep);
+    virtual void deleteLRUPersists(const char * logicalName, unsigned keep);
     virtual bool queryResolveFilesLocally() { return resolveFilesLocally; }
     virtual bool queryRemoteWorkunit() { return isRemoteWorkunit; }
     virtual bool queryWriteResultsToStdout() { return writeResultsToStdout; }

+ 1 - 1
ecl/eclcc/reservedwords.cpp

@@ -561,7 +561,7 @@ void printKeywordsToXml()
      unsigned int nGroups = sizeof(keywordList)/sizeof(keywordList[0]);
 
      buffer.append("<xml>\n");
-     for (int i = 0; i < nGroups; ++i)
+     for (unsigned i = 0; i < nGroups; ++i)
      {
          buffer.append("  <cat group=\"").append(keywordList[i].group).append("\">\n");
          unsigned int j = 0;

+ 1 - 1
ecl/hqlcpp/hqlhtcpp.cpp

@@ -6784,7 +6784,7 @@ ABoundActivity * HqlCppTranslator::buildActivity(BuildCtx & ctx, IHqlExpression
                 }
         }
     }
-    catch (IError * e)
+    catch (IError *)
     {
         throw;
     }

+ 1 - 1
ecl/hthor/hthor.cpp

@@ -6098,7 +6098,7 @@ void CHThorDictionaryWorkUnitWriteActivity::execute()
         builder.appendOwn(row);
         processed++;
     }
-    size32_t usedCount = rtlDictionaryCount(builder.getcount(), builder.queryrows());
+    unsigned __int64 usedCount = rtlDictionaryCount(builder.getcount(), builder.queryrows());
 
     // In absense of OPT_OUTPUTLIMIT check pre 5.2 legacy name OPT_OUTPUTLIMIT_LEGACY
     size32_t outputLimit = agent.queryWorkUnit()->getDebugValueInt(OPT_OUTPUTLIMIT, agent.queryWorkUnit()->getDebugValueInt(OPT_OUTPUTLIMIT_LEGACY, defaultDaliResultLimit)) * 0x100000;

+ 1 - 1
esp/clients/LoggingClient/LocalDataLogger.cpp

@@ -171,7 +171,7 @@ MemoryBuffer& CLocalDataLogger::readData(MemoryBuffer& dataCached,const char* ca
                         size32_t memfilesize = (size32_t)filesize;
                         //Check size isn't >= 2^32
                         assertex(filesize == memfilesize);
-                        io->read(0, filesize, dataCached.reserveTruncate(memfilesize));
+                        io->read(0, memfilesize, dataCached.reserveTruncate(memfilesize));
                         DBGLOG("Managed to read");
                         return dataCached;
                     }

+ 3 - 1
esp/platform/espcfg.cpp

@@ -526,7 +526,9 @@ public:
             if (fio)
             {
                 offset_t len=fio->size();
-                if (fio->read(0, len, buff.reserveTruncate(len))==len)
+                size32_t memlen = (size32_t)len;
+                assertex(len == memlen);
+                if (fio->read(0, memlen, buff.reserveTruncate(memlen))==len)
                     return true;
             }
         }

+ 1 - 1
esp/services/common/jsonhelpers.hpp

@@ -157,7 +157,7 @@ namespace JsonHelpers
 
         StringBuffer temp;
         IArrayOf<IException>& exceptions = e->getArray();
-        for (int i = 0 ; i < exceptions.ordinality(); i++)
+        for (unsigned i = 0 ; i < exceptions.ordinality(); i++)
         {
             appendJSONExceptionItem(s, e->errorCode(), e->errorMessage(temp.clear()).str(), objname, arrayName);
         }

+ 3 - 3
esp/services/ws_dfu/ws_dfuService.cpp

@@ -4256,8 +4256,8 @@ bool CWsDfuEx::onDFUGetFileMetaData(IEspContext &context, IEspDFUGetFileMetaData
 {
     class CDFUFileMetaDataReader
     {
-        int totalColumnCount;
-        int keyedColumnCount;
+        unsigned totalColumnCount;
+        unsigned keyedColumnCount;
         StringBuffer XmlSchema, XmlXPathSchema;
         IArrayOf<IEspDFUDataColumn> dataColumns;
         const IResultSetMetaData& meta;
@@ -4306,7 +4306,7 @@ bool CWsDfuEx::onDFUGetFileMetaData(IEspContext &context, IEspDFUGetFileMetaData
     public:
         CDFUFileMetaDataReader(const IResultSetMetaData& _meta) : meta(_meta)
         {
-            totalColumnCount = meta.getColumnCount();
+            totalColumnCount = (unsigned)meta.getColumnCount();
             keyedColumnCount = meta.getNumKeyedColumns();
             unsigned i = 0;
             for (; i < keyedColumnCount; i++)

+ 1 - 1
esp/test/httptest/httptest.cpp

@@ -465,7 +465,7 @@ int HttpClient::sendRequest(int times, HttpStat& stat, StringBuffer& req)
     else
         request.append(c1);
 
-    int seq = 2;
+    unsigned seq = 2;
     while(seq < req.length() && !endofheaders)
     {
         char c = req.charAt(seq);

+ 2 - 2
esp/tools/soapplus/http.cpp

@@ -1351,7 +1351,7 @@ int HttpClient::validate(StringBuffer& xml)
         if(http_tracelevel > 0)
         {
             IArrayOf<IException> &es = me->getArray();
-            for (int i=0; i<es.ordinality(); i++)
+            for (unsigned i=0; i<es.ordinality(); i++)
             {
                 StringBuffer msg;
                 IException& e = es.item(i);
@@ -1430,7 +1430,7 @@ int HttpClient::sendRequest(StringBuffer& req, IFileIO* request_output, IFileIO*
     else
         request.append(c1);
 
-    int seq = 2;
+    unsigned seq = 2;
     while(seq < req.length() && !endofheaders)
     {
         char c = req.charAt(seq);

+ 2 - 2
tools/esdlcmd/esdlcmd_core.cpp

@@ -228,7 +228,7 @@ public:
 
             loadTransform( fullxsltpath, params);
 
-            for( int i=0; i < optXformTimes; i++ )
+            for( unsigned i=0; i < optXformTimes; i++ )
             {
                 doTransform( *structs, outputBuffer, optVersion, opts.get(), NULL, optFlags );
             }
@@ -549,7 +549,7 @@ public:
             createParams();
             loadTransform( fullxsltpath, params);
 
-            for( int i=0; i < optXformTimes; i++ )
+            for( unsigned i=0; i < optXformTimes; i++ )
             {
                 doTransform( *structs, outputBuffer, optVersion, opts.get(), NULL, optFlags );
             }