Use more static_cast in fpdfsdk
This CL replaces some reinterpret_cast with static_cast in fpdfsdk. It also
removes an obsolete comment in fpdfedit.h
Change-Id: I36c29bfcd6382490a8c955b50ccfa4c93ab351c7
Reviewed-on: https://pdfium-review.googlesource.com/5632
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
diff --git a/fpdfsdk/fpdfedit_embeddertest.cpp b/fpdfsdk/fpdfedit_embeddertest.cpp
index ed5fe3e..4559ee3 100644
--- a/fpdfsdk/fpdfedit_embeddertest.cpp
+++ b/fpdfsdk/fpdfedit_embeddertest.cpp
@@ -26,7 +26,7 @@
protected:
FPDF_DOCUMENT CreateNewDocument() {
document_ = FPDF_CreateNewDocument();
- cpdf_doc_ = reinterpret_cast<CPDF_Document*>(document_);
+ cpdf_doc_ = static_cast<CPDF_Document*>(document_);
return document_;
}
@@ -562,7 +562,7 @@
std::unique_ptr<void, FPDFFontDeleter> font(
FPDFText_LoadFont(document(), data, size, FPDF_FONT_TYPE1, false));
ASSERT_TRUE(font.get());
- CPDF_Font* typed_font = reinterpret_cast<CPDF_Font*>(font.get());
+ CPDF_Font* typed_font = static_cast<CPDF_Font*>(font.get());
EXPECT_TRUE(typed_font->IsType1Font());
CPDF_Dictionary* font_dict = typed_font->GetFontDict();
@@ -591,7 +591,7 @@
std::unique_ptr<void, FPDFFontDeleter> font(
FPDFText_LoadFont(document(), data, size, FPDF_FONT_TRUETYPE, false));
ASSERT_TRUE(font.get());
- CPDF_Font* typed_font = reinterpret_cast<CPDF_Font*>(font.get());
+ CPDF_Font* typed_font = static_cast<CPDF_Font*>(font.get());
EXPECT_TRUE(typed_font->IsTrueTypeFont());
CPDF_Dictionary* font_dict = typed_font->GetFontDict();
@@ -621,7 +621,7 @@
std::unique_ptr<void, FPDFFontDeleter> font(
FPDFText_LoadFont(document(), data, size, FPDF_FONT_TYPE1, 1));
ASSERT_TRUE(font.get());
- CPDF_Font* typed_font = reinterpret_cast<CPDF_Font*>(font.get());
+ CPDF_Font* typed_font = static_cast<CPDF_Font*>(font.get());
EXPECT_TRUE(typed_font->IsCIDFont());
// Check font dictionary entries
@@ -663,7 +663,7 @@
std::unique_ptr<void, FPDFFontDeleter> font(
FPDFText_LoadFont(document(), data, size, FPDF_FONT_TRUETYPE, 1));
ASSERT_TRUE(font.get());
- CPDF_Font* typed_font = reinterpret_cast<CPDF_Font*>(font.get());
+ CPDF_Font* typed_font = static_cast<CPDF_Font*>(font.get());
EXPECT_TRUE(typed_font->IsCIDFont());
// Check font dictionary entries