Kaydet (Commit) d4864a94 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Rewrite some (trivial) assignments inside if/while conditions: idlc

Change-Id: I6be338f54dd8e6912e48258c0a2e075dc69b2893
üst 2a2ed587
......@@ -69,14 +69,16 @@ bool Options::checkArgument (std::vector< std::string > & rArgs, char const * ar
switch(arg[0])
{
case '@':
if ((result = (len > 1)))
result = len > 1;
if (result)
{
// "@<cmdfile>"
result = Options::checkCommandFile (rArgs, &(arg[1]));
}
break;
case '-':
if ((result = (len > 1)))
result = len > 1;
if (result)
{
// "-<option>"
switch (arg[1])
......
......@@ -445,12 +445,11 @@ module_dcl :
AstScope* pScope = idlc()->scopes()->topNonNull();
AstModule* pModule = nullptr;
AstDeclaration* pExists = nullptr;
if ( pScope )
{
pModule = new AstModule(*$3, pScope);
if( (pExists = pScope->lookupForAdd(pModule)) )
if( AstDeclaration* pExists = pScope->lookupForAdd(pModule) )
{
pExists->setInMainfile(idlc()->isInMainFile());
pExists->setFileName(pModule->getFileName());
......@@ -556,7 +555,6 @@ interface_dcl :
AstScope* pScope = idlc()->scopes()->topNonNull();
AstInterface* pInterface = nullptr;
AstInterface* pForward = nullptr;
AstDeclaration* pDecl = nullptr;
/*
* Make a new interface node and add it to its enclosing scope
......@@ -566,7 +564,7 @@ interface_dcl :
pInterface = new AstInterface(
*$1->getName(),
static_cast< AstInterface const * >(resolveTypedefs($1->getInherits())), pScope);
if ( (pDecl = pScope->lookupByName(pInterface->getScopedName())) )
if ( AstDeclaration* pDecl = pScope->lookupByName(pInterface->getScopedName()) )
{
/*
* See if we're defining a forward declared interface.
......@@ -1279,12 +1277,11 @@ constants_dcl :
AstScope* pScope = idlc()->scopes()->topNonNull();
AstConstants* pConstants = nullptr;
AstDeclaration* pExists = nullptr;
if ( pScope )
{
pConstants = new AstConstants(*$3, pScope);
if( (pExists = pScope->lookupForAdd(pConstants)) )
if( AstDeclaration* pExists = pScope->lookupForAdd(pConstants) )
{
pExists->setInMainfile(idlc()->isInMainFile());
delete(pConstants);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment