summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2011-06-24 00:11:39 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2011-06-24 14:44:08 +0200
commit71cc795c2cc48cad36137881a8c06a6ebce084df (patch)
treef7d07165b53cc3a114bf16ce527b634afadee579
parente7140f8aad0f2190348beba673928fed1f62aea0 (diff)
downloadmxs-utils-71cc795c2cc48cad36137881a8c06a6ebce084df.tar.gz
mxs-utils-71cc795c2cc48cad36137881a8c06a6ebce084df.tar.xz
add parentheses around assignment used as truth value
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--elftosb2/ConversionController.cpp28
-rw-r--r--elftosb2/elftosb.cpp2
-rw-r--r--encryptgpk/encryptgpk.cpp2
-rw-r--r--keygen/keygen.cpp2
-rw-r--r--sbtool/sbtool.cpp2
5 files changed, 18 insertions, 18 deletions
diff --git a/elftosb2/ConversionController.cpp b/elftosb2/ConversionController.cpp
index 571c390..1c69117 100644
--- a/elftosb2/ConversionController.cpp
+++ b/elftosb2/ConversionController.cpp
@@ -444,7 +444,7 @@ void ConversionController::processSections(ListASTNode * sections)
OutputSection * outputSection = NULL;
BootableSectionContentsASTNode * bootableSection;
DataSectionContentsASTNode * dataSection;
- if (bootableSection = dynamic_cast<BootableSectionContentsASTNode*>(node))
+ if ((bootableSection = dynamic_cast<BootableSectionContentsASTNode*>(node)))
{
// process statements into a sequence of operations
ListASTNode * statements = bootableSection->getStatements();
@@ -469,7 +469,7 @@ void ConversionController::processSections(ListASTNode * sections)
opSection->getSequence() += sequence;
outputSection = opSection;
}
- else if (dataSection = dynamic_cast<DataSectionContentsASTNode*>(node))
+ else if ((dataSection = dynamic_cast<DataSectionContentsASTNode*>(node)))
{
outputSection = convertDataSection(dataSection, sectionID, optionsDict);
}
@@ -555,7 +555,7 @@ Value * ConversionController::convertAssignmentNodeToValue(ASTNode * node, std::
ASTNode * valueNode = assignmentNode->getValue();
StringConstASTNode * str;
ExprASTNode * expr;
- if (str = dynamic_cast<StringConstASTNode*>(valueNode))
+ if ((str = dynamic_cast<StringConstASTNode*>(valueNode)))
{
// the option value is a string constant
resultValue = new StringValue(str->getString());
@@ -564,7 +564,7 @@ Value * ConversionController::convertAssignmentNodeToValue(ASTNode * node, std::
// Log::log("option %s => \'%s\'\n", ident->c_str(), str->getString()->c_str());
//#endif
}
- else if (expr = dynamic_cast<ExprASTNode*>(valueNode))
+ else if ((expr = dynamic_cast<ExprASTNode*>(valueNode)))
{
ExprASTNode * reducedExpr = expr->reduce(m_context);
IntConstExprASTNode * intConst = dynamic_cast<IntConstExprASTNode*>(reducedExpr);
@@ -1082,20 +1082,20 @@ DataSource * ConversionController::createSourceFromNode(ASTNode * dataNode)
SectionMatchListASTNode * matchListNode;
IVTConstASTNode * ivtNode;
- if (stringNode = dynamic_cast<StringConstASTNode*>(dataNode))
+ if ((stringNode = dynamic_cast<StringConstASTNode*>(dataNode)))
{
// create a data source with the string contents
std::string * stringData = stringNode->getString();
const uint8_t * stringContents = reinterpret_cast<const uint8_t *>(stringData->c_str());
source = new UnmappedDataSource(stringContents, static_cast<unsigned>(stringData->size()));
}
- else if (blobNode = dynamic_cast<BlobConstASTNode*>(dataNode))
+ else if ((blobNode = dynamic_cast<BlobConstASTNode*>(dataNode)))
{
// create a data source with the raw binary data
Blob * blob = blobNode->getBlob();
source = new UnmappedDataSource(blob->getData(), blob->getLength());
}
- else if (exprNode = dynamic_cast<ExprASTNode*>(dataNode))
+ else if ((exprNode = dynamic_cast<ExprASTNode*>(dataNode)))
{
// reduce the expression first
exprNode = exprNode->reduce(m_context);
@@ -1108,13 +1108,13 @@ DataSource * ConversionController::createSourceFromNode(ASTNode * dataNode)
SizedIntegerValue intValue(intNode->getValue(), intNode->getSize());
source = new PatternSource(intValue);
}
- else if (sourceNode = dynamic_cast<SourceASTNode*>(dataNode))
+ else if ((sourceNode = dynamic_cast<SourceASTNode*>(dataNode)))
{
// load the entire source contents
SourceFile * sourceFile = getSourceFromName(sourceNode->getSourceName(), sourceNode->getFirstLine());
source = sourceFile->createDataSource();
}
- else if (sectionNode = dynamic_cast<SectionASTNode*>(dataNode))
+ else if ((sectionNode = dynamic_cast<SectionASTNode*>(dataNode)))
{
// load some subset of the source
SourceFile * sourceFile = getSourceFromName(sectionNode->getSourceName(), sectionNode->getFirstLine());
@@ -1132,7 +1132,7 @@ DataSource * ConversionController::createSourceFromNode(ASTNode * dataNode)
throw semantic_error(format_string("line %d: no sections match the pattern", sectionNode->getFirstLine()));
}
}
- else if (matchListNode = dynamic_cast<SectionMatchListASTNode*>(dataNode))
+ else if ((matchListNode = dynamic_cast<SectionMatchListASTNode*>(dataNode)))
{
SourceFile * sourceFile = getSourceFromName(matchListNode->getSourceName(), matchListNode->getFirstLine());
if (!sourceFile->supportsNamedSections())
@@ -1165,7 +1165,7 @@ DataSource * ConversionController::createSourceFromNode(ASTNode * dataNode)
throw semantic_error(format_string("line %d: no sections match the section pattern list", matchListNode->getFirstLine()));
}
}
- else if (ivtNode = dynamic_cast<IVTConstASTNode*>(dataNode))
+ else if ((ivtNode = dynamic_cast<IVTConstASTNode*>(dataNode)))
{
source = createIVTDataSource(ivtNode);
}
@@ -1240,7 +1240,7 @@ DataTarget * ConversionController::createTargetFromNode(ASTNode * targetNode)
NaturalLocationASTNode * naturalNode;
AddressRangeASTNode * addressNode;
- if (symbolNode = dynamic_cast<SymbolASTNode*>(targetNode))
+ if ((symbolNode = dynamic_cast<SymbolASTNode*>(targetNode)))
{
SourceFile * sourceFile = getSourceFromName(symbolNode->getSource(), symbolNode->getFirstLine());
std::string * symbolName = symbolNode->getSymbolName();
@@ -1269,12 +1269,12 @@ DataTarget * ConversionController::createTargetFromNode(ASTNode * targetNode)
}
}
}
- else if (naturalNode = dynamic_cast<NaturalLocationASTNode*>(targetNode))
+ else if ((naturalNode = dynamic_cast<NaturalLocationASTNode*>(targetNode)))
{
// the target is the source's natural location
target = new NaturalDataTarget();
}
- else if (addressNode = dynamic_cast<AddressRangeASTNode*>(targetNode))
+ else if ((addressNode = dynamic_cast<AddressRangeASTNode*>(targetNode)))
{
// evaluate begin address
ExprASTNode * beginExpr = dynamic_cast<ExprASTNode*>(addressNode->getBegin());
diff --git a/elftosb2/elftosb.cpp b/elftosb2/elftosb.cpp
index 06717b1..7f3b764 100644
--- a/elftosb2/elftosb.cpp
+++ b/elftosb2/elftosb.cpp
@@ -213,7 +213,7 @@ public:
// process command line options
int optchar;
const char * optarg;
- while (optchar = options(iter, optarg))
+ while ((optchar = options(iter, optarg)))
{
switch (optchar)
{
diff --git a/encryptgpk/encryptgpk.cpp b/encryptgpk/encryptgpk.cpp
index e389fef..c86fb27 100644
--- a/encryptgpk/encryptgpk.cpp
+++ b/encryptgpk/encryptgpk.cpp
@@ -160,7 +160,7 @@ public:
// process command line options
int optchar;
const char * optarg;
- while (optchar = options(iter, optarg))
+ while ((optchar = options(iter, optarg)))
{
switch (optchar)
{
diff --git a/keygen/keygen.cpp b/keygen/keygen.cpp
index b1b8362..7d32174 100644
--- a/keygen/keygen.cpp
+++ b/keygen/keygen.cpp
@@ -119,7 +119,7 @@ public:
// process command line options
int optchar;
const char * optarg;
- while (optchar = options(iter, optarg))
+ while ((optchar = options(iter, optarg)))
{
switch (optchar)
{
diff --git a/sbtool/sbtool.cpp b/sbtool/sbtool.cpp
index c83cee2..1cf57a1 100644
--- a/sbtool/sbtool.cpp
+++ b/sbtool/sbtool.cpp
@@ -140,7 +140,7 @@ public:
// process command line options
int optchar;
const char * optarg;
- while (optchar = options(iter, optarg))
+ while ((optchar = options(iter, optarg)))
{
switch (optchar)
{