Просмотр исходного кода

HPCC-12513 Clean up various windows warnings

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 10 лет назад
Родитель
Сommit
dcceb504f4
44 измененных файлов с 105 добавлено и 103 удалено
  1. 0 1
      common/thorhelper/csvsplitter.cpp
  2. 1 1
      common/thorhelper/roxiehelper.cpp
  3. 3 3
      common/thorhelper/thorsoapcall.cpp
  4. 1 1
      common/workunit/workunit.cpp
  5. 1 1
      common/workunit/workunit.hpp
  6. 2 2
      dali/base/dasds.cpp
  7. 12 12
      dali/daliadmin/daliadmin.cpp
  8. 2 2
      dali/ft/daftformat.cpp
  9. 1 1
      dali/ft/ftbase.cpp
  10. 1 1
      deployment/configutils/confighelper.cpp
  11. 1 1
      deployment/deployutils/configenvhelper.cpp
  12. 4 4
      ecl/ecl-bundle/ecl-bundle.cpp
  13. 3 3
      ecl/eclagent/eclgraph.cpp
  14. 1 1
      ecl/schedulectrl/eventqueue.cpp
  15. 1 1
      esp/bindings/http/platform/httpservice.cpp
  16. 1 0
      esp/clients/LoggingClient/LocalDataLogger.cpp
  17. 2 2
      esp/platform/sechandler.cpp
  18. 8 7
      esp/services/ws_workunits/ws_workunitsHelpers.cpp
  19. 4 4
      esp/test/httptest/httptest.cpp
  20. 4 4
      esp/tools/soapplus/http.cpp
  21. 4 4
      roxie/ccd/ccdcontext.cpp
  22. 1 1
      roxie/ccd/ccdcontext.hpp
  23. 1 0
      roxie/ccd/ccdkey.cpp
  24. 10 10
      roxie/ccd/ccdmain.cpp
  25. 2 2
      roxie/ccd/ccdserver.cpp
  26. 1 1
      roxie/ccd/ccdserver.hpp
  27. 1 1
      roxie/ccd/ccdstate.cpp
  28. 1 1
      roxie/roxie/roxie.cpp
  29. 1 1
      roxie/roxieclient/roxieclient.cpp
  30. 1 1
      rtl/eclrtl/eclrtl.cpp
  31. 8 8
      rtl/eclrtl/rtlint.cpp
  32. 1 1
      rtl/nbcd/nbcd.cpp
  33. 2 2
      system/jlib/jdebug.cpp
  34. 2 2
      system/jlib/jdebug.hpp
  35. 1 1
      system/jlib/jmd5.cpp
  36. 1 1
      system/mp/mpcomm.cpp
  37. 1 1
      system/security/test/ldapsecuritytest/ldapsecuritytest.cpp
  38. 3 3
      system/xmllib/xsdparser.cpp
  39. 1 1
      testing/unittests/dalitests.cpp
  40. 3 3
      testing/unittests/jlibtests.cpp
  41. 2 2
      thorlcr/activities/hashdistrib/thhashdistribslave.cpp
  42. 1 1
      thorlcr/activities/join/thjoinslave.cpp
  43. 1 1
      thorlcr/activities/selfjoin/thselfjoinslave.cpp
  44. 2 2
      thorlcr/master/thgraphmanager.cpp

+ 0 - 1
common/thorhelper/csvsplitter.cpp

@@ -264,7 +264,6 @@ void CSVSplitter::setFieldRange(const byte * start, const byte * end, unsigned c
         cur += matchLen;
     }
 
-done:
     memcpy(internalBuffer + internalOffset, lastCopied, cur-lastCopied);
     internalOffset += (cur-lastCopied);
     lengths[curColumn] = (size32_t)(internalBuffer + internalOffset - data[curColumn]);

+ 1 - 1
common/thorhelper/roxiehelper.cpp

@@ -905,7 +905,7 @@ void FlushingStringBuffer::encodeData(const void *data, unsigned len)
     else
     {
         const byte *field = (const byte *) data;
-        for (int i = 0; i < len; i++)
+        for (unsigned i = 0; i < len; i++)
         {
             append(hexchar[field[i] >> 4]);
             append(hexchar[field[i] & 0x0f]);

+ 3 - 3
common/thorhelper/thorsoapcall.cpp

@@ -746,13 +746,13 @@ public:
         else if (dval == 0)
             timeoutMS = WAIT_FOREVER;
         else
-            timeoutMS = dval * 1000;
+            timeoutMS = (unsigned)(dval * 1000);
 
         dval = helper->getTimeLimit();
         if (dval <= 0.0)
             timeLimitMS = WAIT_FOREVER;
         else
-            timeLimitMS = dval * 1000;
+            timeLimitMS = (unsigned)(dval * 1000);
 
         if (wscType == STsoap)
         {
@@ -1816,7 +1816,7 @@ public:
                 __int64 elapsedNs = cycle_to_nanosec(endCycles-startCycles);
                 master->logctx.noteStatistic(StTimeSoapcall, elapsedNs);
                 checkTimeLimitExceeded(&remainingMS);
-                ColumnProvider * meta = (ColumnProvider*)CreateColumnProvider(nanoToMilli(elapsedNs), master->flags&SOAPFencoding?true:false);
+                ColumnProvider * meta = (ColumnProvider*)CreateColumnProvider((unsigned)nanoToMilli(elapsedNs), master->flags&SOAPFencoding?true:false);
                 processResponse(url, response, meta);
                 delete meta;
                 break;

+ 1 - 1
common/workunit/workunit.cpp

@@ -10585,7 +10585,7 @@ extern WORKUNIT_API void updateWorkunitTimings(IWorkUnit * wu, ITimeReporter *ti
     }
 }
 
-extern WORKUNIT_API void getWorkunitTotalTime(IConstWorkUnit* workunit, const char* creator, unsigned& totalTimeNs, unsigned& totalThisTimeNs)
+extern WORKUNIT_API void getWorkunitTotalTime(IConstWorkUnit* workunit, const char* creator, unsigned __int64 & totalTimeNs, unsigned __int64 & totalThisTimeNs)
 {
     StatisticsFilter summaryTimeFilter(SCTsummary, creator, SSTglobal, GLOBAL_SCOPE, SMeasureTimeNs, StTimeElapsed);
     Owned<IConstWUStatistic> totalThorTime = getStatistic(workunit, summaryTimeFilter);

+ 1 - 1
common/workunit/workunit.hpp

@@ -1439,7 +1439,7 @@ extern WORKUNIT_API void associateLocalFile(IWUQuery * query, WUFileType type, c
 interface ITimeReporter;
 extern WORKUNIT_API void updateWorkunitTimeStat(IWorkUnit * wu, StatisticScopeType scopeType, const char * scope, StatisticKind kind, const char * description, unsigned __int64 value);
 extern WORKUNIT_API void updateWorkunitTimings(IWorkUnit * wu, ITimeReporter *timer);
-extern WORKUNIT_API void getWorkunitTotalTime(IConstWorkUnit* workunit, const char* creator, unsigned& totalTimeNs, unsigned& totalThisTimeNs);
+extern WORKUNIT_API void getWorkunitTotalTime(IConstWorkUnit* workunit, const char* creator, unsigned __int64 & totalTimeNs, unsigned __int64 & totalThisTimeNs);
 extern WORKUNIT_API IConstWUStatistic * getStatistic(IConstWorkUnit * wu, const IStatisticsFilter & filter);
 
 extern WORKUNIT_API const char *getTargetClusterComponentName(const char *clustname, const char *processType, StringBuffer &name);

+ 2 - 2
dali/base/dasds.cpp

@@ -5359,8 +5359,8 @@ public:
                         offset_t fSize = iFileIO->size();
                         if (fSize > lastGood)
                         {
-                            size32_t diff = fSize - lastGood;
-                            LOG(MCoperatorError, unknownJob, "Delta file '%s', has %d bytes of trailing data (possible power loss during save?), file size: %"I64F"d, last committed size: %"I64F"d", filename, diff, fSize, lastGood);
+                            offset_t diff = fSize - lastGood;
+                            LOG(MCoperatorError, unknownJob, "Delta file '%s', has %"I64F"d bytes of trailing data (possible power loss during save?), file size: %"I64F"d, last committed size: %"I64F"d", filename, diff, fSize, lastGood);
                             LOG(MCoperatorError, unknownJob, "Resetting delta file '%s' to size: %"I64F"d", filename, lastGood);
                             iFileIO->close();
                             backup(filename);

+ 12 - 12
dali/daliadmin/daliadmin.cpp

@@ -1771,7 +1771,7 @@ static void workunittimings(const char *wuid)
             {
                 if ((name.length()>11)&&(memcmp("Graph graph",name.str(),11)==0))
                 {
-                    unsigned time = (iter->query().getPropInt64("@value") / 1000000);
+                    unsigned time = (unsigned)(iter->query().getPropInt64("@value") / 1000000);
                     displayGraphTiming(name.str(), time);
                 }
             }
@@ -2054,11 +2054,11 @@ struct CTreeItem : public CInterface
     String *tail;
     CTreeItem *parent;
     unsigned index;
-    unsigned startOffset;
-    unsigned endOffset;
-    unsigned adjust;
+    offset_t startOffset;
+    offset_t endOffset;
+    offset_t adjust;
     bool supressidx;
-    CTreeItem(CTreeItem *_parent, String *_tail, unsigned _index, unsigned _startOffset)
+    CTreeItem(CTreeItem *_parent, String *_tail, unsigned _index, offset_t _startOffset)
     {
         parent = LINK(_parent);
         startOffset = _startOffset;
@@ -2082,8 +2082,8 @@ struct CTreeItem : public CInterface
         if ((index!=0)||tail->IsShared())
             xpath.append('[').append(index+1).append(']');
     }
-    unsigned size() { return endOffset?(endOffset-startOffset):0; }
-    unsigned adjustedSize(bool &adjusted) { adjusted = (adjust!=0); return size()-adjust; }
+    offset_t size() { return endOffset?(endOffset-startOffset):0; }
+    offset_t adjustedSize(bool &adjusted) { adjusted = (adjust!=0); return size()-adjust; }
 };
 
 class CXMLSizesParser : public CInterface
@@ -2104,7 +2104,7 @@ class CXMLSizesParser : public CInterface
         {
             CTreeItem **left = (CTreeItem **)_left;
             CTreeItem **right = (CTreeItem **)_right;
-            return ((*right)->size() - (*left)->size());
+            return (int)((*right)->size() - (*left)->size());
         }
     public:
 
@@ -2145,7 +2145,7 @@ class CXMLSizesParser : public CInterface
             assertex(tos);
             tos->endOffset = endOffset;
             bool adjusted;
-            unsigned sz = tos->adjustedSize(adjusted);
+            offset_t sz = tos->adjustedSize(adjusted);
             if (sz>=limit)
             {
                 CTreeItem *parent = tos->parent;
@@ -2170,7 +2170,7 @@ class CXMLSizesParser : public CInterface
                 CTreeItem &match = arr.item(m);
                 StringBuffer xpath;
                 match.getXPath(xpath);
-                printf("xpath=%s, size=%d\n", xpath.str(), match.size());
+                printf("xpath=%s, size=%"I64F"d\n", xpath.str(), match.size());
             }
         }
         void printResultTree()
@@ -2181,14 +2181,14 @@ class CXMLSizesParser : public CInterface
             ForEachItemIn(i, arr) {
                 CTreeItem &item = arr.item(i);
                 bool adjusted;
-                unsigned sz = item.adjustedSize(adjusted);
+                offset_t sz = item.adjustedSize(adjusted);
                 if (sz>=limit) {
                     res.clear();
                     item.getXPath(res);
                     if (adjusted)
                         res.append(" (rest)");
                     res.padTo(40);
-                    res.appendf(" %10d(%5.2f%%)",sz,((float)sz*100.0)/(float)totalSize);
+                    res.appendf(" %10"I64F"d(%5.2f%%)",sz,((float)sz*100.0)/(float)totalSize);
                     printf("%s\n",res.str());
                 }
             }

+ 2 - 2
dali/ft/daftformat.cpp

@@ -673,7 +673,7 @@ void CCsvPartitioner::storeFieldName(const char * start, unsigned len)
             fieldName.setCharAt(0, '_');
         }
 
-        for ( int i = 1; i < fieldName.length(); i++)
+        for ( unsigned i = 1; i < fieldName.length(); i++)
         {
             act = fieldName.charAt(i);
             if ( !(isalnum(act) || act == '_' || act == '$') )
@@ -1002,7 +1002,7 @@ void CUtfPartitioner::storeFieldName(const char * start, unsigned len)
             fieldName.setCharAt(0, '_');
         }
 
-        for ( int i = 1; i < fieldName.length(); i++)
+        for ( unsigned i = 1; i < fieldName.length(); i++)
         {
             act = fieldName.charAt(i);
             if ( !(isalnum(act) || act == '_' || act == '$') )

+ 1 - 1
dali/ft/ftbase.cpp

@@ -599,7 +599,7 @@ void OutputProgress::restore(IPropertyTree * tree)
     outputCRC = tree->getPropInt("@outputCRC");
     outputLength = tree->getPropInt64("@outputLength");
     resultTime.setString(tree->queryProp("@modified"));
-    hasCompressed = tree->getPropInt("@compressed");
+    hasCompressed = tree->getPropInt("@compressed") != 0;
     compressedPartSize = tree->getPropInt64("@compressedPartSize");
 }
 

+ 1 - 1
deployment/configutils/confighelper.cpp

@@ -275,7 +275,7 @@ void CConfigHelper::addNewComponentsFromBuildSetToEnv(IPropertyTree *pEnvTree) c
     if (sCompArray.length() == 0)
         return;
 
-    for (int idx = 0; idx < sCompArray.length(); idx++)
+    for (unsigned idx = 0; idx < sCompArray.length(); idx++)
     {
         StringBuffer xpath;
         xpath.appendf("%s/%s/%s[%s=\"%s\"]", XML_TAG_PROGRAMS, XML_TAG_BUILD, XML_TAG_BUILDSET, XML_ATTR_NAME, (sCompArray.item(idx)));

+ 1 - 1
deployment/deployutils/configenvhelper.cpp

@@ -826,7 +826,7 @@ bool CConfigEnvHelper::handleRoxieSlaveConfig(const char* xmlArg)
         RemoveSlaves(pRoxie, true);
         RemoveSlaves(pRoxie, false);
 
-        for (int i=0; i<computers.size(); i++)
+        for (unsigned i=0; i<computers.size(); i++)
         {
           IPropertyTree* pComputer = computers[i];
           const char* szComputer = pComputer->queryProp(XML_ATTR_NAME);

+ 4 - 4
ecl/ecl-bundle/ecl-bundle.cpp

@@ -425,7 +425,7 @@ public:
     virtual bool checkDependencies(const IBundleCollection &allBundles, const IBundleInfo *bundle, bool going) const
     {
         bool ok = true;
-        for (int i = 0; i < depends.length(); i++)
+        for (unsigned i = 0; i < depends.length(); i++)
         {
             if (!checkDependency(allBundles, depends.item(i), bundle, going))
                 ok = false;
@@ -495,7 +495,7 @@ private:
         else if (depVersions.length() > 1)
         {
             bool ok = false;
-            for (int i = 1; i < depVersions.length(); i++)
+            for (unsigned i = 1; i < depVersions.length(); i++)
                 if (dependentBundle->checkVersion(depVersions.item(i)))
                     ok = true;
             if (!ok)
@@ -531,7 +531,7 @@ private:
         StringBuffer cleaned;
         found++;  // skip the '
         unsigned foundLen = re.findlen()-2; // and the trailing ''
-        for (int i = 0; i < foundLen; i++)
+        for (unsigned i = 0; i < foundLen; i++)
         {
             unsigned char c = found[i];
             if (c=='\\')
@@ -1055,7 +1055,7 @@ private:
                 if (depVersions.length() > 1)
                 {
                     matching = false;
-                    for (int i = 1; i < depVersions.length(); i++)
+                    for (unsigned i = 1; i < depVersions.length(); i++)
                         if (dependentBundle->checkVersion(depVersions.item(i)))
                             matching = true;
                     if (!matching)

+ 3 - 3
ecl/eclagent/eclgraph.cpp

@@ -1232,9 +1232,9 @@ void EclGraph::execute(const byte * parentExtract)
         StringBuffer description;
         formatGraphTimerLabel(description, queryGraphName(), 0, 0);
 
-        unsigned totalTimeNs = 0;
-        unsigned totalThisTimeNs = 0;
-        unsigned elapsedNs = milliToNano(elapsed);
+        unsigned __int64 totalTimeNs = 0;
+        unsigned __int64 totalThisTimeNs = 0;
+        unsigned __int64 elapsedNs = milliToNano(elapsed);
         const char *totalTimeStr = "Total cluster time";
         getWorkunitTotalTime(wu, "hthor", totalTimeNs, totalThisTimeNs);
 

+ 1 - 1
ecl/schedulectrl/eventqueue.cpp

@@ -306,7 +306,7 @@ int CScheduleTimer::run()
             nowdt.setNow();
             if(nextdt > nowdt)
             {
-                long time = 1000*(nextdt.getSimple()-nowdt.getSimple());
+                unsigned time = (unsigned)(1000*(nextdt.getSimple()-nowdt.getSimple()));
                 waiter.wait(time);
             }
             nowdt.setNow();

+ 1 - 1
esp/bindings/http/platform/httpservice.cpp

@@ -860,7 +860,7 @@ static void httpGetDirectory(CHttpRequest* request, CHttpResponse* response, con
         StringBuffer s;
         entry->setProp("name", dir->getName(s));
         if (!dir->isDir())
-            entry->setPropInt("size", dir->getFileSize());
+            entry->setPropInt64("size", dir->getFileSize());
         CDateTime cdt;
         dir->getModifiedTime(cdt);
         entry->setProp("modified", cdt.getString(s.clear(), false));

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

@@ -167,6 +167,7 @@ MemoryBuffer& CLocalDataLogger::readData(MemoryBuffer& dataCached,const char* ca
                     if (io)
                     {
                         DBGLOG("Managed to open");
+                        //MORE: Should check size isn't > 2^32
                         size32_t filesize = io->size();
                         io->read(0, filesize, dataCached.reserveTruncate(filesize));
                         DBGLOG("Managed to read");

+ 2 - 2
esp/platform/sechandler.cpp

@@ -164,7 +164,7 @@ bool SecHandler::authorizeSecReqFeatures(StringArray & features, IEspStringIntMa
     
     if(m_secmgr.get() == NULL)
     {
-        for(int i = 0; i < features.length(); i++)
+        for(unsigned i = 0; i < features.length(); i++)
         {
             const char* feature = features.item(i);
             if(feature != NULL && feature[0] != 0)
@@ -184,7 +184,7 @@ bool SecHandler::authorizeSecReqFeatures(StringArray & features, IEspStringIntMa
 
     std::map<std::string, std::string> namemap;
 
-    int i;
+    unsigned i;
     for(i = 0; i < features.length(); i++)
     {
         const char* feature = features.item(i);

+ 8 - 7
esp/services/ws_workunits/ws_workunitsHelpers.cpp

@@ -346,7 +346,8 @@ void WsWuInfo::addTimerToList(SCMStringBuffer& name, const char * scope, IConstW
     name.s.replace('_', ' '); // yuk!
     t->setName(name.str());
     t->setValue(fd.str());
-    t->setCount(stat.getCount());
+    //MORE: This could overflow.
+    t->setCount((unsigned)stat.getCount());
 
     if (version > 1.19)
     {
@@ -375,7 +376,7 @@ void WsWuInfo::getTimers(IEspECLWorkunit &info, unsigned flags)
     try
     {
         unsigned __int64 totalThorTimeValue = 0;
-        unsigned totalThorTimerCount = 0; //Do we need this?
+        unsigned __int64 totalThorTimerCount = 0; //Do we need this?
 
         IArrayOf<IEspECLTimer> timers;
         StatisticsFilter filter;
@@ -425,7 +426,7 @@ void WsWuInfo::getTimers(IEspECLWorkunit &info, unsigned flags)
             else
                 t->setName(TOTALTHORTIME);
             t->setValue(totalThorTimeText.str());
-            t->setCount(totalThorTimerCount);
+            t->setCount((unsigned)totalThorTimerCount);
             timers.append(*t.getLink());
         }
 
@@ -807,7 +808,7 @@ void WsWuInfo::getGraphTimingData(IArrayOf<IConstECLTimingData> &timingData, uns
         unsigned subGraphId;
         if (parseGraphScope(scope.str(), graphName, graphNum, subGraphId))
         {
-            unsigned time = nanoToMilli(cur.getValue());
+            unsigned time = (unsigned)nanoToMilli(cur.getValue());
 
             SCMStringBuffer name;
             cur.getDescription(name, true);
@@ -846,7 +847,7 @@ void WsWuInfo::legacyGetGraphTimingData(IArrayOf<IConstECLTimingData> &timingDat
 
         if (parseGraphTimerLabel(name.str(), graphName, graphNum, subGraphNum, subId))
         {
-            unsigned time = nanoToMilli(cur.getValue());
+            unsigned time = (unsigned)nanoToMilli(cur.getValue());
 
             Owned<IEspECLTimingData> g = createECLTimingData();
             g->setName(name.str());
@@ -920,7 +921,7 @@ unsigned WsWuInfo::getTotalThorTime()
     Owned<IConstWUStatisticIterator> times = &cw->getStatistics(&filter);
     ForEach(*times)
     {
-        totalThorTimeMS += nanoToMilli(times->query().getValue());
+        totalThorTimeMS += (unsigned)nanoToMilli(times->query().getValue());
     }
 
     return totalThorTimeMS;
@@ -938,7 +939,7 @@ unsigned WsWuInfo::getLegacyTotalThorTime()
     {
         times->query().getDescription(oldname, false);      // description will be set up
         if (streq(oldname.str(), TOTALTHORTIME))
-            return nanoToMilli(times->query().getValue());
+            return (unsigned)nanoToMilli(times->query().getValue());
     }
     return 0;
 }

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

@@ -492,7 +492,7 @@ int HttpClient::sendRequest(int times, HttpStat& stat, StringBuffer& req)
     if(httptest_tracelevel > 5)
         fprintf(m_ofile, ">>sending out request to %s:%d for %d times\n", m_host.str(), m_port, times);
 
-    __int64 start = msTick();
+    unsigned start = msTick();
     int slowest = 0;
     int fastest = 2147483647;
     for(int i = 0; i < times; i++)
@@ -540,7 +540,7 @@ int HttpClient::sendRequest(int times, HttpStat& stat, StringBuffer& req)
         if(httptest_tracelevel > 10)
             fprintf(m_ofile, "%s%s%s\n", sepstr, request.str(), sepstr);
 
-        __int64 start1 = msTick();
+        unsigned start1 = msTick();
 
         socket->write(request.str(), request.length());
 
@@ -564,7 +564,7 @@ int HttpClient::sendRequest(int times, HttpStat& stat, StringBuffer& req)
         socket->shutdown();
         socket->close();
         fflush(m_ofile);
-        __int64 end1 = msTick();
+        unsigned end1 = msTick();
         int duration = end1 - start1;
         if(duration <= fastest)
             fastest = duration;
@@ -575,7 +575,7 @@ int HttpClient::sendRequest(int times, HttpStat& stat, StringBuffer& req)
             fprintf(stderr, "sent out %d\n", i);
     }
 
-    __int64 end = msTick();
+    unsigned end = msTick();
     stat.msecs = end - start;
     stat.numrequests = times;
     stat.totalreqlen = times * request.length();

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

@@ -1138,7 +1138,7 @@ int HttpClient::sendStressRequest(StringBuffer& request, HttpStat* stat)
     if(http_tracelevel >= 10)
         fprintf(m_logfile, "%s%s%s", sepstr, request.str(), sepstr);
 
-    __int64 start = msTick();
+    unsigned start = msTick();
 
     Owned<CSimpleSocket> sock = new CSimpleSocket(m_ssctx.get(), m_logfile);
     
@@ -1169,7 +1169,7 @@ int HttpClient::sendStressRequest(StringBuffer& request, HttpStat* stat)
         }
     }
     sock->close();
-    __int64 end = msTick();
+    unsigned end = msTick();
     int duration = end - start;
 
     if(http_tracelevel >= 5)
@@ -1461,7 +1461,7 @@ int HttpClient::sendRequest(StringBuffer& req, IFileIO* request_output, IFileIO*
     if(request_output)
         request_output->write(0, request.length(), request.str());
 
-    __int64 start1 = msTick();
+    unsigned start1 = msTick();
 
     SocketEndpoint ep;
     ep.set(m_host.str(), m_port);
@@ -1523,7 +1523,7 @@ int HttpClient::sendRequest(StringBuffer& req, IFileIO* request_output, IFileIO*
     socket->shutdown();
     socket->close();
 
-    __int64 end1 = msTick();
+    unsigned end1 = msTick();
 
     int duration = end1 - start1;
 

+ 4 - 4
roxie/ccd/ccdcontext.cpp

@@ -1339,8 +1339,8 @@ public:
                 graph->abort();
             if (workUnit)
             {
-                unsigned totalTimeNs = 0;
-                unsigned totalThisTimeNs = 0;
+                unsigned __int64 totalTimeNs = 0;
+                unsigned __int64 totalThisTimeNs = 0;
                 const char *totalTimeStr = "Total cluster time";
                 getWorkunitTotalTime(workUnit, "roxie", totalTimeNs, totalThisTimeNs);
 
@@ -2341,7 +2341,7 @@ public:
         slaveLogCtx.putStatProcessed(subgraphId, activityId, _idx, _processed);
     }
 
-    virtual void mergeActivityStats(const CRuntimeStatisticCollection &fromStats, unsigned subgraphId, unsigned activityId, const ActivityTimeAccumulator &_totalCycles, unsigned __int64 _localCycles) const
+    virtual void mergeActivityStats(const CRuntimeStatisticCollection &fromStats, unsigned subgraphId, unsigned activityId, const ActivityTimeAccumulator &_totalCycles, cycle_t _localCycles) const
     {
         const SlaveContextLogger &slaveLogCtx = static_cast<const SlaveContextLogger &>(logctx);
         slaveLogCtx.putStats(subgraphId, activityId, fromStats);
@@ -2704,7 +2704,7 @@ public:
         }
     }
 
-    virtual void mergeActivityStats(const CRuntimeStatisticCollection &fromStats, unsigned subgraphId, unsigned activityId, const ActivityTimeAccumulator &_totalCycles, unsigned __int64 _localCycles) const
+    virtual void mergeActivityStats(const CRuntimeStatisticCollection &fromStats, unsigned subgraphId, unsigned activityId, const ActivityTimeAccumulator &_totalCycles, cycle_t _localCycles) const
     {
         if (graphStats)
         {

+ 1 - 1
roxie/ccd/ccdcontext.hpp

@@ -59,7 +59,7 @@ interface IRoxieSlaveContext : extends IRoxieContextLogger
     virtual void onFileCallback(const RoxiePacketHeader &header, const char *lfn, bool isOpt, bool isLocal) = 0;
     virtual IActivityGraph * getLibraryGraph(const LibraryCallFactoryExtra &extra, IRoxieServerActivity *parentActivity) = 0;
     virtual void noteProcessed(unsigned subgraphId, unsigned activityId, unsigned _idx, unsigned _processed) const = 0;
-    virtual void mergeActivityStats(const CRuntimeStatisticCollection &fromStats, unsigned subgraphId, unsigned activityId, const ActivityTimeAccumulator &_totalCycles, unsigned __int64 _localCycles) const = 0;
+    virtual void mergeActivityStats(const CRuntimeStatisticCollection &fromStats, unsigned subgraphId, unsigned activityId, const ActivityTimeAccumulator &_totalCycles, cycle_t _localCycles) const = 0;
     virtual IProbeManager *queryProbeManager() const = 0;
     virtual IDebuggableContext *queryDebugContext() const = 0;
     virtual void printResults(IXmlWriter *output, const char *name, unsigned sequence) = 0;

+ 1 - 0
roxie/ccd/ccdkey.cpp

@@ -378,6 +378,7 @@ public:
             size32_t size = recordSize->getFixedSize();
             if (length % size)
                 throw MakeStringException(ROXIE_FILE_ERROR, "File size %"I64F"u is not a multiple of fixed record size %u", length, size);
+            //MORE: This could silently wrap
             maxPtrs += length / size;
         }
         else

+ 10 - 10
roxie/ccd/ccdmain.cpp

@@ -415,7 +415,7 @@ int STARTQUERY_API start_query(int argc, const char *argv[])
     init_signals();
 
     // stand alone usage only, not server
-    for (unsigned i=0; i<argc; i++)
+    for (unsigned i=0; i<(unsigned)argc; i++)
     {
         if (stricmp(argv[i], "--help")==0 ||
             stricmp(argv[i], "-h")==0)
@@ -895,17 +895,17 @@ int STARTQUERY_API start_query(int argc, const char *argv[])
         {
             numChannels = numNodes;
             unsigned cyclicOffset = topology->getPropInt("@cyclicOffset", 1);
-            for (int i=0; i<numNodes; i++)
+            for (unsigned i=0; i<numNodes; i++)
             {
                 // Note this code is a little confusing - easy to get the cyclic offset backwards
                 // cyclic offset means node n+offset has copy 2 for channel n, so node n has copy 2 for channel n-offset
-                int channel = i+1;
-                for (int copy=0; copy<numDataCopies; copy++)
+                int channel = (int)i+1;
+                for (unsigned copy=0; copy<numDataCopies; copy++)
                 {
                     if (channel < 1)
                         channel = channel + numNodes;
                     addChannel(i, channel, copy);
-                    channel = channel - cyclicOffset;
+                    channel -= cyclicOffset;
                 }
             }
         }
@@ -914,10 +914,10 @@ int STARTQUERY_API start_query(int argc, const char *argv[])
             if (!channelsPerNode)
                 throw MakeStringException(MSGAUD_operator, ROXIE_INVALID_TOPOLOGY, "Invalid topology file - channelsPerNode should be > 0");
             numChannels = numNodes * channelsPerNode;
-            for (int i=0; i<numNodes; i++)
+            for (unsigned i=0; i<numNodes; i++)
             {
-                int channel = i+1;
-                for (int copy=0; copy<channelsPerNode; copy++)
+                int channel = (int)(i+1);
+                for (unsigned copy=0; copy<channelsPerNode; copy++)
                 {
                     addChannel(i, channel, copy);
                     channel += numNodes;
@@ -930,11 +930,11 @@ int STARTQUERY_API start_query(int argc, const char *argv[])
                 throw MakeStringException(MSGAUD_operator, ROXIE_INVALID_TOPOLOGY, "Invalid topology file - numChannels not an integer");
             numChannels = numNodes / numDataCopies;
             int channel = 1;
-            for (int i=0; i<numNodes; i++)
+            for (unsigned i=0; i<numNodes; i++)
             {
                 addChannel(i, channel, 0);
                 channel++;
-                if (channel > numChannels)
+                if ((unsigned)channel > numChannels)
                     channel = 1;
             }
         }

+ 2 - 2
roxie/ccd/ccdserver.cpp

@@ -318,7 +318,7 @@ public:
     {
         ctx->noteProcessed(subgraphId, activityId, _idx, _processed);
     }
-    virtual void mergeActivityStats(const CRuntimeStatisticCollection &fromStats, unsigned subgraphId, unsigned activityId, const ActivityTimeAccumulator &_totalCycles, unsigned __int64 _localCycles) const
+    virtual void mergeActivityStats(const CRuntimeStatisticCollection &fromStats, unsigned subgraphId, unsigned activityId, const ActivityTimeAccumulator &_totalCycles, cycle_t _localCycles) const
     {
         ctx->mergeActivityStats(fromStats, subgraphId, activityId, _totalCycles, _localCycles);
     }
@@ -497,7 +497,7 @@ public:
         }
     }
 
-    virtual void mergeActivityStats(const CRuntimeStatisticCollection &fromStats, const ActivityTimeAccumulator &_totalCycles, unsigned __int64 _localCycles) const
+    virtual void mergeActivityStats(const CRuntimeStatisticCollection &fromStats, const ActivityTimeAccumulator &_totalCycles, cycle_t _localCycles) const
     {
         if (_totalCycles.totalCycles || _localCycles)
         {

+ 1 - 1
roxie/ccd/ccdserver.hpp

@@ -201,7 +201,7 @@ interface IRoxieServerActivityFactory : extends IActivityFactory
     virtual IHThorArg &getHelper() const = 0;
     virtual IRoxieServerActivity *createFunction(IHThorArg &helper, IProbeManager *_probeManager) const = 0;
     virtual void noteProcessed(unsigned idx, unsigned processed) const = 0;
-    virtual void mergeActivityStats(const CRuntimeStatisticCollection &fromStats, const ActivityTimeAccumulator &totalCycles, unsigned __int64 localCycles) const = 0;
+    virtual void mergeActivityStats(const CRuntimeStatisticCollection &fromStats, const ActivityTimeAccumulator &totalCycles, cycle_t localCycles) const = 0;
     virtual void onCreateChildQueries(IRoxieSlaveContext *ctx, IHThorArg *colocalArg, IArrayOf<IActivityGraph> &childGraphs) const = 0;
     virtual void createChildQueries(IArrayOf<IActivityGraph> &childGraphs, IRoxieServerActivity *parentActivity, IProbeManager *_probeManager, const IRoxieContextLogger &_logctx) const = 0;
     virtual void noteStarted() const = 0;

+ 1 - 1
roxie/ccd/ccdstate.cpp

@@ -142,7 +142,7 @@ public:
         if (now > goTime)
             return 0;
         else
-            return goTime - now;
+            return (unsigned)(goTime - now);
     }
 };
 

+ 1 - 1
roxie/roxie/roxie.cpp

@@ -44,7 +44,7 @@ static void roxie_server_usage()
 
 int main(int argc, const char *argv[])
 {
-    for (unsigned i=0; i<argc; i++)
+    for (unsigned i=0; i<(unsigned)argc; i++)
     {
         if (stricmp(argv[i], "--help")==0 ||
             stricmp(argv[i], "-h")==0)

+ 1 - 1
roxie/roxieclient/roxieclient.cpp

@@ -97,7 +97,7 @@ int CDataOutputCache::writeOutput()
         try {
             outputstream->writeBytes(finger, len);
         }
-        catch (IException *e) {
+        catch (IException *) {
             delete mb;
             throw;
         }

+ 1 - 1
rtl/eclrtl/eclrtl.cpp

@@ -5404,7 +5404,7 @@ ECLRTL_API void xmlDecodeStrX(size32_t & outLen, char * & out, size32_t inLen, c
 
 bool hasPrefix(const UChar * ustr, const UChar * end, const char * str, unsigned len)
 {
-    if (end - ustr < len)
+    if ((unsigned)(end - ustr) < len)
         return false;
     while (len--)
     {

+ 8 - 8
rtl/eclrtl/rtlint.cpp

@@ -581,10 +581,10 @@ void rtlWriteInt(void * self, __int64 val, unsigned length)
 {
     switch (length)
     {
-    case 1: rtlWriteInt1(self, val); break;
-    case 2: rtlWriteInt2(self, val); break;
-    case 3: rtlWriteInt3(self, val); break;
-    case 4: rtlWriteInt4(self, val); break;
+    case 1: rtlWriteInt1(self, (unsigned)val); break;
+    case 2: rtlWriteInt2(self, (unsigned)val); break;
+    case 3: rtlWriteInt3(self, (unsigned)val); break;
+    case 4: rtlWriteInt4(self, (unsigned)val); break;
     case 5: rtlWriteInt5(self, val); break;
     case 6: rtlWriteInt6(self, val); break;
     case 7: rtlWriteInt7(self, val); break;
@@ -599,10 +599,10 @@ void rtlWriteSwapInt(void * self, __int64 val, unsigned length)
 {
     switch (length)
     {
-    case 1: rtlWriteSwapInt1(self, val); break;
-    case 2: rtlWriteSwapInt2(self, val); break;
-    case 3: rtlWriteSwapInt3(self, val); break;
-    case 4: rtlWriteSwapInt4(self, val); break;
+    case 1: rtlWriteSwapInt1(self, (unsigned)val); break;
+    case 2: rtlWriteSwapInt2(self, (unsigned)val); break;
+    case 3: rtlWriteSwapInt3(self, (unsigned)val); break;
+    case 4: rtlWriteSwapInt4(self, (unsigned)val); break;
     case 5: rtlWriteSwapInt5(self, val); break;
     case 6: rtlWriteSwapInt6(self, val); break;
     case 7: rtlWriteSwapInt7(self, val); break;

+ 1 - 1
rtl/nbcd/nbcd.cpp

@@ -174,7 +174,7 @@ Decimal & Decimal::divide(const Decimal & other)
     memset(temp, 0, numeratorDigits+spare);             // ensure two zero in msb, and below lsb.  Also 2 zeros for looking 2 bytes ahead..
 
     byte * numerator = temp+spare;
-    if (numeratorDigits > nd1)
+    if (numeratorDigits > (unsigned)nd1)
         memcpy(numerator + numeratorDigits - 1 - nd1, digits+lo1, nd1);
     else
         memcpy(numerator, digits + hi1 + 1 - (numeratorDigits-1), numeratorDigits-1);

+ 2 - 2
system/jlib/jdebug.cpp

@@ -516,7 +516,7 @@ public:
             cb.report(ts.scope, ts.description, cycle_to_nanosec(ts.totalcycles), cycle_to_nanosec(ts.maxcycles), ts.count);
         }
     }
-    virtual void addTiming(const char * scope, unsigned __int64 cycles)
+    virtual void addTiming(const char * scope, cycle_t cycles)
     {
         CriticalBlock b(c);
         TimeSectionInfo *info = sections->find(scope);
@@ -600,7 +600,7 @@ public:
             PrintLog(getTimings(str).str());
         }
     }
-    virtual void mergeTiming(const char * scope, const __int64 totalcycles, const __int64 maxcycles, const unsigned count)
+    virtual void mergeTiming(const char * scope, cycle_t totalcycles, cycle_t maxcycles, const unsigned count)
     {
         CriticalBlock b(c);
         TimeSectionInfo *info = sections->find(scope);

+ 2 - 2
system/jlib/jdebug.hpp

@@ -91,8 +91,8 @@ class StringBuffer;
 class MemoryBuffer;
 struct ITimeReporter : public IInterface
 {
-  virtual void addTiming(const char * scope, unsigned __int64 cycles) = 0;
-  virtual void mergeTiming(const char * scope, const __int64 totalcycles, const __int64 maxcycles, const unsigned count) = 0;
+  virtual void addTiming(const char * scope, cycle_t cycles) = 0;
+  virtual void mergeTiming(const char * scope, cycle_t totalcycles, cycle_t maxcycles, const unsigned count) = 0;
   virtual unsigned numSections() = 0;
   virtual __int64 getTime(unsigned idx) = 0;
   virtual __int64 getMaxTime(unsigned idx) = 0;

+ 1 - 1
system/jlib/jmd5.cpp

@@ -471,7 +471,7 @@ void md5_filesum(const char* filename, StringBuffer& outstring)
             throw MakeStringException(1, "File %s only read %llu of %llu bytes", file->queryFilename(), size-readPos, size);
 
         readPos += sizeRead;
-        md5_append(&context, (const unsigned char *)contents, sizeRead);
+        md5_append(&context, (const unsigned char *)contents, (int)sizeRead);
     }
     md5_finish(&context,digest);
 

+ 1 - 1
system/mp/mpcomm.cpp

@@ -1613,7 +1613,7 @@ CMPConnectThread::CMPConnectThread(CMPServer *_parent, unsigned port)
         assertex(maxPort >= minPort);
         Owned<IJSOCK_Exception> lastErr;
         unsigned numPorts = maxPort - minPort + 1;
-        for (int retries = 0; retries < numPorts * 3; retries++)
+        for (unsigned retries = 0; retries < numPorts * 3; retries++)
         {
             port = minPort + getRandom() % numPorts;
             try

+ 1 - 1
system/security/test/ldapsecuritytest/ldapsecuritytest.cpp

@@ -143,7 +143,7 @@ public:
                 access = m_secmgr->authorizeEx(m_rtype, *usr, m_resource.get());
             }
             time(&stop);
-            int span = stop - start;
+            int span = (int)(stop - start);
             total += span;
             if(mint == -1 || mint > span)
                 mint = span;

+ 3 - 3
system/xmllib/xsdparser.cpp

@@ -79,7 +79,7 @@ public:
     { 
         if (m_attrs) 
         { 
-            for (int i=0; i<m_nAttrs; i++)
+            for (size_t i=0; i<m_nAttrs; i++)
                 m_attrs[i]->Release();
             delete[] m_attrs; 
         } 
@@ -96,8 +96,8 @@ public:
     const char* queryName() { return m_name.get(); }
 
     size_t getAttrCount() { return m_nAttrs; }
-    IXmlAttribute* queryAttr(int idx) { assert(idx>=0 && idx<m_nAttrs); return m_attrs[idx]; }
-    const char* queryAttrName(int idx) { assert(idx>=0 && idx<m_nAttrs); return m_attrs[idx]->queryName(); }
+    IXmlAttribute* queryAttr(int idx) { assert(idx>=0 && (unsigned)idx<m_nAttrs); return m_attrs[idx]; }
+    const char* queryAttrName(int idx) { assert(idx>=0 && (unsigned)idx<m_nAttrs); return m_attrs[idx]->queryName(); }
 
     void setDefaultValue(const char* v) {  m_defValue.set(v); }
     bool hasDefaultValue() {  return m_defValue.get()!=NULL; }

+ 1 - 1
testing/unittests/dalitests.cpp

@@ -642,7 +642,7 @@ class CDaliTests : public CppUnit::TestFixture
                 io.setown(ifile->open(IFOcreate));
                 io->write(0, 17, "12345678901234567");
                 io->close();
-                Owned<IDistributedFile> dsub = dir.createNew(subd, sub.str());
+                Owned<IDistributedFile> dsub = dir.createNew(subd, sub.str());  // GH->JCS second parameter is wrong
                 dsub->attach(sub.str(),user);
             } catch (IException *e) {
                 StringBuffer msg;

+ 3 - 3
testing/unittests/jlibtests.cpp

@@ -108,7 +108,7 @@ public:
         nr10pct = nr / 10;
         nr150pct = (unsigned)((double)nr * 1.5);
         record = (char *)malloc(rs);
-        for (int i=0;i<rs;i++)
+        for (unsigned i=0;i<rs;i++)
             record[i] = 'a';
         record[rs-1] = '\n';
 
@@ -163,7 +163,7 @@ protected:
             unsigned iter = nr / 40;
 
             __int64 pos = 0;
-            for (int i=0;i<nr;i++)
+            for (unsigned i=0;i<nr;i++)
             {
                 ifileio->write(pos, rs, record);
                 pos += rs;
@@ -189,7 +189,7 @@ protected:
             ifileio = ifile->open(IFOread, extraFlags);
 
             pos = 0;
-            for (int i=0;i<nr;i++)
+            for (unsigned i=0;i<nr;i++)
             {
                 ifileio->read(pos, rs, record);
                 pos += rs;

+ 2 - 2
thorlcr/activities/hashdistrib/thhashdistribslave.cpp

@@ -259,7 +259,7 @@ class CDistributorBase : public CSimpleInterface, implements IHashDistributor, i
             }
             inline bool getSenderFinished() const
             {
-                return atomic_read(&senderFinished);
+                return atomic_read(&senderFinished) != 0;
             }
             inline void checkSenderFinished()
             {
@@ -3480,7 +3480,7 @@ public:
             {
                 case TAKhashjoin:
                     {
-                        bool hintunsortedoutput = getOptBool(THOROPT_UNSORTED_OUTPUT, JFreorderable & joinargs->getJoinFlags());
+                        bool hintunsortedoutput = getOptBool(THOROPT_UNSORTED_OUTPUT, (JFreorderable & joinargs->getJoinFlags()) != 0);
                         bool hintparallelmatch = getOptBool(THOROPT_PARALLEL_MATCH, hintunsortedoutput); // i.e. unsorted, implies use parallel by default, otherwise no point
                         joinhelper.setown(createJoinHelper(*this, joinargs, this, hintparallelmatch, hintunsortedoutput));
                     }

+ 1 - 1
thorlcr/activities/join/thjoinslave.cpp

@@ -212,7 +212,7 @@ public:
         {
             case TAKjoin:
             {
-                bool hintunsortedoutput = getOptBool(THOROPT_UNSORTED_OUTPUT, JFreorderable & helper->getJoinFlags());
+                bool hintunsortedoutput = getOptBool(THOROPT_UNSORTED_OUTPUT, (JFreorderable & helper->getJoinFlags()) != 0);
                 bool hintparallelmatch = getOptBool(THOROPT_PARALLEL_MATCH, hintunsortedoutput); // i.e. unsorted, implies use parallel by default, otherwise no point
                 joinhelper.setown(createJoinHelper(*this, helperjn, this, hintparallelmatch, hintunsortedoutput));
                 break;

+ 1 - 1
thorlcr/activities/selfjoin/thselfjoinslave.cpp

@@ -164,7 +164,7 @@ public:
         input = inputs.item(0);
         startInput(input);
         dataLinkStart();
-        bool hintunsortedoutput = getOptBool(THOROPT_UNSORTED_OUTPUT, JFreorderable & helper->getJoinFlags());
+        bool hintunsortedoutput = getOptBool(THOROPT_UNSORTED_OUTPUT, (JFreorderable & helper->getJoinFlags()) != 0);
         bool hintparallelmatch = getOptBool(THOROPT_PARALLEL_MATCH, hintunsortedoutput); // i.e. unsorted, implies use parallel by default, otherwise no point
 
         if (helper->getJoinFlags()&JFlimitedprefixjoin) {

+ 2 - 2
thorlcr/master/thgraphmanager.cpp

@@ -663,8 +663,8 @@ bool CJobManager::executeGraph(IConstWorkUnit &workunit, const char *graphName,
     workunit.getWuid(wuid);
     const char *totalTimeStr = "Total thor time";
     cycle_t startCycles = get_cycles_now();
-    unsigned totalTimeNs = 0;
-    unsigned totalThisTimeNs = 0;
+    unsigned __int64 totalTimeNs = 0;
+    unsigned __int64 totalThisTimeNs = 0;
     getWorkunitTotalTime(&workunit, "thor", totalTimeNs, totalThisTimeNs);
 
     Owned<IConstWUQuery> query = workunit.getQuery();