summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-10 14:33:37 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-10 14:33:37 -0700
commitd7e5cc754a937605d1f73db5e7967c58ddd80742 (patch)
treeed28e012c4d6a46b7f29f15a0c060474c27d4286 /core/src/fpdfapi/fpdf_page
parentbfa9a824a20f37c2dd7111012b46c929cf2ed8a0 (diff)
downloadpdfium-d7e5cc754a937605d1f73db5e7967c58ddd80742.tar.xz
Merge to XFA: Remove typdefs for pointer types in fx_system.h.
Original Review URL: https://codereview.chromium.org/1171733003 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1178613002.
Diffstat (limited to 'core/src/fpdfapi/fpdf_page')
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp32
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp22
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp10
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp30
-rw-r--r--core/src/fpdfapi/fpdf_page/pageint.h20
7 files changed, 59 insertions, 59 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
index 82f90d17a6..046cebeb98 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
@@ -242,7 +242,7 @@ void CPDF_TextObject::SetSegments(const CFX_ByteString* pStrs, FX_FLOAT* pKernin
m_pCharPos = FX_Alloc(FX_FLOAT, m_nChars - 1);
int index = 0;
for (int i = 0; i < nsegs; i ++) {
- FX_LPCSTR segment = pStrs[i];
+ const FX_CHAR* segment = pStrs[i];
int offset = 0, len = pStrs[i].GetLength();
while (offset < len) {
m_pCharCodes[index++] = pFont->GetNextChar(segment, len, offset);
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
index ea61078209..1b989be040 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
@@ -125,7 +125,7 @@ FX_BOOL CPDF_DeviceCS::v_SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOA
}
return FALSE;
}
-static void ReverseRGB(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels)
+static void ReverseRGB(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels)
{
if (pDestBuf == pSrcBuf)
for (int i = 0; i < pixels; i ++) {
@@ -142,7 +142,7 @@ static void ReverseRGB(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels)
pSrcBuf += 3;
}
}
-void CPDF_DeviceCS::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
+void CPDF_DeviceCS::TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
{
if (bTransMask && m_Family == PDFCS_DEVICECMYK) {
for (int i = 0; i < pixels; i ++) {
@@ -267,7 +267,7 @@ public:
CPDF_CalGray();
virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
- virtual void TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
+ virtual void TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const;
FX_FLOAT m_WhitePoint[3];
FX_FLOAT m_BlackPoint[3];
@@ -310,7 +310,7 @@ FX_BOOL CPDF_CalGray::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B)
return FALSE;
}
}
-void CPDF_CalGray::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
+void CPDF_CalGray::TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
{
for (int i = 0; i < pixels; i ++) {
*pDestBuf ++ = pSrcBuf[i];
@@ -324,7 +324,7 @@ public:
CPDF_CalRGB();
virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
- virtual void TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
+ virtual void TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const;
FX_FLOAT m_WhitePoint[3];
FX_FLOAT m_BlackPoint[3];
@@ -399,7 +399,7 @@ FX_BOOL CPDF_CalRGB::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B)
pBuf[2] = B;
return TRUE;
}
-void CPDF_CalRGB::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
+void CPDF_CalRGB::TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
{
if (bTransMask) {
FX_FLOAT Cal[3];
@@ -430,7 +430,7 @@ public:
virtual void GetDefaultValue(int iComponent, FX_FLOAT& value, FX_FLOAT& min, FX_FLOAT& max) const;
virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const;
- virtual void TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
+ virtual void TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
FX_FLOAT m_WhitePoint[3];
FX_FLOAT m_BlackPoint[3];
FX_FLOAT m_Ranges[4];
@@ -505,7 +505,7 @@ FX_BOOL CPDF_LabCS::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) c
{
return FALSE;
}
-void CPDF_LabCS::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
+void CPDF_LabCS::TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
{
for (int i = 0; i < pixels; i ++) {
FX_FLOAT lab[3];
@@ -521,7 +521,7 @@ void CPDF_LabCS::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int
pSrcBuf += 3;
}
}
-CPDF_IccProfile::CPDF_IccProfile(FX_LPCBYTE pData, FX_DWORD dwSize):
+CPDF_IccProfile::CPDF_IccProfile(const uint8_t* pData, FX_DWORD dwSize):
m_bsRGB(FALSE),
m_pTransform(NULL),
m_nSrcComponents(0)
@@ -555,11 +555,11 @@ public:
FX_BOOL v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const;
FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const;
virtual void EnableStdConversion(FX_BOOL bEnabled);
- virtual void TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
+ virtual void TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
FX_FLOAT* m_pRanges;
CPDF_IccProfile* m_pProfile;
CPDF_ColorSpace* m_pAlterCS;
- FX_LPBYTE m_pCache;
+ uint8_t* m_pCache;
FX_BOOL m_bOwn;
};
CPDF_ICCBasedCS::CPDF_ICCBasedCS()
@@ -702,7 +702,7 @@ void CPDF_ICCBasedCS::EnableStdConversion(FX_BOOL bEnabled)
m_pAlterCS->EnableStdConversion(bEnabled);
}
}
-void CPDF_ICCBasedCS::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
+void CPDF_ICCBasedCS::TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
{
if (m_pProfile->m_bsRGB) {
ReverseRGB(pDestBuf, pSrcBuf, pixels);
@@ -716,8 +716,8 @@ void CPDF_ICCBasedCS::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf,
} else {
if (m_pCache == NULL) {
((CPDF_ICCBasedCS*)this)->m_pCache = FX_Alloc2D(uint8_t, nMaxColors, 3);
- FX_LPBYTE temp_src = FX_Alloc2D(uint8_t, nMaxColors, m_nComponents);
- FX_LPBYTE pSrc = temp_src;
+ uint8_t* temp_src = FX_Alloc2D(uint8_t, nMaxColors, m_nComponents);
+ uint8_t* pSrc = temp_src;
for (int i = 0; i < nMaxColors; i ++) {
FX_DWORD color = i;
FX_DWORD order = nMaxColors / 52;
@@ -839,7 +839,7 @@ FX_BOOL CPDF_IndexedCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOA
}
CFX_FixedBufGrow<FX_FLOAT, 16> Comps(m_nBaseComponents);
FX_FLOAT* comps = Comps;
- FX_LPCBYTE pTable = m_Table;
+ const uint8_t* pTable = m_Table;
for (int i = 0; i < m_nBaseComponents; i ++) {
comps[i] = m_pCompMinMax[i * 2] + m_pCompMinMax[i * 2 + 1] * pTable[index * m_nBaseComponents + i] / 255;
}
@@ -1257,7 +1257,7 @@ int CPDF_ColorSpace::GetMaxIndex() const
CPDF_IndexedCS* pCS = (CPDF_IndexedCS*)this;
return pCS->m_MaxIndex;
}
-void CPDF_ColorSpace::TranslateImageLine(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
+void CPDF_ColorSpace::TranslateImageLine(uint8_t* dest_buf, const uint8_t* src_buf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
{
CFX_FixedBufGrow<FX_FLOAT, 16> srcbuf(m_nComponents);
FX_FLOAT* src = srcbuf;
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
index dadf6bf9cb..2cfb02869c 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
@@ -64,10 +64,10 @@ CPDF_PSProc::~CPDF_PSProc()
{
int size = m_Operators.GetSize();
for (int i = 0; i < size; i ++) {
- if (m_Operators[i] == (FX_LPVOID)PSOP_PROC) {
+ if (m_Operators[i] == (void*)PSOP_PROC) {
delete (CPDF_PSProc*)m_Operators[i + 1];
i ++;
- } else if (m_Operators[i] == (FX_LPVOID)PSOP_CONST) {
+ } else if (m_Operators[i] == (void*)PSOP_CONST) {
FX_Free((FX_FLOAT*)m_Operators[i + 1]);
i ++;
}
@@ -84,15 +84,15 @@ FX_BOOL CPDF_PSProc::Execute(CPDF_PSEngine* pEngine)
pEngine->Push(*(FX_FLOAT*)m_Operators[i + 1]);
i ++;
} else if (op == PSOP_IF) {
- if (i < 2 || m_Operators[i - 2] != (FX_LPVOID)PSOP_PROC) {
+ if (i < 2 || m_Operators[i - 2] != (void*)PSOP_PROC) {
return FALSE;
}
if ((int)pEngine->Pop()) {
((CPDF_PSProc*)m_Operators[i - 1])->Execute(pEngine);
}
} else if (op == PSOP_IFELSE) {
- if (i < 4 || m_Operators[i - 2] != (FX_LPVOID)PSOP_PROC ||
- m_Operators[i - 4] != (FX_LPVOID)PSOP_PROC) {
+ if (i < 4 || m_Operators[i - 2] != (void*)PSOP_PROC ||
+ m_Operators[i - 4] != (void*)PSOP_PROC) {
return FALSE;
}
if ((int)pEngine->Pop()) {
@@ -147,7 +147,7 @@ const struct _PDF_PSOpName {
};
FX_BOOL CPDF_PSEngine::Parse(const FX_CHAR* string, int size)
{
- CPDF_SimpleParser parser((FX_LPBYTE)string, size);
+ CPDF_SimpleParser parser((uint8_t*)string, size);
CFX_ByteStringC word = parser.GetWord();
if (word != FX_BSTRC("{")) {
return FALSE;
@@ -166,7 +166,7 @@ FX_BOOL CPDF_PSProc::Parse(CPDF_SimpleParser& parser)
}
if (word == FX_BSTRC("{")) {
CPDF_PSProc* pProc = new CPDF_PSProc;
- m_Operators.Add((FX_LPVOID)PSOP_PROC);
+ m_Operators.Add((void*)PSOP_PROC);
m_Operators.Add(pProc);
if (!pProc->Parse(parser)) {
return FALSE;
@@ -175,7 +175,7 @@ FX_BOOL CPDF_PSProc::Parse(CPDF_SimpleParser& parser)
int i = 0;
while (_PDF_PSOpNames[i].name) {
if (word == CFX_ByteStringC(_PDF_PSOpNames[i].name)) {
- m_Operators.Add((FX_LPVOID)_PDF_PSOpNames[i].op);
+ m_Operators.Add((void*)_PDF_PSOpNames[i].op);
break;
}
i ++;
@@ -183,7 +183,7 @@ FX_BOOL CPDF_PSProc::Parse(CPDF_SimpleParser& parser)
if (_PDF_PSOpNames[i].name == NULL) {
FX_FLOAT* pd = FX_Alloc(FX_FLOAT, 1);
*pd = FX_atof(word);
- m_Operators.Add((FX_LPVOID)PSOP_CONST);
+ m_Operators.Add((void*)PSOP_CONST);
m_Operators.Add(pd);
}
}
@@ -424,7 +424,7 @@ static FX_FLOAT PDF_Interpolate(FX_FLOAT x, FX_FLOAT xmin, FX_FLOAT xmax, FX_FLO
{
return ((x - xmin) * (ymax - ymin) / (xmax - xmin)) + ymin;
}
-static FX_DWORD _GetBits32(FX_LPCBYTE pData, int bitpos, int nbits)
+static FX_DWORD _GetBits32(const uint8_t* pData, int bitpos, int nbits)
{
int result = 0;
for (int i = 0; i < nbits; i ++)
@@ -561,7 +561,7 @@ FX_BOOL CPDF_SampledFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const
if (!bitpos.IsValid()) {
return FALSE;
}
- FX_LPCBYTE pSampleData = m_pSampleStream->GetData();
+ const uint8_t* pSampleData = m_pSampleStream->GetData();
if (pSampleData == NULL) {
return FALSE;
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
index bb4b9dee23..3ce4baf20c 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
@@ -349,7 +349,7 @@ FX_FLOAT CPDF_TextState::GetShearAngle() const
CPDF_GeneralStateData::CPDF_GeneralStateData()
{
FXSYS_memset32(this, 0, sizeof(CPDF_GeneralStateData));
- FXSYS_strcpy((FX_LPSTR)m_BlendMode, "Normal");
+ FXSYS_strcpy((FX_CHAR*)m_BlendMode, "Normal");
m_StrokeAlpha = 1.0f;
m_FillAlpha = 1.0f;
m_Flatness = 1.0f;
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
index a92e9e783d..d898feecf4 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -113,7 +113,7 @@ int CPDF_StreamContentParser::GetNextParamPos()
m_ParamCount ++;
return index;
}
-void CPDF_StreamContentParser::AddNameParam(FX_LPCSTR name, int len)
+void CPDF_StreamContentParser::AddNameParam(const FX_CHAR* name, int len)
{
int index = GetNextParamPos();
if (len > 32) {
@@ -131,7 +131,7 @@ void CPDF_StreamContentParser::AddNameParam(FX_LPCSTR name, int len)
}
}
}
-void CPDF_StreamContentParser::AddNumberParam(FX_LPCSTR str, int len)
+void CPDF_StreamContentParser::AddNumberParam(const FX_CHAR* str, int len)
{
int index = GetNextParamPos();
m_ParamBuf1[index].m_Type = PDFOBJ_NUMBER;
@@ -321,7 +321,7 @@ const struct _OpCode {
{FXBSTR_ID('w', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetLineWidth},
{FXBSTR_ID('y', 0, 0, 0), &CPDF_StreamContentParser::Handle_CurveTo_13},
};
-FX_BOOL CPDF_StreamContentParser::OnOperator(FX_LPCSTR op)
+FX_BOOL CPDF_StreamContentParser::OnOperator(const FX_CHAR* op)
{
int i = 0;
FX_DWORD opid = 0;
@@ -410,7 +410,7 @@ void CPDF_StreamContentParser::Handle_BeginMarkedContent()
m_CurContentMark.GetModify()->AddMark(tag, NULL, FALSE);
}
struct _FX_BSTR {
- FX_LPCSTR m_Ptr;
+ const FX_CHAR* m_Ptr;
int m_Size;
};
#define _FX_BSTRC(str) {str, sizeof(str)-1}
@@ -1550,7 +1550,7 @@ CFX_ByteString _FPDF_ByteStringFromHex(CFX_BinaryBuf& src_buf)
CFX_ByteTextBuf buf;
FX_BOOL bFirst = TRUE;
int code = 0;
- FX_LPCBYTE str = src_buf.GetBuffer();
+ const uint8_t* str = src_buf.GetBuffer();
FX_DWORD size = src_buf.GetSize();
for (FX_DWORD i = 0; i < size; i ++) {
uint8_t ch = str[i];
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
index bc2138e19e..ec2b69f70b 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
@@ -9,7 +9,7 @@
#include "../../../include/fxcodec/fx_codec.h"
#include "pageint.h"
#include <limits.h>
-extern const FX_LPCSTR _PDF_OpCharType =
+const FX_CHAR* const _PDF_OpCharType =
"IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
"IIVIIIIVIIVIIIIIVVIIIIIIIIIIIIII"
"IIVVVVVVIVVVVVVIVVVVVIIVVIIIIIII"
@@ -18,7 +18,7 @@ extern const FX_LPCSTR _PDF_OpCharType =
"IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
"IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
"IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII";
-FX_BOOL _PDF_HasInvalidOpChar(FX_LPCSTR op)
+FX_BOOL _PDF_HasInvalidOpChar(const FX_CHAR* op)
{
if(!op) {
return FALSE;
@@ -41,7 +41,7 @@ class CPDF_StreamParserAutoClearer {
private:
CPDF_StreamParser** scoped_variable_;
};
-FX_DWORD CPDF_StreamContentParser::Parse(FX_LPCBYTE pData, FX_DWORD dwSize, FX_DWORD max_cost)
+FX_DWORD CPDF_StreamContentParser::Parse(const uint8_t* pData, FX_DWORD dwSize, FX_DWORD max_cost)
{
if (m_Level > _FPDF_MAX_FORM_LEVEL_) {
return dwSize;
@@ -71,7 +71,7 @@ FX_DWORD CPDF_StreamContentParser::Parse(FX_LPCBYTE pData, FX_DWORD dwSize, FX_D
AddNumberParam((char*)syntax.GetWordBuf(), syntax.GetWordSize());
break;
case CPDF_StreamParser::Name:
- AddNameParam((FX_LPCSTR)syntax.GetWordBuf() + 1, syntax.GetWordSize() - 1);
+ AddNameParam((const FX_CHAR*)syntax.GetWordBuf() + 1, syntax.GetWordSize() - 1);
break;
default:
AddObjectParam(syntax.GetObject());
@@ -97,7 +97,7 @@ void CPDF_StreamContentParser::Handle_BeginImage()
if (type != CPDF_StreamParser::Name) {
break;
}
- CFX_ByteString key((FX_LPCSTR)m_pSyntax->GetWordBuf() + 1, m_pSyntax->GetWordSize() - 1);
+ CFX_ByteString key((const FX_CHAR*)m_pSyntax->GetWordBuf() + 1, m_pSyntax->GetWordSize() - 1);
CPDF_Object* pObj = m_pSyntax->ReadNextObject();
if (!key.IsEmpty()) {
pDict->SetAt(key, pObj, m_pDocument);
@@ -248,7 +248,7 @@ CPDF_StreamParser::~CPDF_StreamParser()
m_pLastObj->Release();
}
}
-FX_DWORD _DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
+FX_DWORD _DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder, uint8_t*& dest_buf, FX_DWORD& dest_size)
{
if (pDecoder == NULL) {
return (FX_DWORD) - 1;
@@ -265,7 +265,7 @@ FX_DWORD _DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder, FX_LPBYTE& dest_b
dest_buf = FX_Alloc2D(uint8_t, pitch, height);
dest_size = pitch * height; // Safe since checked alloc returned.
for (int row = 0; row < height; row ++) {
- FX_LPBYTE pLine = pDecoder->GetScanline(row);
+ uint8_t* pLine = pDecoder->GetScanline(row);
if (pLine == NULL) {
break;
}
@@ -275,15 +275,15 @@ FX_DWORD _DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder, FX_LPBYTE& dest_b
delete pDecoder;
return srcoff;
}
-ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
const CPDF_Dictionary* pParams);
-FX_DWORD _A85Decode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
-FX_DWORD _HexDecode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
+FX_DWORD _A85Decode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, FX_DWORD& dest_size);
+FX_DWORD _HexDecode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, FX_DWORD& dest_size);
FX_DWORD FPDFAPI_FlateOrLZWDecode(FX_BOOL bLZW, const uint8_t* src_buf, FX_DWORD src_size, CPDF_Dictionary* pParams,
- FX_DWORD estimated_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
+ FX_DWORD estimated_size, uint8_t*& dest_buf, FX_DWORD& dest_size);
FX_DWORD PDF_DecodeInlineStream(const uint8_t* src_buf, FX_DWORD limit,
int width, int height, CFX_ByteString& decoder,
- CPDF_Dictionary* pParam, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
+ CPDF_Dictionary* pParam, uint8_t*& dest_buf, FX_DWORD& dest_size)
{
if (decoder == FX_BSTRC("CCITTFaxDecode") || decoder == FX_BSTRC("CCF")) {
ICodec_ScanlineDecoder* pDecoder = FPDFAPI_CreateFaxDecoder(src_buf, limit, width, height, pParam);
@@ -367,7 +367,7 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc, CPDF_Dicti
return NULL;
}
OrigSize *= height;
- FX_LPBYTE pData = NULL;
+ uint8_t* pData = NULL;
FX_DWORD dwStreamSize;
if (Decoder.IsEmpty()) {
if (OrigSize > m_Size - m_Pos) {
@@ -1026,7 +1026,7 @@ void CPDF_ContentParser::Start(CPDF_Form* pForm, CPDF_AllStates* pGraphicStates,
} else {
m_pSingleStream->LoadAllData(pForm->m_pFormStream, FALSE);
}
- m_pData = (FX_LPBYTE)m_pSingleStream->GetData();
+ m_pData = (uint8_t*)m_pSingleStream->GetData();
m_Size = m_pSingleStream->GetSize();
m_Status = ToBeContinued;
m_InternalStage = PAGEPARSE_STAGE_PARSE;
@@ -1060,7 +1060,7 @@ void CPDF_ContentParser::Continue(IFX_Pause* pPause)
FX_Free(m_pStreamArray);
m_pStreamArray = NULL;
} else {
- m_pData = (FX_LPBYTE)m_pSingleStream->GetData();
+ m_pData = (uint8_t*)m_pSingleStream->GetData();
m_Size = m_pSingleStream->GetSize();
}
m_InternalStage = PAGEPARSE_STAGE_PARSE;
diff --git a/core/src/fpdfapi/fpdf_page/pageint.h b/core/src/fpdfapi/fpdf_page/pageint.h
index 1f5428d56f..9ff1c4cb11 100644
--- a/core/src/fpdfapi/fpdf_page/pageint.h
+++ b/core/src/fpdfapi/fpdf_page/pageint.h
@@ -23,7 +23,7 @@ public:
typedef enum { EndOfData, Number, Keyword, Name, Others } SyntaxType;
SyntaxType ParseNextElement();
- FX_LPBYTE GetWordBuf()
+ uint8_t* GetWordBuf()
{
return m_WordBuffer;
}
@@ -142,9 +142,9 @@ public:
_ContentParam m_ParamBuf1[PARAM_BUF_SIZE];
FX_DWORD m_ParamStartPos;
FX_DWORD m_ParamCount;
- void AddNumberParam(FX_LPCSTR str, int len);
+ void AddNumberParam(const FX_CHAR* str, int len);
void AddObjectParam(CPDF_Object* pObj);
- void AddNameParam(FX_LPCSTR name, int size);
+ void AddNameParam(const FX_CHAR* name, int size);
int GetNextParamPos();
void ClearAllParams();
CPDF_Object* GetObject(FX_DWORD index);
@@ -155,7 +155,7 @@ public:
{
return (int32_t)(GetNumber(index));
}
- FX_BOOL OnOperator(FX_LPCSTR op);
+ FX_BOOL OnOperator(const FX_CHAR* op);
void BigCaseCaller(int index);
FX_BOOL m_bAbort;
CPDF_StreamParser* m_pSyntax;
@@ -173,7 +173,7 @@ public:
void ConvertUserSpace(FX_FLOAT& x, FX_FLOAT& y);
void ConvertTextSpace(FX_FLOAT& x, FX_FLOAT& y);
void OnChangeTextMatrix();
- FX_DWORD Parse(FX_LPCBYTE pData, FX_DWORD dwSize, FX_DWORD max_cost);
+ FX_DWORD Parse(const uint8_t* pData, FX_DWORD dwSize, FX_DWORD max_cost);
void ParsePathObject();
int m_CompatCount;
FX_PATHPOINT* m_pPathPoints;
@@ -307,7 +307,7 @@ protected:
CPDF_StreamAcc* m_pSingleStream;
CPDF_StreamAcc** m_pStreamArray;
FX_DWORD m_nStreams;
- FX_LPBYTE m_pData;
+ uint8_t* m_pData;
FX_DWORD m_Size;
class CPDF_StreamContentParser* m_pParser;
FX_DWORD m_CurrentOffset;
@@ -420,11 +420,11 @@ protected:
class CPDF_IccProfile
{
public:
- CPDF_IccProfile(FX_LPCBYTE pData, FX_DWORD dwSize);
+ CPDF_IccProfile(const uint8_t* pData, FX_DWORD dwSize);
~CPDF_IccProfile();
int32_t GetComponents() const { return m_nSrcComponents; }
FX_BOOL m_bsRGB;
- FX_LPVOID m_pTransform;
+ void* m_pTransform;
private:
int32_t m_nSrcComponents;
};
@@ -436,7 +436,7 @@ public:
FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const;
FX_BOOL v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const;
FX_BOOL v_SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const;
- virtual void TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
+ virtual void TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
};
class CPDF_PatternCS : public CPDF_ColorSpace
{
@@ -461,7 +461,7 @@ public:
int m_nIndex;
};
~CPDF_ResourceNaming();
- CFX_ByteString GetName(const CPDF_Dictionary* pResList, FX_LPCSTR szType);
+ CFX_ByteString GetName(const CPDF_Dictionary* pResList, const FX_CHAR* szType);
protected:
CFX_MapByteStringToPtr m_NamingCache;
};