[code health] Declare one variable per line, part 3.
Change-Id: I82eb0c4de77a4883e4923a35d196a90fb2bdad26
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/80472
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfapi/render/cpdf_rendershading.cpp b/core/fpdfapi/render/cpdf_rendershading.cpp
index 4084b30..ac0bca2 100644
--- a/core/fpdfapi/render/cpdf_rendershading.cpp
+++ b/core/fpdfapi/render/cpdf_rendershading.cpp
@@ -496,7 +496,6 @@
}
struct Coon_BezierCoeff {
- float a, b, c, d;
void FromPoints(float p0, float p1, float p2, float p3) {
a = -p0 + 3 * p1 - 3 * p2 + p3;
b = 3 * p0 - 6 * p1 + 3 * p2;
@@ -539,6 +538,11 @@
float dis = a + b + c;
return dis < 0 ? -dis : dis;
}
+
+ float a;
+ float b;
+ float c;
+ float d;
};
struct Coon_Bezier {
diff --git a/core/fxge/win32/cgdi_device_driver.cpp b/core/fxge/win32/cgdi_device_driver.cpp
index 72b0a1d..1cdfea9 100644
--- a/core/fxge/win32/cgdi_device_driver.cpp
+++ b/core/fxge/win32/cgdi_device_driver.cpp
@@ -221,7 +221,8 @@
unsigned np = 0;
if (deltax == 0)
deltax = (x1 > clip_box.x1) ? -nearzero : nearzero;
- float xin, xout;
+ float xin;
+ float xout;
if (deltax > 0) {
xin = clip_box.x1;
xout = clip_box.x2;
@@ -232,7 +233,8 @@
float tinx = (xin - x1) / deltax;
if (deltay == 0)
deltay = (y1 > clip_box.y1) ? -nearzero : nearzero;
- float yin, yout;
+ float yin;
+ float yout;
if (deltay > 0) {
yin = clip_box.y1;
yout = clip_box.y2;
@@ -241,7 +243,8 @@
yout = clip_box.y1;
}
float tiny = (yin - y1) / deltay;
- float tin1, tin2;
+ float tin1;
+ float tin2;
if (tinx < tiny) {
tin1 = tinx;
tin2 = tiny;
diff --git a/core/fxge/win32/cgdi_plus_ext.cpp b/core/fxge/win32/cgdi_plus_ext.cpp
index 1b508c2..628d024 100644
--- a/core/fxge/win32/cgdi_plus_ext.cpp
+++ b/core/fxge/win32/cgdi_plus_ext.cpp
@@ -391,7 +391,8 @@
float* pDashArray =
FX_Alloc(float, FxAlignToBoundary<2>(pGraphState->m_DashArray.size()));
int nCount = 0;
- float on_leftover = 0, off_leftover = 0;
+ float on_leftover = 0;
+ float off_leftover = 0;
for (size_t i = 0; i < pGraphState->m_DashArray.size(); i += 2) {
float on_phase = pGraphState->m_DashArray[i];
float off_phase;
diff --git a/xfa/fgas/graphics/cfgas_gegraphics.cpp b/xfa/fgas/graphics/cfgas_gegraphics.cpp
index c06262c..7d5d873 100644
--- a/xfa/fgas/graphics/cfgas_gegraphics.cpp
+++ b/xfa/fgas/graphics/cfgas_gegraphics.cpp
@@ -343,7 +343,8 @@
continue;
}
float root = (sqrt(b2_4ac));
- float s1, s2;
+ float s1;
+ float s2;
if (a > 0) {
s1 = (-b - root) / (2 * a);
s2 = (-b + root) / (2 * a);
diff --git a/xfa/fxfa/cxfa_textlayout.cpp b/xfa/fxfa/cxfa_textlayout.cpp
index 02af8bb..787711b 100644
--- a/xfa/fxfa/cxfa_textlayout.cpp
+++ b/xfa/fxfa/cxfa_textlayout.cpp
@@ -1024,7 +1024,8 @@
if (m_pTabstopContext)
m_pTabstopContext->Reset();
- float fLineStep = 0, fBaseLine = 0;
+ float fLineStep = 0;
+ float fBaseLine = 0;
int32_t i = 0;
for (i = 0; i < iPieces; i++) {
const CFGAS_BreakPiece* pPiece = m_pBreak->GetBreakPieceUnstable(i);
diff --git a/xfa/fxfa/layout/cxfa_contentlayoutprocessor.cpp b/xfa/fxfa/layout/cxfa_contentlayoutprocessor.cpp
index 1143c76..e3726aa 100644
--- a/xfa/fxfa/layout/cxfa_contentlayoutprocessor.cpp
+++ b/xfa/fxfa/layout/cxfa_contentlayoutprocessor.cpp
@@ -483,7 +483,8 @@
bool bAnyChanged = false;
CXFA_Document* pDocument = pFormNode->GetDocument();
CXFA_FFNotify* pNotify = pDocument->GetNotify();
- float fCurTopMargin = 0, fCurBottomMargin = 0;
+ float fCurTopMargin = 0;
+ float fCurBottomMargin = 0;
CXFA_Margin* pMarginNode =
pFormNode->GetFirstChildByClass<CXFA_Margin>(XFA_Element::Margin);
if (pMarginNode && bCalculateMargin) {
diff --git a/xfa/fxfa/parser/cxfa_box.cpp b/xfa/fxfa/parser/cxfa_box.cpp
index 6f596b2..772db0f 100644
--- a/xfa/fxfa/parser/cxfa_box.cpp
+++ b/xfa/fxfa/parser/cxfa_box.cpp
@@ -245,9 +245,8 @@
void CXFA_Box::GetPathArcOrRounded(CFX_RectF rtDraw,
bool forceRound,
CFGAS_GEPath* fillPath) {
- float a, b;
- a = rtDraw.width / 2.0f;
- b = rtDraw.height / 2.0f;
+ float a = rtDraw.width / 2.0f;
+ float b = rtDraw.height / 2.0f;
if (IsCircular() || forceRound)
a = b = std::min(a, b);
@@ -310,9 +309,8 @@
pGS->SaveGraphState();
pGS->SetLineWidth(fHalf);
- float a, b;
- a = rtWidget.width / 2.0f;
- b = rtWidget.height / 2.0f;
+ float a = rtWidget.width / 2.0f;
+ float b = rtWidget.height / 2.0f;
if (forceRound) {
a = std::min(a, b);
b = a;