From 038aa531bcf1a76764d3cef46fd9b8e08b166dae Mon Sep 17 00:00:00 2001 From: weili Date: Fri, 20 May 2016 15:38:29 -0700 Subject: Clean up XFA code which causes warnings This is part of efforts to bring XFA to chromium_code standard. The warnings are from unreachable code, or using potentially uninitialized variables, or using assignment within a condition. This change list only contains easy to fix cases. More cleanups will follow. BUG=pdfium:29 Review-Url: https://codereview.chromium.org/1998873002 --- xfa/fxfa/parser/xfa_utils.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xfa/fxfa/parser/xfa_utils.h') diff --git a/xfa/fxfa/parser/xfa_utils.h b/xfa/fxfa/parser/xfa_utils.h index 821e485e25..d6633a4c7f 100644 --- a/xfa/fxfa/parser/xfa_utils.h +++ b/xfa/fxfa/parser/xfa_utils.h @@ -120,7 +120,7 @@ class CXFA_NodeIteratorTemplate { NodeType** ppNode = NULL; NodeType* pCurrent = GetCurrent(); while (m_NodeStack.GetSize() > 0) { - while ((ppNode = m_NodeStack.GetTopElement())) { + while ((ppNode = m_NodeStack.GetTopElement()) != nullptr) { if (pCurrent != *ppNode) { return *ppNode; } @@ -130,7 +130,7 @@ class CXFA_NodeIteratorTemplate { } m_NodeStack.Push(pChild); } - while ((ppNode = m_NodeStack.GetTopElement())) { + while ((ppNode = m_NodeStack.GetTopElement()) != nullptr) { NodeType* pNext = TraverseStrategy::GetNextSibling(*ppNode); m_NodeStack.Pop(); if (m_NodeStack.GetSize() == 0) { @@ -145,8 +145,8 @@ class CXFA_NodeIteratorTemplate { return NULL; } NodeType* SkipChildrenAndMoveToNext() { - NodeType** ppNode = NULL; - while ((ppNode = m_NodeStack.GetTopElement())) { + NodeType** ppNode = nullptr; + while ((ppNode = m_NodeStack.GetTopElement()) != nullptr) { NodeType* pNext = TraverseStrategy::GetNextSibling(*ppNode); m_NodeStack.Pop(); if (m_NodeStack.GetSize() == 0) { -- cgit v1.2.3