зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1330495 - Unbreak FreeBSD build after bug 1324739. r=jfkthame
MozReview-Commit-ID: 5UmQVREYMRq --HG-- extra : rebase_source : 684bcb818b07b6491a875f7f89b2ab70cd6761ed
This commit is contained in:
Родитель
8b86d759bf
Коммит
26a1801310
|
@ -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<FILE*>(NULL))
|
||||
if (output_file == static_cast<FILE*>(NULL))
|
||||
return false;
|
||||
for (size_t i = 0; i < output_stream.Size(); ++i) {
|
||||
fwrite(&(output_stream.Get()[i]), 1, 1, output_file);
|
||||
|
|
|
@ -439,7 +439,7 @@ CMapTable::CMapFormat0::Builder::Builder(
|
|||
}
|
||||
|
||||
CMapTable::CMapFormat0::Builder::Builder(const CMapId& cmap_id)
|
||||
: CMap::Builder(reinterpret_cast<ReadableFontData*>(NULL),
|
||||
: CMap::Builder(static_cast<ReadableFontData*>(NULL),
|
||||
CMapFormat::kFormat0,
|
||||
cmap_id) {
|
||||
}
|
||||
|
@ -563,7 +563,7 @@ CMapTable::CMapFormat2::Builder::Builder(WritableFontData* data,
|
|||
: CMapTable::CMap::Builder(data ? down_cast<WritableFontData*>(
|
||||
data->Slice(offset, data->ReadUShort(
|
||||
offset + Offset::kFormat0Length)))
|
||||
: reinterpret_cast<WritableFontData*>(NULL),
|
||||
: static_cast<WritableFontData*>(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<ReadableFontData*>(
|
||||
data->Slice(offset, data->ReadUShort(
|
||||
offset + Offset::kFormat0Length)))
|
||||
: reinterpret_cast<ReadableFontData*>(NULL),
|
||||
: static_cast<ReadableFontData*>(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<ReadableFontData*>(NULL),
|
||||
: CMap::Builder(static_cast<ReadableFontData*>(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<ReadableFontData*>(NULL),
|
||||
: CMap::Builder(static_cast<ReadableFontData*>(NULL),
|
||||
CMapFormat::kFormat4, cmap_id) {
|
||||
}
|
||||
|
||||
|
|
|
@ -67,11 +67,11 @@ void CMapBasicTests::SetUp() {
|
|||
LoadFont(font_name.c_str(), font_factory, &font_array);
|
||||
ASSERT_FALSE(font_array.empty());
|
||||
Ptr<Font> font = font_array.at(0);
|
||||
ASSERT_NE(font, reinterpret_cast<Font*>(NULL));
|
||||
ASSERT_NE(font, static_cast<Font*>(NULL));
|
||||
cmap_table_ = down_cast<CMapTable*>(font->GetTable(Tag::cmap));
|
||||
if (!cmap_table_)
|
||||
fprintf(stderr, "No CMap: %s\n", font_name.c_str());
|
||||
ASSERT_NE(cmap_table_, reinterpret_cast<CMapTable*>(NULL));
|
||||
ASSERT_NE(cmap_table_, static_cast<CMapTable*>(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<TiXmlAttribute*>(NULL));
|
||||
ASSERT_NE(num_cmaps_attr, static_cast<TiXmlAttribute*>(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();
|
||||
|
|
|
@ -41,7 +41,7 @@ TEST(CMapEditingTest, RemoveAllButOneCMap) {
|
|||
FontBuilderPtr font_builder = builders[0];
|
||||
Ptr<CMapTable::Builder> cmap_table_builder =
|
||||
(CMapTable::Builder*)font_builder->GetTableBuilder(Tag::cmap);
|
||||
ASSERT_NE(cmap_table_builder, reinterpret_cast<CMapTable::Builder*>(NULL));
|
||||
ASSERT_NE(cmap_table_builder, static_cast<CMapTable::Builder*>(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<CMapTable::CMap*>(NULL));
|
||||
ASSERT_NE(cmap, static_cast<CMapTable::CMap*>(NULL));
|
||||
ASSERT_EQ(CMapTable::WINDOWS_BMP, cmap->cmap_id());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ TEST_P(CMapIteratorTests, IteratorTest) {
|
|||
CMapTable::CMap::CharacterIterator* character_iterator = NULL;
|
||||
character_iterator = cmap_->Iterator();
|
||||
EXPECT_NE(character_iterator,
|
||||
reinterpret_cast<CMapTable::CMap::CharacterIterator*>(NULL));
|
||||
static_cast<CMapTable::CMap::CharacterIterator*>(NULL));
|
||||
CompareCMapIterAndBitSet(character_iterator, bit_set);
|
||||
delete character_iterator;
|
||||
delete bit_set;
|
||||
|
|
|
@ -115,19 +115,19 @@ class CMapTests : public :: testing::TestWithParam<CMapTestCase> {
|
|||
}
|
||||
|
||||
void CMapTests::CommonSetUp(FontArray* font_array) {
|
||||
ASSERT_NE(font_array, reinterpret_cast<FontArray*>(NULL));
|
||||
ASSERT_NE(font_array, static_cast<FontArray*>(NULL));
|
||||
ASSERT_FALSE(font_array->empty());
|
||||
Ptr<Font> font;
|
||||
font = font_array->at(0);
|
||||
ASSERT_NE(font, reinterpret_cast<Font*>(NULL));
|
||||
ASSERT_NE(font, static_cast<Font*>(NULL));
|
||||
Ptr<CMapTable> cmap_table =
|
||||
down_cast<CMapTable*>(font->GetTable(Tag::cmap));
|
||||
cmap1_.Attach(cmap_table->GetCMap(GetParam().first_platform_id(),
|
||||
GetParam().first_encoding_id()));
|
||||
ASSERT_NE((cmap1_), reinterpret_cast<CMapTable::CMap*>(NULL));
|
||||
ASSERT_NE((cmap1_), static_cast<CMapTable::CMap*>(NULL));
|
||||
cmap2_.Attach(cmap_table->GetCMap(GetParam().second_platform_id(),
|
||||
GetParam().second_encoding_id()));
|
||||
ASSERT_NE((cmap2_), reinterpret_cast<CMapTable::CMap*>(NULL));
|
||||
ASSERT_NE((cmap2_), static_cast<CMapTable::CMap*>(NULL));
|
||||
encoder1_ = TestUtils::GetEncoder(GetParam().first_charset_name());
|
||||
encoder2_ = TestUtils::GetEncoder(GetParam().second_charset_name());
|
||||
successful_setup_ = true;
|
||||
|
|
|
@ -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<FILE*>(NULL));
|
||||
EXPECT_NE(input_file, static_cast<FILE*>(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<FILE*>(NULL));
|
||||
EXPECT_NE(output_file, static_cast<FILE*>(NULL));
|
||||
fwrite(output_stream->Get(), 1, output_stream->Size(), output_file);
|
||||
fflush(output_file);
|
||||
fclose(output_file);
|
||||
|
|
Загрузка…
Ссылка в новой задаче