summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-09-11 13:13:31 -0700
committerLei Zhang <thestig@chromium.org>2015-09-11 13:13:31 -0700
commit6aca3e209ff6148f1d77b86b8b97d3bdf18e3eba (patch)
tree280c27ff9c75ded60b562f246973e8335e3b3b02 /core/src/fpdfapi
parentf9e40aec10263f9445d69598657f42550294d653 (diff)
downloadpdfium-6aca3e209ff6148f1d77b86b8b97d3bdf18e3eba.tar.xz
Cleanup casting of FX_Alloc() return values.
Also convert some FX_AllocOrDie() calls to FX_Alloc(). R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1332173002 .
Diffstat (limited to 'core/src/fpdfapi')
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp3
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_font/ttgsubtable.cpp2
3 files changed, 3 insertions, 4 deletions
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
index 4ce50a8ac4..79bfbdb13a 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
@@ -128,8 +128,7 @@ void CPDF_PageContentGenerate::TransformContent(CFX_Matrix& matrix) {
if (type == PDFOBJ_ARRAY) {
CPDF_Array* pArray = (CPDF_Array*)pContent;
int iCount = pArray->GetCount();
- CPDF_StreamAcc** pContentArray =
- (CPDF_StreamAcc**)FX_Alloc(CPDF_StreamAcc*, iCount);
+ CPDF_StreamAcc** pContentArray = FX_Alloc(CPDF_StreamAcc*, iCount);
int size = 0;
int i = 0;
for (i = 0; i < iCount; ++i) {
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
index 9a37cccfc9..ad33a3f0a6 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
@@ -1256,7 +1256,7 @@ int CPDF_CIDFont::GetGlyphIndex(FX_DWORD unicode, FX_BOOL* pVertGlyph) {
int error = FXFT_Load_Sfnt_Table(face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0,
NULL, &length);
if (!error) {
- m_Font.SetSubData((uint8_t*)FX_Alloc(uint8_t, length));
+ m_Font.SetSubData(FX_Alloc(uint8_t, length));
}
}
int error = FXFT_Load_Sfnt_Table(face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0,
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
index c45384feee..6c1b4263b1 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
@@ -393,7 +393,7 @@ IFX_GSUBTable* IFX_GSUBTable::Create(CFX_Font* pFont) {
int error = FXFT_Load_Sfnt_Table(
pFont->GetFace(), FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, NULL, &length);
if (!error) {
- pFont->SetSubData((uint8_t*)FX_Alloc(uint8_t, length));
+ pFont->SetSubData(FX_Alloc(uint8_t, length));
}
if (!pFont->GetSubData()) {
return NULL;