瀏覽代碼

HPCC-8386 Fix extraneous or missing parenthesis

Signed-off-by: Renato Golin <rengolin@hpccsystems.com>
Renato Golin 12 年之前
父節點
當前提交
83c08ea19e

+ 2 - 2
common/deftype/deftype.cpp

@@ -2623,8 +2623,8 @@ static ITypeInfo * getPromotedType(ITypeInfo * lType, ITypeInfo * rType, bool is
 
     type_t lcode = l->getTypeCode();
     type_t rcode = r->getTypeCode();
-    if ((lcode == type_any)) return LINK(r);
-    if ((rcode == type_any)) return LINK(l);
+    if (lcode == type_any) return LINK(r);
+    if (rcode == type_any) return LINK(l);
     if ((lcode == type_set) || (rcode == type_set))
         return getPromotedSet(l, r, isCompare);
     if ((lcode == type_unicode) || (rcode == type_unicode))

+ 1 - 1
common/thorhelper/thorcommon.cpp

@@ -1632,7 +1632,7 @@ public:
     {
         Owned<IRowWriter> out = createWriteBlock();
         void * row;
-        while(row = rows->getNextSorted())
+        while((row = rows->getNextSorted()) != NULL)
             out->putRow(row);
     }
     IRowStream *merge(ICompare *icompare, bool partdedup)

+ 6 - 6
common/thorhelper/thorsoapcall.cpp

@@ -150,7 +150,7 @@ public:
     {
         char *p;
 
-        if (p = strstr(urltext, "://"))
+        if ((p = strstr(urltext, "://")) != NULL)
         {
             *p = 0;
             p += 3; // skip past the colon-slash-slash
@@ -160,7 +160,7 @@ public:
         else
             throw MakeStringException(-1, "Malformed URL");
 
-        if (p = strchr(urltext, '@'))
+        if ((p = strchr(urltext, '@')) != NULL)
         {
             // extract username & password
             *p = 0;
@@ -170,7 +170,7 @@ public:
             urltext = p;
         }
 
-        if (p = strchr(urltext, ':'))
+        if ((p = strchr(urltext, ':')) != NULL)
         {
             // extract the port
             *p = 0;
@@ -180,7 +180,7 @@ public:
 
             host.append(urltext);
 
-            if (p = strchr(p, '/'))
+            if ((p = strchr(p, '/')) != NULL)
                 path.append(p);
             else
                 path.append("/");
@@ -195,7 +195,7 @@ public:
             else
                 throw MakeStringException(-1, "Unsupported access method");
 
-            if (p = strchr(urltext, '/'))
+            if ((p = strchr(urltext, '/')) != NULL)
             {
                 *p = 0;
                 p++;
@@ -940,7 +940,7 @@ public:
                 {
                     return outputQ.dequeue();
                 }
-                else if ((done == numRowThreads))
+                else if (done == numRowThreads)
                 {
                     complete = true;
                     if (error.get())

+ 3 - 3
deployment/deployutils/configenvhelper.cpp

@@ -721,10 +721,10 @@ bool CConfigEnvHelper::deleteRoxieServers(const char* xmlArg)
     {
         IPropertyTree* pChild;
         //if atleast one slave, delete all slaves
-        while (pChild = pRoxieCluster->queryPropTree( "RoxieSlave[1]" ))
+        while ((pChild = pRoxieCluster->queryPropTree( "RoxieSlave[1]" )) != NULL)
             pRoxieCluster->removeTree( pChild );
 
-        while (pChild = pRoxieCluster->queryPropTree( XML_TAG_ROXIE_SLAVE "[1]" ))
+        while ((pChild = pRoxieCluster->queryPropTree( XML_TAG_ROXIE_SLAVE "[1]" )) != NULL)
             pRoxieCluster->removeTree( pChild );
 
         break;
@@ -1144,7 +1144,7 @@ bool CConfigEnvHelper::GenerateFullRedConfig(IPropertyTree* pRoxie, int copies,
 void CConfigEnvHelper::RemoveSlaves(IPropertyTree* pRoxie, bool bLegacySlaves/*=false*/)
 {
     IPropertyTree* pChild;
-    while (pChild = pRoxie->queryPropTree( bLegacySlaves ? XML_TAG_ROXIE_SLAVE "[1]" : "RoxieSlave[1]"))
+    while ((pChild = pRoxie->queryPropTree( bLegacySlaves ? XML_TAG_ROXIE_SLAVE "[1]" : "RoxieSlave[1]")) != NULL)
         pRoxie->removeTree( pChild );
 }
 

+ 1 - 1
esp/services/ws_machine/ws_machineService.cpp

@@ -1787,7 +1787,7 @@ bool Cws_machineEx::excludePartition(const char* partition) const
         for (it=itBegin; it != itEnd; it++)
         {
             const string& pattern = *it;
-            if (found = ::WildMatch(partition, partitionLen, pattern.c_str(), pattern.length(), false))
+            if ((found = ::WildMatch(partition, partitionLen, pattern.c_str(), pattern.length(), false)))
                 break;
         }
     }

+ 1 - 1
system/hrpc/hrpcmp.cpp

@@ -551,7 +551,7 @@ HRPCmptransport* MakeHRPCmptransport(MpTransportStateCommon* s)
 // Intra Communication
 IHRPCtransport *MakeClientMpTransport( ICommunicator *comm, rank_t rank, mptag_t tag)
 {
-    if ((comm==NULL))
+    if (comm==NULL)
         THROWHRPCEXCEPTION(HRPCERR_bad_address);
     // line below: check valid rank value is between 0 and ordinatlity-1
     unsigned count  = comm->queryGroup().ordinality();

+ 1 - 1
system/jhtree/keydiff.cpp

@@ -173,7 +173,7 @@ public:
 
     size32_t buffSize() { return buffsize; }
     size32_t rowSize() { return thisrowsize; }
-    size32_t serializeRowSize() { return thisrowsize+sizeof(offset_t)+isVar?sizeof(size32_t):0; }
+    size32_t serializeRowSize() { return thisrowsize+sizeof(offset_t)+(isVar?sizeof(size32_t):0); }
 
     size32_t serialize(void *dst)
     {

+ 1 - 1
system/jlib/jcomp.cpp

@@ -186,7 +186,7 @@ static void doSetCompilerPath(const char * path, const char * includes, const ch
     int r = stat(fname.str(), &filestatus);
     if (    (r != 0)
         ||  (!S_ISREG(filestatus.st_mode))
-        ||  (filestatus.st_mode&(S_IXOTH|S_IXGRP|S_IXUSR)==0))
+        ||  ((filestatus.st_mode&(S_IXOTH|S_IXGRP|S_IXUSR))==0))
     {
         if (r == -1) errno = ENOENT;
 #endif

+ 2 - 2
system/jlib/jptree.cpp

@@ -4443,7 +4443,7 @@ restart:
         if (ignoreNameSpaces)
         {
             const char *colon;
-            if (colon = strchr(tagName.str(), ':'))
+            if ((colon = strchr(tagName.str(), ':')) != NULL)
                 tagName.remove(0, (size32_t)(colon - tagName.str() + 1));
         }
         iEvent->beginNode(tagName.toCharArray(), startOffset);
@@ -4748,7 +4748,7 @@ public:
                 if (ignoreNameSpaces)
                 {
                     const char *colon;
-                    if (colon = strchr(stateInfo->wnsTag, ':'))
+                    if ((colon = strchr(stateInfo->wnsTag, ':')) != NULL)
                         stateInfo->wnsTag = colon+1;
                 }
                 endOfRoot = false;