diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-06-11 12:05:04 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-06-11 12:05:04 -0700 |
commit | 677b8fffb0c76c009ad808ed91a27738e5420254 (patch) | |
tree | 3cf9937569b7ca0cb93b6dfd04ac854f414f9d36 /core/src/fpdfapi/fpdf_font | |
parent | 2b5e0d5b20654d116045484868c9e015ed698124 (diff) | |
download | pdfium-677b8fffb0c76c009ad808ed91a27738e5420254.tar.xz |
Kill FXSYS_mem{cpy,cmp,set.move}{32,8}.
At one point in time, it may have made sense to indicate the
expected alignment of the memory you're about to copy, but that
was last century. The compiler will take care of it just fine.
I stopped short of removing the FXSYS_ wrapper macros entirely.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1179693003.
Diffstat (limited to 'core/src/fpdfapi/fpdf_font')
-rw-r--r-- | core/src/fpdfapi/fpdf_font/fpdf_font.cpp | 34 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp | 10 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_font/ttgsubtable.cpp | 2 |
3 files changed, 23 insertions, 23 deletions
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp index 48a96dc554..345e29113f 100644 --- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp +++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp @@ -26,8 +26,8 @@ extern const FX_WORD* PDF_UnicodesForPredefinedCharSet(int); CPDF_FontGlobals::CPDF_FontGlobals() : m_pContrastRamps(NULL) { - FXSYS_memset32(m_EmbeddedCharsets, 0, sizeof(m_EmbeddedCharsets)); - FXSYS_memset32(m_EmbeddedToUnicodes, 0, sizeof(m_EmbeddedToUnicodes)); + FXSYS_memset(m_EmbeddedCharsets, 0, sizeof(m_EmbeddedCharsets)); + FXSYS_memset(m_EmbeddedToUnicodes, 0, sizeof(m_EmbeddedToUnicodes)); } CPDF_FontGlobals::~CPDF_FontGlobals() { @@ -41,7 +41,7 @@ class CFX_StockFontArray public: CFX_StockFontArray() { - FXSYS_memset32(m_pStockFonts, 0, sizeof(m_pStockFonts)); + FXSYS_memset(m_pStockFonts, 0, sizeof(m_pStockFonts)); } ~CFX_StockFontArray() { @@ -819,10 +819,10 @@ FX_BOOL CPDF_Font::IsStandardFont() const extern const FX_CHAR* PDF_CharNameFromPredefinedCharSet(int encoding, uint8_t charcode); CPDF_SimpleFont::CPDF_SimpleFont(int fonttype) : CPDF_Font(fonttype) { - FXSYS_memset8(m_CharBBox, 0xff, sizeof m_CharBBox); - FXSYS_memset8(m_CharWidth, 0xff, sizeof m_CharWidth); - FXSYS_memset8(m_GlyphIndex, 0xff, sizeof m_GlyphIndex); - FXSYS_memset8(m_ExtGID, 0xff, sizeof m_ExtGID); + FXSYS_memset(m_CharBBox, 0xff, sizeof m_CharBBox); + FXSYS_memset(m_CharWidth, 0xff, sizeof m_CharWidth); + FXSYS_memset(m_GlyphIndex, 0xff, sizeof m_GlyphIndex); + FXSYS_memset(m_ExtGID, 0xff, sizeof m_ExtGID); m_pCharNames = NULL; m_BaseEncoding = PDFFONT_ENCODING_BUILTIN; } @@ -1153,7 +1153,7 @@ void CPDF_Type1Font::LoadGlyphMap() if (bGotOne) { #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ if (!bCoreText) { - FXSYS_memcpy32(m_ExtGID, m_GlyphIndex, 256); + FXSYS_memcpy(m_ExtGID, m_GlyphIndex, 256); } #endif return; @@ -1197,7 +1197,7 @@ void CPDF_Type1Font::LoadGlyphMap() } #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ if (!bCoreText) { - FXSYS_memcpy32(m_ExtGID, m_GlyphIndex, 256); + FXSYS_memcpy(m_ExtGID, m_GlyphIndex, 256); } #endif return; @@ -1223,7 +1223,7 @@ void CPDF_Type1Font::LoadGlyphMap() unicode = FT_UnicodeFromCharCode(PDFFONT_ENCODING_STANDARD, charcode); } FX_CHAR name_glyph[256]; - FXSYS_memset32(name_glyph, 0, sizeof(name_glyph)); + FXSYS_memset(name_glyph, 0, sizeof(name_glyph)); FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256); name_glyph[255] = 0; if (unicode == 0 && name_glyph[0] != 0) { @@ -1299,7 +1299,7 @@ void CPDF_Type1Font::LoadGlyphMap() FX_WCHAR unicode = FT_UnicodeFromCharCode(PDFFONT_ENCODING_STANDARD, charcode); if (unicode == 0) { FX_CHAR name_glyph[256]; - FXSYS_memset32(name_glyph, 0, sizeof(name_glyph)); + FXSYS_memset(name_glyph, 0, sizeof(name_glyph)); FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256); name_glyph[255] = 0; if (name_glyph[0] != 0) { @@ -1312,7 +1312,7 @@ void CPDF_Type1Font::LoadGlyphMap() } #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ if (!bCoreText) { - FXSYS_memcpy32(m_ExtGID, m_GlyphIndex, 256); + FXSYS_memcpy(m_ExtGID, m_GlyphIndex, 256); } #endif return; @@ -1339,13 +1339,13 @@ void CPDF_Type1Font::LoadGlyphMap() } #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ if (!bCoreText) { - FXSYS_memcpy32(m_ExtGID, m_GlyphIndex, 256); + FXSYS_memcpy(m_ExtGID, m_GlyphIndex, 256); } #endif } CPDF_FontEncoding::CPDF_FontEncoding() { - FXSYS_memset32(m_Unicodes, 0, sizeof(m_Unicodes)); + FXSYS_memset(m_Unicodes, 0, sizeof(m_Unicodes)); } int CPDF_FontEncoding::CharCodeFromUnicode(FX_WCHAR unicode) const { @@ -1359,7 +1359,7 @@ CPDF_FontEncoding::CPDF_FontEncoding(int PredefinedEncoding) { const FX_WORD* pSrc = PDF_UnicodesForPredefinedCharSet(PredefinedEncoding); if (!pSrc) { - FXSYS_memset32(m_Unicodes, 0, sizeof(m_Unicodes)); + FXSYS_memset(m_Unicodes, 0, sizeof(m_Unicodes)); } else for (int i = 0; i < 256; i++) { m_Unicodes[i] = pSrc[i]; @@ -1367,7 +1367,7 @@ CPDF_FontEncoding::CPDF_FontEncoding(int PredefinedEncoding) } FX_BOOL CPDF_FontEncoding::IsIdentical(CPDF_FontEncoding* pAnother) const { - return FXSYS_memcmp32(m_Unicodes, pAnother->m_Unicodes, sizeof(m_Unicodes)) == 0; + return FXSYS_memcmp(m_Unicodes, pAnother->m_Unicodes, sizeof(m_Unicodes)) == 0; } CPDF_Object* CPDF_FontEncoding::Realize() { @@ -1597,7 +1597,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap() CPDF_Type3Font::CPDF_Type3Font() : CPDF_SimpleFont(PDFFONT_TYPE3) { m_pPageResources = NULL; - FXSYS_memset32(m_CharWidthL, 0, sizeof m_CharWidthL); + FXSYS_memset(m_CharWidthL, 0, sizeof m_CharWidthL); } CPDF_Type3Font::~CPDF_Type3Font() { diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp index ed5ef5c5fe..7726981bb8 100644 --- a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp +++ b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp @@ -17,7 +17,7 @@ extern const FX_CHAR* GetAdobeCharName(int iBaseEncoding, const CFX_ByteString* CPDF_CMapManager::CPDF_CMapManager() { m_bPrompted = FALSE; - FXSYS_memset32(m_CID2UnicodeMaps, 0, sizeof m_CID2UnicodeMaps); + FXSYS_memset(m_CID2UnicodeMaps, 0, sizeof m_CID2UnicodeMaps); } CPDF_CMapManager::~CPDF_CMapManager() { @@ -255,7 +255,7 @@ void CPDF_CMapParser::ParseWord(const CFX_ByteStringC& word) m_pCMap->m_CodingScheme = CPDF_CMap::MixedFourBytes; m_pCMap->m_nCodeRanges = nSegs; m_pCMap->m_pLeadingBytes = FX_Alloc2D(uint8_t, nSegs, sizeof(_CMap_CodeRange)); - FXSYS_memcpy32(m_pCMap->m_pLeadingBytes, m_CodeRanges.GetData(), nSegs * sizeof(_CMap_CodeRange)); + FXSYS_memcpy(m_pCMap->m_pLeadingBytes, m_CodeRanges.GetData(), nSegs * sizeof(_CMap_CodeRange)); } else if (nSegs == 1) { m_pCMap->m_CodingScheme = (m_CodeRanges[0].m_CharSize == 2) ? CPDF_CMap::TwoBytes : CPDF_CMap::OneByte; } @@ -412,7 +412,7 @@ FX_BOOL CPDF_CMap::LoadEmbedded(const uint8_t* pData, FX_DWORD size) if (m_CodingScheme == MixedFourBytes && parser.m_AddMaps.GetSize()) { m_pAddMapping = FX_Alloc(uint8_t, parser.m_AddMaps.GetSize() + 4); *(FX_DWORD*)m_pAddMapping = parser.m_AddMaps.GetSize() / 8; - FXSYS_memcpy32(m_pAddMapping + 4, parser.m_AddMaps.GetBuffer(), parser.m_AddMaps.GetSize()); + FXSYS_memcpy(m_pAddMapping + 4, parser.m_AddMaps.GetBuffer(), parser.m_AddMaps.GetSize()); FXSYS_qsort(m_pAddMapping + 4, parser.m_AddMaps.GetSize() / 8, 8, compare_dword); } return TRUE; @@ -638,7 +638,7 @@ int CPDF_CMap::AppendChar(FX_CHAR* str, FX_DWORD charcode) const iSize = 1; } if (iSize > 1) { - FXSYS_memset32(str, 0, sizeof(uint8_t) * iSize); + FXSYS_memset(str, 0, sizeof(uint8_t) * iSize); } str[iSize - 1] = (uint8_t)charcode; return iSize; @@ -703,7 +703,7 @@ CPDF_CIDFont::CPDF_CIDFont() : CPDF_Font(PDFFONT_CIDFONT) m_bCIDIsGID = FALSE; m_bAdobeCourierStd = FALSE; m_pTTGSUBTable = NULL; - FXSYS_memset8(m_CharBBox, 0xff, 256 * sizeof(FX_SMALL_RECT)); + FXSYS_memset(m_CharBBox, 0xff, 256 * sizeof(FX_SMALL_RECT)); } CPDF_CIDFont::~CPDF_CIDFont() { diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp index b6b2f57c02..62c9fe55d2 100644 --- a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp +++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp @@ -254,7 +254,7 @@ void CFX_CTTGSUBTable::ParseLangSys(FT_Bytes raw, struct TLangSys *rec) return; } rec->FeatureIndex = new TT_uint16_t[rec->FeatureCount]; - FXSYS_memset32(rec->FeatureIndex, 0, sizeof(TT_uint16_t) * rec->FeatureCount); + FXSYS_memset(rec->FeatureIndex, 0, sizeof(TT_uint16_t) * rec->FeatureCount); for (int i = 0; i < rec->FeatureCount; ++i) { rec->FeatureIndex[i] = GetUInt16(sp); } |