diff --git a/gfx/sfntly/cpp/src/sample/subtly/utils.cc b/gfx/sfntly/cpp/src/sample/subtly/utils.cc index 3c204d381460..15efb7a5d4e2 100644 --- a/gfx/sfntly/cpp/src/sample/subtly/utils.cc +++ b/gfx/sfntly/cpp/src/sample/subtly/utils.cc @@ -79,7 +79,7 @@ bool SerializeFont(const char* font_path, FontFactory* factory, Font* font) { #else output_file = fopen(font_path, "wb"); #endif - if (output_file == reinterpret_cast(NULL)) + if (output_file == static_cast(NULL)) return false; for (size_t i = 0; i < output_stream.Size(); ++i) { fwrite(&(output_stream.Get()[i]), 1, 1, output_file); diff --git a/gfx/sfntly/cpp/src/sfntly/table/core/cmap_table.cc b/gfx/sfntly/cpp/src/sfntly/table/core/cmap_table.cc index 1c83d2e7d0e0..b1eb98ee7978 100644 --- a/gfx/sfntly/cpp/src/sfntly/table/core/cmap_table.cc +++ b/gfx/sfntly/cpp/src/sfntly/table/core/cmap_table.cc @@ -439,7 +439,7 @@ CMapTable::CMapFormat0::Builder::Builder( } CMapTable::CMapFormat0::Builder::Builder(const CMapId& cmap_id) - : CMap::Builder(reinterpret_cast(NULL), + : CMap::Builder(static_cast(NULL), CMapFormat::kFormat0, cmap_id) { } @@ -563,7 +563,7 @@ CMapTable::CMapFormat2::Builder::Builder(WritableFontData* data, : CMapTable::CMap::Builder(data ? down_cast( data->Slice(offset, data->ReadUShort( offset + Offset::kFormat0Length))) - : reinterpret_cast(NULL), + : static_cast(NULL), CMapFormat::kFormat2, cmap_id) { // TODO(arthurhsu): FIXIT: heavy lifting and leak, need fix. } @@ -574,7 +574,7 @@ CMapTable::CMapFormat2::Builder::Builder(ReadableFontData* data, : CMapTable::CMap::Builder(data ? down_cast( data->Slice(offset, data->ReadUShort( offset + Offset::kFormat0Length))) - : reinterpret_cast(NULL), + : static_cast(NULL), CMapFormat::kFormat2, cmap_id) { // TODO(arthurhsu): FIXIT: heavy lifting and leak, need fix. } @@ -958,7 +958,7 @@ CMapTable::CMapFormat4::Builder::Builder(WritableFontData* data, int32_t offset, CMapTable::CMapFormat4::Builder::Builder(SegmentList* segments, IntegerList* glyph_id_array, const CMapId& cmap_id) - : CMap::Builder(reinterpret_cast(NULL), + : CMap::Builder(static_cast(NULL), CMapFormat::kFormat4, cmap_id), segments_(segments->begin(), segments->end()), glyph_id_array_(glyph_id_array->begin(), glyph_id_array->end()) { @@ -966,7 +966,7 @@ CMapTable::CMapFormat4::Builder::Builder(SegmentList* segments, } CMapTable::CMapFormat4::Builder::Builder(const CMapId& cmap_id) - : CMap::Builder(reinterpret_cast(NULL), + : CMap::Builder(static_cast(NULL), CMapFormat::kFormat4, cmap_id) { } diff --git a/gfx/sfntly/cpp/src/test/autogenerated/cmap_basic_test.cc b/gfx/sfntly/cpp/src/test/autogenerated/cmap_basic_test.cc index aae35e1c139f..083b27fa9dd5 100644 --- a/gfx/sfntly/cpp/src/test/autogenerated/cmap_basic_test.cc +++ b/gfx/sfntly/cpp/src/test/autogenerated/cmap_basic_test.cc @@ -67,11 +67,11 @@ void CMapBasicTests::SetUp() { LoadFont(font_name.c_str(), font_factory, &font_array); ASSERT_FALSE(font_array.empty()); Ptr font = font_array.at(0); - ASSERT_NE(font, reinterpret_cast(NULL)); + ASSERT_NE(font, static_cast(NULL)); cmap_table_ = down_cast(font->GetTable(Tag::cmap)); if (!cmap_table_) fprintf(stderr, "No CMap: %s\n", font_name.c_str()); - ASSERT_NE(cmap_table_, reinterpret_cast(NULL)); + ASSERT_NE(cmap_table_, static_cast(NULL)); // Loading the XML file document_ = TiXmlDocument((font_name + ".xml").c_str()); @@ -85,7 +85,7 @@ TEST_P(CMapBasicTests, BasicTest) { TiXmlNodeVector* cmaps = GetNodesWithName(cmap_table->at(0), "cmap"); const TiXmlAttribute* num_cmaps_attr = GetAttribute(cmap_table->at(0), "num_cmaps"); - ASSERT_NE(num_cmaps_attr, reinterpret_cast(NULL)); + ASSERT_NE(num_cmaps_attr, static_cast(NULL)); // But there may be more than one CMap in this table ASSERT_LE(cmaps->size(), (size_t)num_cmaps_attr->IntValue()); for (TiXmlNodeVector::iterator it = cmaps->begin(); diff --git a/gfx/sfntly/cpp/src/test/cmap_editing_test.cc b/gfx/sfntly/cpp/src/test/cmap_editing_test.cc index 6df272085ddd..299b60762559 100644 --- a/gfx/sfntly/cpp/src/test/cmap_editing_test.cc +++ b/gfx/sfntly/cpp/src/test/cmap_editing_test.cc @@ -41,7 +41,7 @@ TEST(CMapEditingTest, RemoveAllButOneCMap) { FontBuilderPtr font_builder = builders[0]; Ptr cmap_table_builder = (CMapTable::Builder*)font_builder->GetTableBuilder(Tag::cmap); - ASSERT_NE(cmap_table_builder, reinterpret_cast(NULL)); + ASSERT_NE(cmap_table_builder, static_cast(NULL)); CMapTable::CMapBuilderMap* cmap_builders = cmap_table_builder->GetCMapBuilders(); ASSERT_FALSE(cmap_builders->empty()); @@ -95,7 +95,7 @@ TEST(CMapEditingTest, CopyAllCMapsToNewFont) { ASSERT_EQ(cmap_table->NumCMaps(), new_cmap_table->NumCMaps()); CMapTable::CMapPtr cmap; cmap.Attach(cmap_table->GetCMap(CMapTable::WINDOWS_BMP)); - ASSERT_NE(cmap, reinterpret_cast(NULL)); + ASSERT_NE(cmap, static_cast(NULL)); ASSERT_EQ(CMapTable::WINDOWS_BMP, cmap->cmap_id()); } } diff --git a/gfx/sfntly/cpp/src/test/cmap_iterator_test.cc b/gfx/sfntly/cpp/src/test/cmap_iterator_test.cc index 2e8e6fedf98e..e01a301628f1 100644 --- a/gfx/sfntly/cpp/src/test/cmap_iterator_test.cc +++ b/gfx/sfntly/cpp/src/test/cmap_iterator_test.cc @@ -132,7 +132,7 @@ TEST_P(CMapIteratorTests, IteratorTest) { CMapTable::CMap::CharacterIterator* character_iterator = NULL; character_iterator = cmap_->Iterator(); EXPECT_NE(character_iterator, - reinterpret_cast(NULL)); + static_cast(NULL)); CompareCMapIterAndBitSet(character_iterator, bit_set); delete character_iterator; delete bit_set; diff --git a/gfx/sfntly/cpp/src/test/cmap_test.cc b/gfx/sfntly/cpp/src/test/cmap_test.cc index 02bf8a26c960..5961f1cea322 100644 --- a/gfx/sfntly/cpp/src/test/cmap_test.cc +++ b/gfx/sfntly/cpp/src/test/cmap_test.cc @@ -115,19 +115,19 @@ class CMapTests : public :: testing::TestWithParam { } void CMapTests::CommonSetUp(FontArray* font_array) { - ASSERT_NE(font_array, reinterpret_cast(NULL)); + ASSERT_NE(font_array, static_cast(NULL)); ASSERT_FALSE(font_array->empty()); Ptr font; font = font_array->at(0); - ASSERT_NE(font, reinterpret_cast(NULL)); + ASSERT_NE(font, static_cast(NULL)); Ptr cmap_table = down_cast(font->GetTable(Tag::cmap)); cmap1_.Attach(cmap_table->GetCMap(GetParam().first_platform_id(), GetParam().first_encoding_id())); - ASSERT_NE((cmap1_), reinterpret_cast(NULL)); + ASSERT_NE((cmap1_), static_cast(NULL)); cmap2_.Attach(cmap_table->GetCMap(GetParam().second_platform_id(), GetParam().second_encoding_id())); - ASSERT_NE((cmap2_), reinterpret_cast(NULL)); + ASSERT_NE((cmap2_), static_cast(NULL)); encoder1_ = TestUtils::GetEncoder(GetParam().first_charset_name()); encoder2_ = TestUtils::GetEncoder(GetParam().second_charset_name()); successful_setup_ = true; diff --git a/gfx/sfntly/cpp/src/test/test_font_utils.cc b/gfx/sfntly/cpp/src/test/test_font_utils.cc index d59b52b52f73..a00a811d6c0b 100644 --- a/gfx/sfntly/cpp/src/test/test_font_utils.cc +++ b/gfx/sfntly/cpp/src/test/test_font_utils.cc @@ -70,7 +70,7 @@ void LoadFile(const char* input_file_path, ByteVector* input_buffer) { #else input_file = fopen(input_file_path, "rb"); #endif - EXPECT_NE(input_file, reinterpret_cast(NULL)); + EXPECT_NE(input_file, static_cast(NULL)); fseek(input_file, 0, SEEK_END); size_t file_size = ftell(input_file); fseek(input_file, 0, SEEK_SET); @@ -90,7 +90,7 @@ void SerializeToFile(MemoryOutputStream* output_stream, const char* file_path) { #else output_file = fopen(file_path, "wb"); #endif - EXPECT_NE(output_file, reinterpret_cast(NULL)); + EXPECT_NE(output_file, static_cast(NULL)); fwrite(output_stream->Get(), 1, output_stream->Size(), output_file); fflush(output_file); fclose(output_file);