Selaa lähdekoodia

Merge branch 'warnings' of github.com:ghalliday/HPCC-Platform into ghalliday-warnings

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 13 vuotta sitten
vanhempi
commit
29d6d0268e

+ 2 - 2
dali/base/dadfs.cpp

@@ -2566,8 +2566,8 @@ public:
                         exprefix, sub->queryLogicalName(), superFmt.str(),
                         queryLogicalName(), subFmt.str());
 #endif
-        bool superLocal = superProp.getPropBool("@local");
-        bool subLocal = subProp.getPropBool("@local");
+        bool superLocal = superProp.getPropBool("@local",false);
+        bool subLocal = subProp.getPropBool("@local",false);
         if (subLocal != superLocal)
             throw MakeStringException(-1,"%s: %s's local setting (%s) is different than %s's (%s)",
                     exprefix, sub->queryLogicalName(), (subLocal?"local":"global"),

+ 4 - 4
esp/bindings/http/platform/httpbinding.cpp

@@ -1413,7 +1413,7 @@ static void genSampleXml(StringStack& parent, IXmlType* type, StringBuffer& out,
         out.appendf("<%s", tag);
         if (ns)
             out.append(' ').append(ns);
-        for (int i=0; i<type->getAttrCount(); i++)
+        for (unsigned i=0; i<type->getAttrCount(); i++)
         {
             IXmlAttribute* attr = type->queryAttr(i);
             out.appendf(" %s='", attr->queryName());
@@ -1481,7 +1481,7 @@ void EspHttpBinding::generateSampleXml(bool isRequest, IEspContext &context, CHt
     MethodInfoArray info;
     getQualifiedNames(context, info);
     StringBuffer element;
-    for (int i=0; i<info.length(); i++)
+    for (unsigned i=0; i<info.length(); i++)
     {
         CMethodInfo& m = info.item(i);
         if (stricmp(m.m_label, methodQName)==0)
@@ -1991,7 +1991,7 @@ int EspHttpBinding::onGetXForm(IEspContext &context, CHttpRequest* request, CHtt
 
         MethodInfoArray info;
         getQualifiedNames(context, info);
-        for (int i=0; i<info.length(); i++)
+        for (unsigned i=0; i<info.length(); i++)
         {
             CMethodInfo& m = info.item(i);
             if (stricmp(m.m_label, methodQName)==0)
@@ -2359,7 +2359,7 @@ void EspHttpBinding::validateResponse(IEspContext& context, CHttpRequest* reques
         v->validate();
         e->appendProp("Result", "No error found");
     } catch (IMultiException* me) {
-        for (int i=0; i<me->ordinality(); i++) 
+        for (unsigned i=0; i<me->ordinality(); i++)
         {
             IException& item = me->item(i);
             StringBuffer s;

+ 2 - 2
esp/bindings/http/platform/httptransport.cpp

@@ -53,7 +53,7 @@ bool httpContentFromFile(const char *filepath, StringBuffer &mimetype, MemoryBuf
         Owned<IFileIO> io = file->open(IFOread);
         if (io)
         {
-            size32_t filesize = io->size();
+            size32_t filesize = (size32_t)io->size();
             io->read(0, filesize, fileContents.reserveTruncate(filesize));
             mimetype.clear();
 
@@ -559,7 +559,7 @@ void CHttpMessage::setContent(IFileIOStream* stream)
     if(stream != NULL)
     {
         m_content.clear();
-        m_content_length = stream->size();
+        m_content_length = (int)stream->size();
         m_content_length64 = stream->size();
         m_content_stream.setown(stream);
     }

+ 1 - 1
roxie/ccd/ccdqueue.cpp

@@ -491,7 +491,7 @@ void SlaveContextLogger::set(IRoxieQueryPacket *packet)
                 traceLength -= debugLen + sizeof(unsigned short);
             }
             // Passing the wuid via the logging context is a bit of a hack...
-            int wuidLen = 0;
+            unsigned wuidLen = 0;
             while (wuidLen < traceLength)
             {
                 if (traceInfo[wuidLen]=='@')

+ 6 - 6
system/security/LdapSecurity/aci.cpp

@@ -327,7 +327,7 @@ public:
     {
         acibuf.appendf("(targetattr = \"%s\") (version %s;acl \"%s\";", m_targetattr.str(), m_version.str(), m_name.str());
         acibuf.append(m_isDeny?"deny (":"allow (");
-        int i;
+        unsigned i;
         for(i = 0; i < m_perms.length(); i++)
         {
             if(i > 0)
@@ -363,7 +363,7 @@ public:
             printf("deny:\n");
         else
             printf("allow:\n");
-        int y;
+        unsigned y;
         for(y = 0; y < m_perms.length(); y++)
         {
             printf("\t%s\n", m_perms.item(y));
@@ -575,7 +575,7 @@ public:
             printf("allow:\n");
         printf("\t%s\n", m_perms.str());
         printf("\nuserdns:\n");
-        int y;
+        unsigned y;
         for(y = 0; y < m_userdns.length(); y++)
         {
             printf("\t%s\n", m_userdns.item(y));
@@ -730,7 +730,7 @@ public:
                 denies = aci.permission();
             else
                 allows = aci.permission();
-            int i;
+            unsigned i;
             for(i = 0; i < aci.groupdns().length(); i++)
             {
                 const char* dn = aci.groupdns().item(i);
@@ -898,7 +898,7 @@ AciProcessor::AciProcessor(IPropertyTree* cfg)
 
 bool AciProcessor::getPermissions(ISecUser& user, IArrayOf<CSecurityDescriptor>& sdlist, IArrayOf<ISecResource>& resources)
 {
-    for(int i = 0; i < sdlist.length(); i++)
+    for(unsigned i = 0; i < sdlist.length(); i++)
     {
         CSecurityDescriptor& sd = sdlist.item(i);
         ISecResource& res = resources.item(i);
@@ -996,7 +996,7 @@ int AciProcessor::sdSegments(CSecurityDescriptor* sd)
         return 0;
 
     const char* sdptr = sd->getDescriptor().toByteArray();
-    int curind = 0;
+    unsigned curind = 0;
     int segs = 0;
     bool endofone = true;
     while(curind < sd->getDescriptor().length())

+ 6 - 4
system/security/LdapSecurity/ldapconnection.cpp

@@ -18,7 +18,9 @@
 
 // LDAP prototypes use char* where they should be using const char *, resulting in lots of spurious warnings
 #pragma warning( disable : 4786 )
+#ifdef __GNUC__
 #pragma GCC diagnostic ignored "-Wwrite-strings"
+#endif
 
 #include "permissions.ipp"
 #include "aci.ipp"
@@ -116,7 +118,7 @@ public:
 
         nextIndex = 0;
 
-        for(int ind = 0; ind < hostArray.length(); ind++)
+        for(unsigned ind = 0; ind < hostArray.length(); ind++)
         {
             DBGLOG("Added ldap server %s", hostArray.item(ind));
         }
@@ -1241,7 +1243,7 @@ public:
     {
         bool ret = true;
 
-        for(int i = 0; i < resources.length(); i++)
+        for(unsigned i = 0; i < resources.length(); i++)
         {
             ISecResource* resource = &resources.item(i);
             if(resource != NULL)
@@ -3023,7 +3025,7 @@ public:
         {
             StringArray allgroups;
             getAllGroups(allgroups);
-            for(int i = 0; i < allgroups.length(); i++)
+            for(unsigned i = 0; i < allgroups.length(); i++)
             {
                 const char* grp = allgroups.item(i);
                 StringBuffer grpdn, usrdn;
@@ -3810,7 +3812,7 @@ private:
 
     void ConvertCToW(unsigned short* pszDest, const CHAR* pszSrc)
     {
-        int i = 0;
+        unsigned i = 0;
         for(i = 0; i < strlen(pszSrc); i++)
             pszDest[i] = (unsigned short) pszSrc[i];
         pszDest[i] = (unsigned short)'\0';

+ 1 - 1
system/security/LdapSecurity/ldapconnection.hpp

@@ -394,7 +394,7 @@ public:
     {
         const char* frombuf = from.toByteArray();
         char tmp[3];
-        for(int i = 0; i < from.length(); i++)
+        for(unsigned i = 0; i < from.length(); i++)
         {
             unsigned char c = frombuf[i];
             sprintf(tmp, "%02X", c);

+ 1 - 1
system/security/LdapSecurity/permissions.cpp

@@ -1230,7 +1230,7 @@ bool PermissionProcessor::getPermissionsArray(CSecurityDescriptor *sd, IArrayOf<
         if(account_name.length() > 0)
         {
             bool found = false;
-            for(int i = 0; i < permissions.length(); i++)
+            for(unsigned i = 0; i < permissions.length(); i++)
             {
                 CPermission& curperm = permissions.item(i);
                 const char* curname = curperm.getAccount_name();