summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-09 13:24:12 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-09 13:24:12 -0700
commitbfa9a824a20f37c2dd7111012b46c929cf2ed8a0 (patch)
tree4cfbe682869d89900f33751c37f6a84865beeb0a /core/src/fpdfapi/fpdf_page
parentb116136da234afcad018bb44a3ccb64b9ad2a554 (diff)
downloadpdfium-bfa9a824a20f37c2dd7111012b46c929cf2ed8a0.tar.xz
Merge to XFA: Use stdint.h types throughout PDFium.
Near-automatic merge, plus re-running scripts to update additional usage. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1172793002
Diffstat (limited to 'core/src/fpdfapi/fpdf_page')
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page.cpp16
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp38
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp6
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp8
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp20
-rw-r--r--core/src/fpdfapi/fpdf_page/pageint.h14
8 files changed, 54 insertions, 54 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
index 5a9f1a8cb8..82f90d17a6 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
@@ -113,7 +113,7 @@ CPDF_TextObject::~CPDF_TextObject()
}
void CPDF_TextObject::GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const
{
- pInfo->m_CharCode = m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)m_pCharCodes : m_pCharCodes[index];
+ pInfo->m_CharCode = m_nChars == 1 ? (FX_DWORD)(uintptr_t)m_pCharCodes : m_pCharCodes[index];
pInfo->m_OriginX = index ? m_pCharPos[index - 1] : 0;
pInfo->m_OriginY = 0;
if (pInfo->m_CharCode == -1) {
@@ -150,7 +150,7 @@ int CPDF_TextObject::CountChars() const
void CPDF_TextObject::GetCharInfo(int index, FX_DWORD& charcode, FX_FLOAT& kerning) const
{
if (m_nChars == 1) {
- charcode = (FX_DWORD)(FX_UINTPTR)m_pCharCodes;
+ charcode = (FX_DWORD)(uintptr_t)m_pCharCodes;
kerning = 0;
return;
}
@@ -254,7 +254,7 @@ void CPDF_TextObject::SetSegments(const CFX_ByteString* pStrs, FX_FLOAT* pKernin
}
} else {
int offset = 0;
- m_pCharCodes = (FX_DWORD*)(FX_UINTPTR)pFont->GetNextChar(pStrs[0], pStrs[0].GetLength(), offset);
+ m_pCharCodes = (FX_DWORD*)(uintptr_t)pFont->GetNextChar(pStrs[0], pStrs[0].GetLength(), offset);
}
}
void CPDF_TextObject::SetText(const CFX_ByteString& str)
@@ -311,7 +311,7 @@ void CPDF_TextObject::SetText(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pKerni
}
}
} else {
- m_pCharCodes = (FX_DWORD*)(FX_UINTPTR)pCharCodes[0];
+ m_pCharCodes = (FX_DWORD*)(uintptr_t)pCharCodes[0];
}
RecalcPositionData();
}
@@ -360,7 +360,7 @@ void CPDF_TextObject::GetCharRect(int index, CFX_FloatRect& rect) const
FX_FLOAT fontsize = m_TextState.GetFontSize() / 1000;
int count = 0;
for (int i = 0; i < m_nChars; i ++) {
- FX_DWORD charcode = m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)m_pCharCodes : m_pCharCodes[i];
+ FX_DWORD charcode = m_nChars == 1 ? (FX_DWORD)(uintptr_t)m_pCharCodes : m_pCharCodes[i];
if (charcode == (FX_DWORD) - 1) {
continue;
}
@@ -404,7 +404,7 @@ void CPDF_TextObject::CalcPositionData(FX_FLOAT* pTextAdvanceX, FX_FLOAT* pTextA
}
FX_FLOAT fontsize = m_TextState.GetFontSize();
for (int i = 0; i < m_nChars; i ++) {
- FX_DWORD charcode = m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)m_pCharCodes : m_pCharCodes[i];
+ FX_DWORD charcode = m_nChars == 1 ? (FX_DWORD)(uintptr_t)m_pCharCodes : m_pCharCodes[i];
if (charcode == (FX_DWORD) - 1) {
curpos -= FXSYS_Mul(m_pCharPos[i - 1], fontsize) / 1000;
continue;
@@ -531,7 +531,7 @@ void CPDF_TextObject::CalcCharPos(FX_FLOAT* pPosArray) const
FX_FLOAT fontsize = m_TextState.GetFontSize();
int index = 0;
for (int i = 0; i < m_nChars; i ++) {
- FX_DWORD charcode = m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)m_pCharCodes : m_pCharCodes[i];
+ FX_DWORD charcode = m_nChars == 1 ? (FX_DWORD)(uintptr_t)m_pCharCodes : m_pCharCodes[i];
if (charcode == (FX_DWORD) - 1) {
continue;
}
@@ -583,7 +583,7 @@ void CPDF_TextObject::SetData(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharP
return;
}
if (nChars == 1) {
- m_pCharCodes = (FX_DWORD*)(FX_UINTPTR) * pCharCodes;
+ m_pCharCodes = (FX_DWORD*)(uintptr_t) * pCharCodes;
} else {
m_pCharCodes = FX_Alloc(FX_DWORD, nChars);
FXSYS_memcpy32(m_pCharCodes, pCharCodes, sizeof(FX_DWORD)*nChars);
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
index 8b9ff8ea96..ea61078209 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
@@ -129,7 +129,7 @@ static void ReverseRGB(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels)
{
if (pDestBuf == pSrcBuf)
for (int i = 0; i < pixels; i ++) {
- FX_BYTE temp = pDestBuf[2];
+ uint8_t temp = pDestBuf[2];
pDestBuf[2] = pDestBuf[0];
pDestBuf[0] = temp;
pDestBuf += 3;
@@ -168,7 +168,7 @@ void CPDF_DeviceCS::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, i
if (!m_dwStdConversion) {
AdobeCMYK_to_sRGB1(pSrcBuf[0], pSrcBuf[1], pSrcBuf[2], pSrcBuf[3], pDestBuf[2], pDestBuf[1], pDestBuf[0]);
} else {
- FX_BYTE k = pSrcBuf[3];
+ uint8_t k = pSrcBuf[3];
pDestBuf[2] = 255 - FX_MIN(255, pSrcBuf[0] + k);
pDestBuf[1] = 255 - FX_MIN(255, pSrcBuf[1] + k);
pDestBuf[0] = 255 - FX_MIN(255, pSrcBuf[2] + k);
@@ -178,7 +178,7 @@ void CPDF_DeviceCS::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, i
}
}
}
-const FX_BYTE g_sRGBSamples1[] = {
+const uint8_t g_sRGBSamples1[] = {
0, 3, 6, 10, 13, 15, 18, 20, 22, 23, 25, 27, 28, 30, 31, 32,
34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
49, 50, 51, 52, 53, 53, 54, 55, 56, 56, 57, 58, 58, 59, 60, 61,
@@ -192,7 +192,7 @@ const FX_BYTE g_sRGBSamples1[] = {
110, 110, 111, 111, 111, 112, 112, 112, 113, 113, 113, 114, 114, 114, 115, 115,
115, 115, 116, 116, 116, 117, 117, 117, 118, 118, 118, 118, 119, 119, 119, 120,
};
-const FX_BYTE g_sRGBSamples2[] = {
+const uint8_t g_sRGBSamples2[] = {
120, 121, 122, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 148, 149, 150, 151,
152, 153, 154, 155, 155, 156, 157, 158, 159, 159, 160, 161, 162, 163, 163, 164,
@@ -514,9 +514,9 @@ void CPDF_LabCS::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int
lab[1] = (FX_FLOAT)(pSrcBuf[1] - 128);
lab[2] = (FX_FLOAT)(pSrcBuf[2] - 128);
GetRGB(lab, R, G, B);
- pDestBuf[0] = (FX_INT32)(B * 255);
- pDestBuf[1] = (FX_INT32)(G * 255);
- pDestBuf[2] = (FX_INT32)(R * 255);
+ pDestBuf[0] = (int32_t)(B * 255);
+ pDestBuf[1] = (int32_t)(G * 255);
+ pDestBuf[2] = (int32_t)(R * 255);
pDestBuf += 3;
pSrcBuf += 3;
}
@@ -611,7 +611,7 @@ FX_BOOL CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
}
else { // No valid alternative colorspace
pAlterCS->ReleaseCS();
- FX_INT32 nDictComponents = pDict ? pDict->GetInteger(FX_BSTRC("N")) : 0;
+ int32_t nDictComponents = pDict ? pDict->GetInteger(FX_BSTRC("N")) : 0;
if (nDictComponents != 1 && nDictComponents != 3 && nDictComponents != 4) {
return FALSE;
}
@@ -715,14 +715,14 @@ void CPDF_ICCBasedCS::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf,
CPDF_ModuleMgr::Get()->GetIccModule()->TranslateScanline(m_pProfile->m_pTransform, pDestBuf, pSrcBuf, pixels);
} else {
if (m_pCache == NULL) {
- ((CPDF_ICCBasedCS*)this)->m_pCache = FX_Alloc2D(FX_BYTE, nMaxColors, 3);
- FX_LPBYTE temp_src = FX_Alloc2D(FX_BYTE, nMaxColors, m_nComponents);
+ ((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;
for (int i = 0; i < nMaxColors; i ++) {
FX_DWORD color = i;
FX_DWORD order = nMaxColors / 52;
for (int c = 0; c < m_nComponents; c ++) {
- *pSrc++ = (FX_BYTE)(color / order * 5);
+ *pSrc++ = (uint8_t)(color / order * 5);
color %= order;
order /= 52;
}
@@ -826,7 +826,7 @@ FX_BOOL CPDF_IndexedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
}
FX_BOOL CPDF_IndexedCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
{
- int index = (FX_INT32)(*pBuf);
+ int index = (int32_t)(*pBuf);
if (index < 0 || index > m_MaxIndex) {
return FALSE;
}
@@ -1204,7 +1204,7 @@ int CPDF_ColorSpace::GetBufSize() const
FX_FLOAT* CPDF_ColorSpace::CreateBuf()
{
int size = GetBufSize();
- FX_BYTE* pBuf = FX_Alloc(FX_BYTE, size);
+ uint8_t* pBuf = FX_Alloc(uint8_t, size);
return (FX_FLOAT*)pBuf;
}
FX_BOOL CPDF_ColorSpace::sRGB() const
@@ -1270,9 +1270,9 @@ void CPDF_ColorSpace::TranslateImageLine(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf,
src[j] = (FX_FLOAT)(*src_buf ++) / 255;
}
GetRGB(src, R, G, B);
- *dest_buf ++ = (FX_INT32)(B * 255);
- *dest_buf ++ = (FX_INT32)(G * 255);
- *dest_buf ++ = (FX_INT32)(R * 255);
+ *dest_buf ++ = (int32_t)(B * 255);
+ *dest_buf ++ = (int32_t)(G * 255);
+ *dest_buf ++ = (int32_t)(R * 255);
}
}
void CPDF_ColorSpace::EnableStdConversion(FX_BOOL bEnabled)
@@ -1420,9 +1420,9 @@ FX_BOOL CPDF_Color::GetRGB(int& R, int& G, int& B) const
if (!m_pCS->GetRGB(m_pBuffer, r, g, b)) {
return FALSE;
}
- R = (FX_INT32)(r * 255 + 0.5f);
- G = (FX_INT32)(g * 255 + 0.5f);
- B = (FX_INT32)(b * 255 + 0.5f);
+ R = (int32_t)(r * 255 + 0.5f);
+ G = (int32_t)(g * 255 + 0.5f);
+ B = (int32_t)(b * 255 + 0.5f);
return TRUE;
}
CPDF_Pattern* CPDF_Color::GetPattern() const
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
index 241b5895c5..00ea4c5fce 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
@@ -572,7 +572,7 @@ CPDF_IccProfile* CPDF_DocPageData::GetIccProfile(CPDF_Stream* pIccProfileStream)
}
CPDF_StreamAcc stream;
stream.LoadAllData(pIccProfileStream, FALSE);
- FX_BYTE digest[20];
+ uint8_t digest[20];
CPDF_Stream* pCopiedStream = NULL;
CRYPT_SHA1Generate(stream.GetData(), stream.GetSize(), digest);
if (m_HashProfileMap.Lookup(CFX_ByteStringC(digest, 20), (void*&)pCopiedStream)) {
@@ -621,7 +621,7 @@ CPDF_StreamAcc* CPDF_DocPageData::GetFontFileStreamAcc(CPDF_Stream* pFontStream)
ftData = new CPDF_CountedObject<CPDF_StreamAcc*>;
CPDF_StreamAcc* pFontFile = new CPDF_StreamAcc;
CPDF_Dictionary* pFontDict = pFontStream->GetDict();
- FX_INT32 org_size = pFontDict->GetInteger(FX_BSTRC("Length1")) + pFontDict->GetInteger(FX_BSTRC("Length2")) + pFontDict->GetInteger(FX_BSTRC("Length3"));
+ int32_t org_size = pFontDict->GetInteger(FX_BSTRC("Length1")) + pFontDict->GetInteger(FX_BSTRC("Length2")) + pFontDict->GetInteger(FX_BSTRC("Length3"));
if (org_size < 0) {
org_size = 0;
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
index d29dee77d8..dadf6bf9cb 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
@@ -77,7 +77,7 @@ FX_BOOL CPDF_PSProc::Execute(CPDF_PSEngine* pEngine)
{
int size = m_Operators.GetSize();
for (int i = 0; i < size; i ++) {
- PDF_PSOP op = (PDF_PSOP)(FX_UINTPTR)m_Operators[i];
+ PDF_PSOP op = (PDF_PSOP)(uintptr_t)m_Operators[i];
if (op == PSOP_PROC) {
i ++;
} else if (op == PSOP_CONST) {
@@ -492,7 +492,7 @@ FX_BOOL CPDF_SampledFunc::v_Init(CPDF_Object* pObj)
if (!pSize && i == 0) {
m_pEncodeInfo[i].sizes = pDict->GetInteger(FX_BSTRC("Size"));
}
- if (nTotalSamples > 0 && (FX_UINT32)(m_pEncodeInfo[i].sizes) > UINT_MAX / nTotalSamples) {
+ if (nTotalSamples > 0 && (uint32_t)(m_pEncodeInfo[i].sizes) > UINT_MAX / nTotalSamples) {
return FALSE;
}
nTotalSamples *= m_pEncodeInfo[i].sizes;
@@ -512,7 +512,7 @@ FX_BOOL CPDF_SampledFunc::v_Init(CPDF_Object* pObj)
return FALSE;
}
nTotalSamples *= m_nBitsPerSample;
- if (nTotalSamples > 0 && ((FX_UINT32)m_nOutputs) > UINT_MAX / nTotalSamples) {
+ if (nTotalSamples > 0 && ((uint32_t)m_nOutputs) > UINT_MAX / nTotalSamples) {
return FALSE;
}
nTotalSamples *= m_nOutputs;
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 2bf3b1d4c3..bb4b9dee23 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
@@ -60,7 +60,7 @@ CPDF_ClipPathData::CPDF_ClipPathData(const CPDF_ClipPathData& src)
for (int i = 0; i < m_PathCount; i ++) {
m_pPathList[i] = src.m_pPathList[i];
}
- m_pTypeList = FX_Alloc(FX_BYTE, alloc_size);
+ m_pTypeList = FX_Alloc(uint8_t, alloc_size);
FXSYS_memcpy32(m_pTypeList, src.m_pTypeList, m_PathCount);
} else {
m_pPathList = NULL;
@@ -88,7 +88,7 @@ void CPDF_ClipPathData::SetCount(int path_count, int text_count)
m_PathCount = path_count;
int alloc_size = (path_count + 7) / 8 * 8;
m_pPathList = new CPDF_Path[alloc_size];
- m_pTypeList = FX_Alloc(FX_BYTE, alloc_size);
+ m_pTypeList = FX_Alloc(uint8_t, alloc_size);
}
if (text_count) {
m_TextCount = text_count;
@@ -155,7 +155,7 @@ void CPDF_ClipPath::AppendPath(CPDF_Path path, int type, FX_BOOL bAutoMerge)
pNewPath[i] = pData->m_pPathList[i];
}
delete[] pData->m_pPathList;
- FX_BYTE* pNewType = FX_Alloc(FX_BYTE, pData->m_PathCount + 8);
+ uint8_t* pNewType = FX_Alloc(uint8_t, pData->m_PathCount + 8);
FXSYS_memcpy32(pNewType, pData->m_pTypeList, pData->m_PathCount);
if (pData->m_pTypeList) {
FX_Free(pData->m_pTypeList);
@@ -164,7 +164,7 @@ void CPDF_ClipPath::AppendPath(CPDF_Path path, int type, FX_BOOL bAutoMerge)
pData->m_pTypeList = pNewType;
}
pData->m_pPathList[pData->m_PathCount] = path;
- pData->m_pTypeList[pData->m_PathCount] = (FX_BYTE)type;
+ pData->m_pTypeList[pData->m_PathCount] = (uint8_t)type;
pData->m_PathCount ++;
}
void CPDF_ClipPath::DeletePath(int index)
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
index b3e3cd6a2c..a92e9e783d 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -1553,7 +1553,7 @@ CFX_ByteString _FPDF_ByteStringFromHex(CFX_BinaryBuf& src_buf)
FX_LPCBYTE str = src_buf.GetBuffer();
FX_DWORD size = src_buf.GetSize();
for (FX_DWORD i = 0; i < size; i ++) {
- FX_BYTE ch = str[i];
+ uint8_t ch = str[i];
if (ch >= '0' && ch <= '9') {
if (bFirst) {
code = (ch - '0') * 16;
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 d8b24593ef..bc2138e19e 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
@@ -23,7 +23,7 @@ FX_BOOL _PDF_HasInvalidOpChar(FX_LPCSTR op)
if(!op) {
return FALSE;
}
- FX_BYTE ch;
+ uint8_t ch;
while((ch = *op++)) {
if(_PDF_OpCharType[ch] == 'I') {
return TRUE;
@@ -235,7 +235,7 @@ void CPDF_StreamContentParser::ParsePathObject()
}
}
}
-CPDF_StreamParser::CPDF_StreamParser(const FX_BYTE* pData, FX_DWORD dwSize)
+CPDF_StreamParser::CPDF_StreamParser(const uint8_t* pData, FX_DWORD dwSize)
{
m_pBuf = pData;
m_Size = dwSize;
@@ -262,7 +262,7 @@ FX_DWORD _DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder, FX_LPBYTE& dest_b
delete pDecoder;
return -1;
}
- dest_buf = FX_Alloc2D(FX_BYTE, pitch, height);
+ 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);
@@ -277,11 +277,11 @@ FX_DWORD _DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder, FX_LPBYTE& dest_b
}
ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
const CPDF_Dictionary* pParams);
-FX_DWORD _A85Decode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
-FX_DWORD _HexDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
-FX_DWORD FPDFAPI_FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_buf, FX_DWORD src_size, 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 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 PDF_DecodeInlineStream(const FX_BYTE* src_buf, FX_DWORD limit,
+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)
{
@@ -373,7 +373,7 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc, CPDF_Dicti
if (OrigSize > m_Size - m_Pos) {
OrigSize = m_Size - m_Pos;
}
- pData = FX_Alloc(FX_BYTE, OrigSize);
+ pData = FX_Alloc(uint8_t, OrigSize);
FXSYS_memcpy32(pData, m_pBuf + m_Pos, OrigSize);
dwStreamSize = OrigSize;
m_Pos += OrigSize;
@@ -421,7 +421,7 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc, CPDF_Dicti
dwStreamSize += m_Pos - dwPrevPos;
}
m_Pos = dwSavePos;
- pData = FX_Alloc(FX_BYTE, dwStreamSize);
+ pData = FX_Alloc(uint8_t, dwStreamSize);
FXSYS_memcpy32(pData, m_pBuf + m_Pos, dwStreamSize);
m_Pos += dwStreamSize;
}
@@ -1049,7 +1049,7 @@ void CPDF_ContentParser::Continue(IFX_Pause* pPause)
}
m_Size += size + 1;
}
- m_pData = FX_Alloc(FX_BYTE, m_Size);
+ m_pData = FX_Alloc(uint8_t, m_Size);
FX_DWORD pos = 0;
for (i = 0; i < m_nStreams; i ++) {
FXSYS_memcpy32(m_pData + pos, m_pStreamArray[i]->GetData(), m_pStreamArray[i]->GetSize());
diff --git a/core/src/fpdfapi/fpdf_page/pageint.h b/core/src/fpdfapi/fpdf_page/pageint.h
index 7c527150b3..1f5428d56f 100644
--- a/core/src/fpdfapi/fpdf_page/pageint.h
+++ b/core/src/fpdfapi/fpdf_page/pageint.h
@@ -16,7 +16,7 @@ class CPDF_StreamParser
{
public:
- CPDF_StreamParser(const FX_BYTE* pData, FX_DWORD dwSize);
+ CPDF_StreamParser(const uint8_t* pData, FX_DWORD dwSize);
~CPDF_StreamParser();
CPDF_Stream* ReadInlineStream(CPDF_Document* pDoc, CPDF_Dictionary* pDict, CPDF_Object* pCSObj, FX_BOOL bDecode);
@@ -52,10 +52,10 @@ protected:
void GetNextWord(FX_BOOL& bIsNumber);
CFX_ByteString ReadString();
CFX_ByteString ReadHexString();
- const FX_BYTE* m_pBuf;
+ const uint8_t* m_pBuf;
FX_DWORD m_Size;
FX_DWORD m_Pos;
- FX_BYTE m_WordBuffer[256];
+ uint8_t m_WordBuffer[256];
FX_DWORD m_WordSize;
CPDF_Object* m_pLastObj;
};
@@ -153,7 +153,7 @@ public:
FX_FLOAT GetNumber16(FX_DWORD index);
int GetInteger(FX_DWORD index)
{
- return (FX_INT32)(GetNumber(index));
+ return (int32_t)(GetNumber(index));
}
FX_BOOL OnOperator(FX_LPCSTR op);
void BigCaseCaller(int index);
@@ -338,7 +338,7 @@ KeyType PDF_DocPageData_FindValue(const CFX_MapPtrTemplate<KeyType, CPDF_Counted
}
}
findData = NULL;
- return (KeyType)(FX_UINTPTR)NULL;
+ return (KeyType)(uintptr_t)NULL;
}
template <class KeyType, class ValueType>
FX_BOOL PDF_DocPageData_Release(CFX_MapPtrTemplate<KeyType, CPDF_CountedObject<ValueType>*> &map, KeyType findKey, ValueType findValue, FX_BOOL bForce = FALSE)
@@ -422,11 +422,11 @@ class CPDF_IccProfile
public:
CPDF_IccProfile(FX_LPCBYTE pData, FX_DWORD dwSize);
~CPDF_IccProfile();
- FX_INT32 GetComponents() const { return m_nSrcComponents; }
+ int32_t GetComponents() const { return m_nSrcComponents; }
FX_BOOL m_bsRGB;
FX_LPVOID m_pTransform;
private:
- FX_INT32 m_nSrcComponents;
+ int32_t m_nSrcComponents;
};
class CPDF_DeviceCS : public CPDF_ColorSpace
{