Browse Source

HPCC-18652 Fix various windows compile warnings

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 7 years ago
parent
commit
6221b46d45

+ 4 - 4
common/workunit/workunit.cpp

@@ -2203,7 +2203,7 @@ static unsigned readOptValue(const char * start, const char * end, unsigned dft,
     if (start == end)
         return dft;
     char * next;
-    unsigned value = strtoll(start, &next, 10);
+    unsigned value = (unsigned)strtoll(start, &next, 10);
     if (next != end)
         throw makeStringExceptionV(0, "Unexpected characters in %s option '%s'", type, next);
     return value;
@@ -2215,7 +2215,7 @@ static unsigned readValue(const char * start, const char * type)
         throw makeStringExceptionV(0, "Expected a value for the %s option", type);
 
     char * next;
-    unsigned value = strtoll(start, &next, 10);
+    unsigned value = (unsigned)strtoll(start, &next, 10);
     if (*next != '\0')
         throw makeStringExceptionV(0, "Unexpected characters in %s option '%s'", type, next);
     return value;
@@ -5836,8 +5836,8 @@ bool modifyAndWriteWorkUnitXML(char const * wuid, StringBuffer & buf, StringBuff
                 break;
         }
         assertex('>' == *bufPtr);
-        size32_t l = (size32_t)strlen(wuid);
-        assertex(bufPtr-bufStart > l+2); // e.g. at least </W20171111-111111>
+        size_t l = strlen(wuid);
+        assertex((size_t)(bufPtr-bufStart) > l+2); // e.g. at least </W20171111-111111>
         bufPtr -= l+2; // skip back over </wuid
         assertex(0 == memcmp(bufPtr, "</", 2) );
         assertex(0 == memcmp(bufPtr+2, wuid, l));

+ 2 - 2
configuration/configurator/BuildSet.cpp

@@ -162,7 +162,7 @@ void CBuildSetManager::setBuildSetArray(const StringArray &strArray)
 {
     m_buildSetArray.kill();
 
-    for (int idx = 0; idx < strArray.length(); idx++)
+    for (unsigned idx = 0; idx < strArray.length(); idx++)
     {
         Owned<CBuildSet> pBSet = new CBuildSet(nullptr, strArray.item(idx), nullptr, strArray.item(idx));
         assert (pBSet != nullptr);
@@ -170,7 +170,7 @@ void CBuildSetManager::setBuildSetArray(const StringArray &strArray)
     }
 }
 
-const char* CBuildSetManager::getBuildSetSchema(int index) const
+const char* CBuildSetManager::getBuildSetSchema(unsigned index) const
 {
     assert(index < m_buildSetArray.length());
     if (index < m_buildSetArray.length())

+ 1 - 1
configuration/configurator/BuildSet.hpp

@@ -45,7 +45,7 @@ public:
     const char* getBuildSetComponentTypeName(int index) const;
     const char* getBuildSetComponentFileName(int index) const;
     const char* getBuildSetProcessName(int index) const;
-    const char* getBuildSetSchema(int index) const;
+    const char* getBuildSetSchema(unsigned index) const;
     const int getBuildSetSchemaCount() const;
     const int getBuildSetServiceCount() const;
     const int getBuildSetComponentCount() const;

+ 0 - 5
configuration/configurator/ConfigFileComponentUtils.cpp

@@ -24,11 +24,6 @@ CConfigFileComponentUtils::CConfigFileComponentUtils()
     UNIMPLEMENTED;
 }
 
-CConfigFileComponentUtils::~CConfigFileComponentUtils()
-{
-    UNIMPLEMENTED;
-}
-
 void CConfigFileComponentUtils::getAvailableComponets(StringArray& compArray) const
 {
     UNIMPLEMENTED;

+ 0 - 4
configuration/configurator/ConfigFileComponentUtils.hpp

@@ -29,11 +29,7 @@
 class CConfigFileComponentUtils : public CInterface
 {
 public:
-
-    IMPLEMENT_IINTERFACE
-
     CConfigFileComponentUtils();
-    virtual ~CConfigFileComponentUtils();
 
     void getAvailableComponets(::StringArray& compArray) const;
     void getAvailableESPServices(::StringArray& compArray) const;

+ 1 - 1
configuration/configurator/ConfigSchemaHelper.hpp

@@ -106,7 +106,7 @@ public:
     const char* getEnvironmentXPaths(int idx) const
     {
         assert(idx >= 0);
-        assert(m_strArrayEnvXPaths.length() > idx);
+        assert(m_strArrayEnvXPaths.length() > (unsigned)idx);
         return m_strArrayEnvXPaths.item(idx);
     }
 

+ 0 - 1
dali/sasha/saxref.cpp

@@ -381,7 +381,6 @@ struct cDirDesc
     {
         unsigned nf;
         unsigned pf;
-        unsigned xn;
         StringAttr mask;
         const char *fn = decodeName(drv,name,node,numnodes,mask,pf,nf);
         bool misplaced = !grp.queryNode(pf).endpoint().equals(ep);

+ 2 - 2
deployment/deployutils/wizardInputs.cpp

@@ -34,7 +34,7 @@ CInstDetails::CInstDetails(StringBuffer compName, const StringArray &ipAssigned)
 {
     m_ipAssigned.clear();
 
-    for (int i = 0; i < ipAssigned.ordinality(); i++)
+    for (unsigned i = 0; i < ipAssigned.ordinality(); i++)
     {
         m_ipAssigned.append(ipAssigned.item(i));
     }
@@ -1282,7 +1282,7 @@ StringArray& CWizardInputs::getIpAddrMap(const char* buildSetName)
 {
     if (buildSetName && *buildSetName)
     {
-        for (int i = 0; i < m_arrBuildSetsWithAssignedIPs.ordinality(); i++)
+        for (unsigned i = 0; i < m_arrBuildSetsWithAssignedIPs.ordinality(); i++)
         {
             if (stricmp(buildSetName, m_arrBuildSetsWithAssignedIPs.item(i)) == 0)
             {

+ 2 - 2
deployment/envgen/main.cpp

@@ -289,7 +289,7 @@ int main(int argc, char** argv)
   {
     validateIPS(ipAddrs.str());
 
-    for (int nIdx = 0; nIdx < arrAssignIPRanges.length(); nIdx++)
+    for (unsigned nIdx = 0; nIdx < arrAssignIPRanges.length(); nIdx++)
     {
       validateIPS(arrAssignIPRanges.item(nIdx));
     }
@@ -346,7 +346,7 @@ int main(int argc, char** argv)
 
         if (arrXPaths.length() > 0)
         {
-            int nCount = 0;
+            unsigned nCount = 0;
 
             while (nCount < arrXPaths.length())
             {

+ 1 - 1
ecl/hqlcpp/hqlcppcase.cpp

@@ -407,7 +407,7 @@ IHqlExpression * HqlCppCaseInfo::buildIndexedMap(BuildCtx & ctx, const CHqlBound
     HqlExprArray values;
     IHqlExpression * dft = queryActiveTableSelector();  // value doesn't matter as long as it will not occur
     __int64 lower = getIntValue(lowerTableBound, 0);
-    unsigned num = (getIntValue(upperTableBound, 0)-lower)+1;
+    unsigned num = (unsigned)((getIntValue(upperTableBound, 0)-lower)+1);
 
     CHqlBoundExpr indexExpr;
     switch (compareTypeCode)

+ 1 - 1
ecl/hqlcpp/hqlttcpp.cpp

@@ -8953,7 +8953,7 @@ IHqlExpression * DFSLayoutTransformer::createTransformed(IHqlExpression * expr)
                 unsigned dfsPayload = 0;
                 if (payload)
                 {
-                    dfsPayload = getIntValue(payload->queryChild(0));
+                    dfsPayload = (unsigned)getIntValue(payload->queryChild(0));
                     dfsLayout.setown(removeAttribute(dfsLayout, _payload_Atom));
                 }
 

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

@@ -990,7 +990,7 @@ EspHttpBinding* CEspHttpServer::getEspHttpBinding(EspAuthRequest& authReq)
         return espHttpBinding;
     }
 
-    for (unsigned index=0; index<ordinality; index++)
+    for (unsigned index=0; index<(unsigned)ordinality; index++)
     {
         CEspBindingEntry *entry = m_apport->queryBindingItem(index);
         EspHttpBinding* lbind = (entry) ? dynamic_cast<EspHttpBinding*>(entry->queryBinding()) : nullptr;

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

@@ -69,7 +69,7 @@ protected:
 
     bool m_viewConfig;
     int m_MaxRequestEntityLength;
-    int lastSessionCleanUpTime = 0;
+    time_t lastSessionCleanUpTime = 0;
 
     int unsupported();
     EspHttpBinding* getBinding();

+ 1 - 1
esp/platform/sechandler.cpp

@@ -188,7 +188,7 @@ bool SecHandler::validateSecFeaturesAccess(MapStringTo<SecAccessFlags> & accessm
         for(unsigned i = 0; i < features.length(); i++)
         {
             int accessAllowed = pmap->queryValue(features.item(i));
-            if ((accessAllowed == -1) || (reqarray[i] && (accessAllowed < reqarray[i])))
+            if ((accessAllowed == -1) || (reqarray[i] && ((unsigned)accessAllowed < reqarray[i])))
             {
                 if (throwExcpt)
                     throw MakeStringException(-1, "Access Denied!");

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

@@ -1600,9 +1600,9 @@ int HttpClient::sendRequest(StringBuffer& req, IFileIO* request_output, IFileIO*
         bufptr = &buf;
     Owned<IByteOutputStream> ostream = createOutputStream(*bufptr);
     bool isRoxie;
-    int resplen = Http::receiveData(socket.get(), ostream.get(), true, isRoxie, NULL, full_output, content_output);
+    __int64 resplen = Http::receiveData(socket.get(), ostream.get(), true, isRoxie, NULL, full_output, content_output);
     if(http_tracelevel >= 5)
-        fprintf(m_logfile, ">>received response. Response length: %d.\n", resplen);
+        fprintf(m_logfile, ">>received response. Response length: %" I64F "d.\n", resplen);
     if(http_tracelevel >= 10)
         fprintf(m_logfile, "%s\n", bufptr->str());
 

+ 3 - 3
roxie/ccd/ccdserver.cpp

@@ -8449,10 +8449,10 @@ public:
                 anyThisGroup = false;
                 curQuantile = 0;
                 curIndex = 0;
-                curIndexExtra = (numDivisions-1) / 2;   // to ensure correctly rounded up
+                curIndexExtra = (unsigned)((numDivisions-1) / 2);   // to ensure correctly rounded up
                 prevIndex = curIndex-1; // Ensure it doesn't match
-                skipSize = (sorted.ordinality() / numDivisions);
-                skipExtra = (sorted.ordinality() % numDivisions);
+                skipSize = (unsigned)(sorted.ordinality() / numDivisions);
+                skipExtra = (unsigned)(sorted.ordinality() % numDivisions);
             }
 
             if (isQuantileIncluded(curQuantile))

+ 1 - 1
roxie/ccd/ccdserver.hpp

@@ -111,7 +111,7 @@ interface IFinalRoxieInput : extends IInputBase
 
     inline void stopall()
     {
-        for (int i = 0; i < numConcreteOutputs(); i++)
+        for (unsigned i = 0; i < numConcreteOutputs(); i++)
             queryConcreteOutputStream(i)->stop();
     }
 };

+ 2 - 2
rtl/eclrtl/rtlfield.cpp

@@ -3116,8 +3116,8 @@ size32_t RtlDatasetTypeInfo::deserialize(ARowBuilder & builder, IRowDeserializer
         }
         else
         {
-            offset_t startOffset = offset + sizeof(size32_t);
-            offset_t nextOffset = startOffset;
+            size32_t startOffset = offset + sizeof(size32_t);
+            size32_t nextOffset = startOffset;
             offset_t endOffset = in.beginNested();
             while (in.finishedNested(endOffset))
                 nextOffset = child->deserialize(builder, in, nextOffset);

+ 1 - 1
tools/dumpkey/dumpkey.cpp

@@ -179,7 +179,7 @@ int main(int argc, const char **argv)
                     }
                     Linked<IKeyManager> manager;
                 } callback(manager);
-                unsigned count = globals->getPropInt("recs", 1);
+                unsigned __int64 count = globals->getPropInt("recs", 1);
                 const RtlRecordTypeInfo *outRecType = nullptr;
                 if (metadata && metadata->hasProp("_rtlType"))
                 {