summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_streamcontentparser.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-11-06 15:21:30 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-06 15:21:30 +0000
commit52008e9c520e8b1a7e2a9d76578ac2b27fe3e06a (patch)
treef42e80e0a7aca57dc75cd9e6c0edccb6b9c0ca5e /core/fpdfapi/page/cpdf_streamcontentparser.cpp
parentb1a3044cdcd99ab4c88927e8b840c0c712ae54e3 (diff)
downloadpdfium-52008e9c520e8b1a7e2a9d76578ac2b27fe3e06a.tar.xz
Mark some CPDF_StreamContentParser members as const.
Change-Id: I6c4ee5400307c8321f2558287f4d7571c373fcaa Reviewed-on: https://pdfium-review.googlesource.com/17795 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_streamcontentparser.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index 9e9c450c7d..3bd40d5b7c 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -256,14 +256,12 @@ CPDF_StreamContentParser::CPDF_StreamContentParser(
m_ParamStartPos(0),
m_ParamCount(0),
m_pCurStates(pdfium::MakeUnique<CPDF_AllStates>()),
- m_pLastTextObject(nullptr),
m_DefFontSize(0),
m_PathStartX(0.0f),
m_PathStartY(0.0f),
m_PathCurrentX(0.0f),
m_PathCurrentY(0.0f),
m_PathClipType(0),
- m_pLastImage(nullptr),
m_bColored(false),
m_bResourceMissing(false) {
if (pmtContentToUser)
@@ -412,12 +410,12 @@ float CPDF_StreamContentParser::GetNumber(uint32_t index) {
}
ContentParam& param = m_ParamBuf[real_index];
if (param.m_Type == ContentParam::NUMBER) {
- return param.m_Number.m_bInteger ? (float)param.m_Number.m_Integer
- : param.m_Number.m_Float;
+ return param.m_Number.m_bInteger
+ ? static_cast<float>(param.m_Number.m_Integer)
+ : param.m_Number.m_Float;
}
- if (param.m_Type == 0 && param.m_pObject) {
+ if (param.m_Type == 0 && param.m_pObject)
return param.m_pObject->GetNumber();
- }
return 0;
}
@@ -1619,7 +1617,8 @@ void CPDF_StreamContentParser::ParsePathObject() {
int value;
bool bInteger = FX_atonum(m_pSyntax->GetWord(), &value);
- params[nParams++] = bInteger ? (float)value : *(float*)&value;
+ params[nParams++] = bInteger ? static_cast<float>(value)
+ : *reinterpret_cast<float*>(&value);
break;
}
default: