summaryrefslogtreecommitdiff
path: root/core/include
diff options
context:
space:
mode:
authorBruce Dawson <brucedawson@google.com>2015-04-10 14:49:35 -0700
committerBruce Dawson <brucedawson@google.com>2015-04-10 14:49:35 -0700
commit9c7b0940569ee5eb1794e8db4e47ecaf3a64315d (patch)
tree4c3921213150eeb0db0f1dcc5bd03785b1a1fae2 /core/include
parentd794018606dfdb62f87adf065c5ba48a4607d92b (diff)
downloadpdfium-9c7b0940569ee5eb1794e8db4e47ecaf3a64315d.tar.xz
Fix the noisiest variable shadowing warnings in pdfium.
Three functions in fx_coordinates.h account for 60% of the warnings when building with VS 2015, due to variable shadowing. Renaming the function parameters is safe, resolves the warnings, and reduces confusion. R=tsepez@chromium.org BUG=440500 Review URL: https://codereview.chromium.org/1077083003
Diffstat (limited to 'core/include')
-rw-r--r--core/include/fxcrt/fx_coordinates.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/core/include/fxcrt/fx_coordinates.h b/core/include/fxcrt/fx_coordinates.h
index a9afc5712e..0b4b920195 100644
--- a/core/include/fxcrt/fx_coordinates.h
+++ b/core/include/fxcrt/fx_coordinates.h
@@ -132,9 +132,10 @@ public:
typedef CFX_PSVTemplate<baseType> FXT_POINT;
typedef CFX_PSVTemplate<baseType> FXT_SIZE;
typedef CFX_VTemplate<baseType> FXT_VECTOR;
- void Set(baseType x, baseType y)
+ void Set(baseType newx, baseType newy)
{
- FXT_PSV::x = x, FXT_PSV::y = y;
+ FXT_PSV::x = newx;
+ FXT_PSV::y = newy;
}
void Set(const FXT_PSV &psv)
{
@@ -165,26 +166,26 @@ public:
FXT_PSV::x = ((baseType)FXT_PSV::x) / fLen;
FXT_PSV::y = ((baseType)FXT_PSV::y) / fLen;
}
- baseType DotProduct(baseType x, baseType y) const
+ baseType DotProduct(baseType otherx, baseType othery) const
{
- return FXT_PSV::x * x + FXT_PSV::y * y;
+ return FXT_PSV::x * otherx + FXT_PSV::y * othery;
}
baseType DotProduct(const FXT_VECTOR &v) const
{
return FXT_PSV::x * v.x + FXT_PSV::y * v.y;
}
- FX_BOOL IsParallel(baseType x, baseType y) const
+ FX_BOOL IsParallel(baseType otherx, baseType othery) const
{
- baseType t = FXT_PSV::x * y - FXT_PSV::y * x;
+ baseType t = FXT_PSV::x * othery - FXT_PSV::y * otherx;
return FXSYS_fabs(t) < 0x0001f;
}
FX_BOOL IsParallel(const FXT_VECTOR &v) const
{
return IsParallel(v.x, v.y);
}
- FX_BOOL IsPerpendicular(baseType x, baseType y) const
+ FX_BOOL IsPerpendicular(baseType otherx, baseType othery) const
{
- baseType t = DotProduct(x, y);
+ baseType t = DotProduct(otherx, othery);
return FXSYS_fabs(t) < 0x0001f;
}
FX_BOOL IsPerpendicular(const FXT_VECTOR &v) const