summaryrefslogtreecommitdiff
path: root/idlc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-15 09:04:38 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-15 19:25:23 +0200
commit4cc702a7055c0e12c7cbf5e5e359e7cbc8b88020 (patch)
treef09f7167cdca22f16edb5a998c2f9714e4bdc698 /idlc
parent393aa2b3dee9cca84a215635060b369a962ab179 (diff)
loplugin:buriedassign in f,h,i*
Change-Id: Iac753e528e13cb2565832a484e87f88061bbc91e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92239 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'idlc')
-rw-r--r--idlc/source/idlccompile.cxx4
-rw-r--r--idlc/source/parser.y34
2 files changed, 21 insertions, 17 deletions
diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx
index c2fc601142e2..8db6d82a026f 100644
--- a/idlc/source/idlccompile.cxx
+++ b/idlc/source/idlccompile.cxx
@@ -185,8 +185,8 @@ bool copyFile(const OString* source, const OString& target)
while ( !feof(pSource) )
{
- size_t readSize;
- if ( (readSize = fread(pBuffer, 1, totalSize, pSource)) > 0 && !ferror(pSource) )
+ size_t readSize = fread(pBuffer, 1, totalSize, pSource);
+ if ( readSize > 0 && !ferror(pSource) )
{
if ( (fwrite(pBuffer, 1, readSize, pTarget)) != readSize || ferror(pTarget) )
{
diff --git a/idlc/source/parser.y b/idlc/source/parser.y
index 40e82ef85216..1d81492562d5 100644
--- a/idlc/source/parser.y
+++ b/idlc/source/parser.y
@@ -1430,22 +1430,26 @@ const_type :
* If the constant's type is a scoped name, it must resolve
* to a scalar constant type
*/
- if ( pScope && (type = pScope->lookupByName(*$1)) ) {
- if (!ErrorHandler::checkPublished(type))
- {
- type = nullptr;
- $$ = ET_none;
- }
- else
- {
- type = resolveTypedefs(type);
- if (type->getNodeType() == NT_predefined)
+ if ( pScope ) {
+ type = pScope->lookupByName(*$1);
+ if (type) {
+ if (!ErrorHandler::checkPublished(type))
{
- $$ = static_cast< AstBaseType const * >(type)->
- getExprType();
- } else
- $$ = ET_any;
- }
+ type = nullptr;
+ $$ = ET_none;
+ }
+ else
+ {
+ type = resolveTypedefs(type);
+ if (type->getNodeType() == NT_predefined)
+ {
+ $$ = static_cast< AstBaseType const * >(type)->
+ getExprType();
+ } else
+ $$ = ET_any;
+ }
+ } else
+ $$ = ET_any;
} else
$$ = ET_any;
}