From 8a5983391252d282e27cc2478798fb056c7df68a Mon Sep 17 00:00:00 2001 From: wileyrya Date: Thu, 1 Jun 2017 15:33:42 -0500 Subject: Add missing static asserts for line cap and line join values. Change-Id: Idd04530986a78370459c4361197a5500ae5347f3 Reviewed-on: https://pdfium-review.googlesource.com/6210 Reviewed-by: dsinclair Commit-Queue: dsinclair --- fpdfsdk/fpdfeditpath.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/fpdfsdk/fpdfeditpath.cpp b/fpdfsdk/fpdfeditpath.cpp index f58d1e18a9..3a0a296cdf 100644 --- a/fpdfsdk/fpdfeditpath.cpp +++ b/fpdfsdk/fpdfeditpath.cpp @@ -10,6 +10,22 @@ #include "fpdfsdk/fsdk_define.h" #include "third_party/base/ptr_util.h" +// These checks are here because core/ and public/ cannot depend on each other. +static_assert(CFX_GraphStateData::LineCapButt == FPDF_LINECAP_BUTT, + "CFX_GraphStateData::LineCapButt value mismatch"); +static_assert(CFX_GraphStateData::LineCapRound == FPDF_LINECAP_ROUND, + "CFX_GraphStateData::LineCapRound value mismatch"); +static_assert(CFX_GraphStateData::LineCapSquare == + FPDF_LINECAP_PROJECTING_SQUARE, + "CFX_GraphStateData::LineCapSquare value mismatch"); + +static_assert(CFX_GraphStateData::LineJoinMiter == FPDF_LINEJOIN_MITER, + "CFX_GraphStateData::LineJoinMiter value mismatch"); +static_assert(CFX_GraphStateData::LineJoinRound == FPDF_LINEJOIN_ROUND, + "CFX_GraphStateData::LineJoinRound value mismatch"); +static_assert(CFX_GraphStateData::LineJoinBevel == FPDF_LINEJOIN_BEVEL, + "CFX_GraphStateData::LineJoinBevel value mismatch"); + DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_CreateNewPath(float x, float y) { auto pPathObj = pdfium::MakeUnique(); pPathObj->m_Path.AppendPoint(CFX_PointF(x, y), FXPT_TYPE::MoveTo, false); -- cgit v1.2.3