Skip to content

Commit

Permalink
Merge pull request hpcc-systems#3745 from rengolin/warnings2
Browse files Browse the repository at this point in the history
HPCC-8386 Fix extraneous or missing parenthesis

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
  • Loading branch information
richardkchapman committed Nov 30, 2012
2 parents 1e6a29a + 83c08ea commit 96a147b
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions common/deftype/deftype.cpp
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion common/thorhelper/thorcommon.cpp
Expand Up @@ -1632,7 +1632,7 @@ class CDiskMerger : public CInterface, implements IDiskMerger
{
Owned<IRowWriter> out = createWriteBlock();
void * row;
while(row = rows->getNextSorted())
while((row = rows->getNextSorted()) != NULL)
out->putRow(row);
}
IRowStream *merge(ICompare *icompare, bool partdedup)
Expand Down
12 changes: 6 additions & 6 deletions common/thorhelper/thorsoapcall.cpp
Expand Up @@ -150,7 +150,7 @@ class Url : public CInterface, implements IInterface
{
char *p;

if (p = strstr(urltext, "://"))
if ((p = strstr(urltext, "://")) != NULL)
{
*p = 0;
p += 3; // skip past the colon-slash-slash
Expand All @@ -160,7 +160,7 @@ class Url : public CInterface, implements IInterface
else
throw MakeStringException(-1, "Malformed URL");

if (p = strchr(urltext, '@'))
if ((p = strchr(urltext, '@')) != NULL)
{
// extract username & password
*p = 0;
Expand All @@ -170,7 +170,7 @@ class Url : public CInterface, implements IInterface
urltext = p;
}

if (p = strchr(urltext, ':'))
if ((p = strchr(urltext, ':')) != NULL)
{
// extract the port
*p = 0;
Expand All @@ -180,7 +180,7 @@ class Url : public CInterface, implements IInterface

host.append(urltext);

if (p = strchr(p, '/'))
if ((p = strchr(p, '/')) != NULL)
path.append(p);
else
path.append("/");
Expand All @@ -195,7 +195,7 @@ class Url : public CInterface, implements IInterface
else
throw MakeStringException(-1, "Unsupported access method");

if (p = strchr(urltext, '/'))
if ((p = strchr(urltext, '/')) != NULL)
{
*p = 0;
p++;
Expand Down Expand Up @@ -940,7 +940,7 @@ class CWSCHelper : public CInterface, implements IWSCHelper
{
return outputQ.dequeue();
}
else if ((done == numRowThreads))
else if (done == numRowThreads)
{
complete = true;
if (error.get())
Expand Down
6 changes: 3 additions & 3 deletions deployment/deployutils/configenvhelper.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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 );
}

Expand Down
2 changes: 1 addition & 1 deletion esp/services/ws_machine/ws_machineService.cpp
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion system/hrpc/hrpcmp.cpp
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion system/jhtree/keydiff.cpp
Expand Up @@ -173,7 +173,7 @@ class RowBuffer

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)
{
Expand Down
2 changes: 1 addition & 1 deletion system/jlib/jcomp.cpp
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions system/jlib/jptree.cpp
Expand Up @@ -4443,7 +4443,7 @@ class CXMLReader : public CXMLReaderBase<X>, implements IXMLReader
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);
Expand Down Expand Up @@ -4748,7 +4748,7 @@ class CPullXMLReader : public CXMLReaderBase<X>, implements IPullXMLReader
if (ignoreNameSpaces)
{
const char *colon;
if (colon = strchr(stateInfo->wnsTag, ':'))
if ((colon = strchr(stateInfo->wnsTag, ':')) != NULL)
stateInfo->wnsTag = colon+1;
}
endOfRoot = false;
Expand Down

0 comments on commit 96a147b

Please sign in to comment.