summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfeditpath.cpp
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-05-17 17:23:22 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-05-17 21:40:41 +0000
commit46abb66cb57d4bc6b9326efd7a0c0e776e594db2 (patch)
treed0e3b8bada3ff24ac3cff44f4ae0ed990232448d /fpdfsdk/fpdfeditpath.cpp
parent26853181af1b28ba8070b955d90fb7a17fec2713 (diff)
downloadpdfium-46abb66cb57d4bc6b9326efd7a0c0e776e594db2.tar.xz
Use more static_cast in fpdfsdk
This CL replaces some reinterpret_cast with static_cast in fpdfsdk. It also removes an obsolete comment in fpdfedit.h Change-Id: I36c29bfcd6382490a8c955b50ccfa4c93ab351c7 Reviewed-on: https://pdfium-review.googlesource.com/5632 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfeditpath.cpp')
-rw-r--r--fpdfsdk/fpdfeditpath.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/fpdfsdk/fpdfeditpath.cpp b/fpdfsdk/fpdfeditpath.cpp
index a26ca5186e..60117cad32 100644
--- a/fpdfsdk/fpdfeditpath.cpp
+++ b/fpdfsdk/fpdfeditpath.cpp
@@ -35,7 +35,7 @@ DLLEXPORT FPDF_BOOL FPDFPath_SetStrokeColor(FPDF_PAGEOBJECT path,
return false;
float rgb[3] = {R / 255.f, G / 255.f, B / 255.f};
- auto* pPathObj = reinterpret_cast<CPDF_PathObject*>(path);
+ auto* pPathObj = static_cast<CPDF_PathObject*>(path);
pPathObj->m_GeneralState.SetStrokeAlpha(A / 255.f);
pPathObj->m_ColorState.SetStrokeColor(
CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3);
@@ -46,7 +46,7 @@ DLLEXPORT FPDF_BOOL FPDFPath_SetStrokeWidth(FPDF_PAGEOBJECT path, float width) {
if (!path || width < 0.0f)
return false;
- auto* pPathObj = reinterpret_cast<CPDF_PathObject*>(path);
+ auto* pPathObj = static_cast<CPDF_PathObject*>(path);
pPathObj->m_GraphState.SetLineWidth(width);
return true;
}
@@ -60,7 +60,7 @@ DLLEXPORT FPDF_BOOL FPDFPath_SetFillColor(FPDF_PAGEOBJECT path,
return false;
float rgb[3] = {R / 255.f, G / 255.f, B / 255.f};
- auto* pPathObj = reinterpret_cast<CPDF_PathObject*>(path);
+ auto* pPathObj = static_cast<CPDF_PathObject*>(path);
pPathObj->m_GeneralState.SetFillAlpha(A / 255.f);
pPathObj->m_ColorState.SetFillColor(
CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3);
@@ -75,7 +75,7 @@ DLLEXPORT FPDF_BOOL FPDFPath_GetFillColor(FPDF_PAGEOBJECT path,
if (!path || !R || !G || !B || !A)
return false;
- auto* pPathObj = reinterpret_cast<CPDF_PathObject*>(path);
+ auto* pPathObj = static_cast<CPDF_PathObject*>(path);
uint32_t fillRGB = pPathObj->m_ColorState.GetFillRGB();
*R = FXSYS_GetRValue(fillRGB);
*G = FXSYS_GetGValue(fillRGB);
@@ -89,7 +89,7 @@ DLLEXPORT FPDF_BOOL FPDFPath_MoveTo(FPDF_PAGEOBJECT path, float x, float y) {
if (!path)
return false;
- auto* pPathObj = reinterpret_cast<CPDF_PathObject*>(path);
+ auto* pPathObj = static_cast<CPDF_PathObject*>(path);
pPathObj->m_Path.AppendPoint(CFX_PointF(x, y), FXPT_TYPE::MoveTo, false);
return true;
}
@@ -98,7 +98,7 @@ DLLEXPORT FPDF_BOOL FPDFPath_LineTo(FPDF_PAGEOBJECT path, float x, float y) {
if (!path)
return false;
- auto* pPathObj = reinterpret_cast<CPDF_PathObject*>(path);
+ auto* pPathObj = static_cast<CPDF_PathObject*>(path);
pPathObj->m_Path.AppendPoint(CFX_PointF(x, y), FXPT_TYPE::LineTo, false);
return true;
}
@@ -113,7 +113,7 @@ DLLEXPORT FPDF_BOOL FPDFPath_BezierTo(FPDF_PAGEOBJECT path,
if (!path)
return false;
- auto* pPathObj = reinterpret_cast<CPDF_PathObject*>(path);
+ auto* pPathObj = static_cast<CPDF_PathObject*>(path);
pPathObj->m_Path.AppendPoint(CFX_PointF(x1, y1), FXPT_TYPE::BezierTo, false);
pPathObj->m_Path.AppendPoint(CFX_PointF(x2, y2), FXPT_TYPE::BezierTo, false);
pPathObj->m_Path.AppendPoint(CFX_PointF(x3, y3), FXPT_TYPE::BezierTo, false);
@@ -124,7 +124,7 @@ DLLEXPORT FPDF_BOOL FPDFPath_Close(FPDF_PAGEOBJECT path) {
if (!path)
return false;
- auto* pPathObj = reinterpret_cast<CPDF_PathObject*>(path);
+ auto* pPathObj = static_cast<CPDF_PathObject*>(path);
if (pPathObj->m_Path.GetPoints().empty())
return false;
@@ -138,7 +138,7 @@ DLLEXPORT FPDF_BOOL FPDFPath_SetDrawMode(FPDF_PAGEOBJECT path,
if (!path)
return false;
- auto* pPathObj = reinterpret_cast<CPDF_PathObject*>(path);
+ auto* pPathObj = static_cast<CPDF_PathObject*>(path);
if (fillmode == FPDF_FILLMODE_ALTERNATE)
pPathObj->m_FillType = FXFILL_ALTERNATE;