diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-06-11 12:17:45 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-06-11 12:17:45 -0700 |
commit | 6581175666ba4e1eb2826142376cbfe4495c6e76 (patch) | |
tree | 38770d7cf709979b0d493a6ca0367a0cbc080736 /core/src/fpdfapi | |
parent | 05f11bcf48a630b53cac603538bb75f21ad4231d (diff) | |
download | pdfium-6581175666ba4e1eb2826142376cbfe4495c6e76.tar.xz |
Merge to XFA: Kill FXSYS_mem{cpy,cmp,set.move}{32,8}.
Only manual merge was core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
follwed by scripts.
Original Review URL: https://codereview.chromium.org/1179693003.
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1179953002.
Diffstat (limited to 'core/src/fpdfapi')
24 files changed, 143 insertions, 143 deletions
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp index 8cfbd1b40e..948908e5eb 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp @@ -144,7 +144,7 @@ void CPDF_PageContentGenerate::TransformContent(CFX_Matrix& matrix) int pos = 0; uint8_t* pBuf = FX_Alloc(uint8_t, size); for (i = 0; i < iCount; ++i) { - FXSYS_memcpy32(pBuf + pos, pContentArray[i]->GetData(), pContentArray[i]->GetSize()); + FXSYS_memcpy(pBuf + pos, pContentArray[i]->GetData(), pContentArray[i]->GetSize()); pos += pContentArray[i]->GetSize() + 1; pBuf[pos - 1] = ' '; delete pContentArray[i]; diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp index 0091613120..93531de1ad 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp @@ -752,7 +752,7 @@ FX_BOOL CPDF_XRefStream::GenerateXRefStream(CPDF_Creator* pCreator, FX_BOOL bEOF return -1; } FX_CHAR offset_buf[20]; - FXSYS_memset32(offset_buf, 0, sizeof(offset_buf)); + FXSYS_memset(offset_buf, 0, sizeof(offset_buf)); FXSYS_i64toa(m_PrevOffset, offset_buf, 10); int32_t len = (int32_t)FXSYS_strlen(offset_buf); if (pFile->AppendBlock(offset_buf, len) < 0) { @@ -1863,7 +1863,7 @@ int32_t CPDF_Creator::WriteDoc_Stage4(IFX_Pause *pPause) return -1; } FX_CHAR offset_buf[20]; - FXSYS_memset32(offset_buf, 0, sizeof(offset_buf)); + FXSYS_memset(offset_buf, 0, sizeof(offset_buf)); FXSYS_i64toa(prev, offset_buf, 10); if (m_File.AppendBlock(offset_buf, FXSYS_strlen(offset_buf)) < 0) { return -1; @@ -1952,7 +1952,7 @@ int32_t CPDF_Creator::WriteDoc_Stage4(IFX_Pause *pPause) return -1; } FX_CHAR offset_buf[20]; - FXSYS_memset32(offset_buf, 0, sizeof(offset_buf)); + FXSYS_memset(offset_buf, 0, sizeof(offset_buf)); FXSYS_i64toa(m_XrefStart, offset_buf, 10); if (m_File.AppendBlock(offset_buf, FXSYS_strlen(offset_buf)) < 0) { return -1; diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp index 18913a0020..e6e688fecc 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp @@ -218,7 +218,7 @@ static void _InsertWidthArray(HDC hDC, int start, int end, CPDF_Array* pWidthArr CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTW* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName) { LOGFONTA lfa; - FXSYS_memcpy32(&lfa, pLogFont, (char*)lfa.lfFaceName - (char*)&lfa); + FXSYS_memcpy(&lfa, pLogFont, (char*)lfa.lfFaceName - (char*)&lfa); CFX_ByteString face = CFX_ByteString::FromUnicode(pLogFont->lfFaceName); if (face.GetLength() >= LF_FACESIZE) { return NULL; @@ -608,7 +608,7 @@ CPDF_Font* CPDF_Document::AddMacFont(CTFontRef pFont, FX_BOOL bVert, FX_BOOL bTr CFX_ByteString basefont; FX_BOOL bCJK = FALSE; int flags = 0, italicangle = 0, ascend = 0, descend = 0, capheight = 0, bbox[4]; - FXSYS_memset32(bbox, 0, sizeof(int) * 4); + FXSYS_memset(bbox, 0, sizeof(int) * 4); CFArrayRef languages = (CFArrayRef)CTFontDescriptorCopyAttribute(descriptor, kCTFontLanguagesAttribute); if (languages == NULL) { CFRelease(descriptor); diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp index fd715240a4..ba0358fc74 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp @@ -221,7 +221,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi mask_buf = FX_Alloc2D(uint8_t, maskHeight, maskWidth); mask_size = maskHeight * maskWidth; // Safe since checked alloc returned. for (int32_t a = 0; a < maskHeight; a ++) { - FXSYS_memcpy32(mask_buf + a * maskWidth, pMaskBitmap->GetScanline(a), maskWidth); + FXSYS_memcpy(mask_buf + a * maskWidth, pMaskBitmap->GetScanline(a), maskWidth); } } pMaskDict->SetAtInteger(FX_BSTRC("Length"), mask_size); @@ -303,7 +303,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi uint8_t* pDest = dest_buf; for (int32_t i = 0; i < BitmapHeight; i ++) { if (!bStream) { - FXSYS_memcpy32(pDest, src_buf, dest_pitch); + FXSYS_memcpy(pDest, src_buf, dest_pitch); pDest += dest_pitch; } else { pFileWrite->WriteBlock(src_buf, dest_pitch); 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); } diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp index 688066e3a3..8c6de8e341 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp @@ -586,9 +586,9 @@ void CPDF_TextObject::SetData(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharP m_pCharCodes = (FX_DWORD*)(uintptr_t) * pCharCodes; } else { m_pCharCodes = FX_Alloc(FX_DWORD, nChars); - FXSYS_memcpy32(m_pCharCodes, pCharCodes, sizeof(FX_DWORD)*nChars); + FXSYS_memcpy(m_pCharCodes, pCharCodes, sizeof(FX_DWORD)*nChars); m_pCharPos = FX_Alloc(FX_FLOAT, nChars - 1); - FXSYS_memcpy32(m_pCharPos, pCharPos, sizeof(FX_FLOAT) * (nChars - 1)); + FXSYS_memcpy(m_pCharPos, pCharPos, sizeof(FX_FLOAT) * (nChars - 1)); } RecalcPositionData(); } diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp index dc3d454656..8dd1359846 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp @@ -526,7 +526,7 @@ CPDF_IccProfile::CPDF_IccProfile(const uint8_t* pData, FX_DWORD dwSize): m_pTransform(NULL), m_nSrcComponents(0) { - if (dwSize == 3144 && FXSYS_memcmp32(pData + 0x190, "sRGB IEC61966-2.1", 17) == 0) { + if (dwSize == 3144 && FXSYS_memcmp(pData + 0x190, "sRGB IEC61966-2.1", 17) == 0) { m_bsRGB = TRUE; m_nSrcComponents = 3; } @@ -1351,7 +1351,7 @@ void CPDF_Color::SetValue(FX_FLOAT* comps) return; } if (m_pCS->GetFamily() != PDFCS_PATTERN) { - FXSYS_memcpy32(m_pBuffer, comps, m_pCS->CountComponents() * sizeof(FX_FLOAT)); + FXSYS_memcpy(m_pBuffer, comps, m_pCS->CountComponents() * sizeof(FX_FLOAT)); } } void CPDF_Color::SetValue(CPDF_Pattern* pPattern, FX_FLOAT* comps, int ncomps) @@ -1377,7 +1377,7 @@ void CPDF_Color::SetValue(CPDF_Pattern* pPattern, FX_FLOAT* comps, int ncomps) pvalue->m_nComps = ncomps; pvalue->m_pPattern = pPattern; if (ncomps) { - FXSYS_memcpy32(pvalue->m_Comps, comps, ncomps * sizeof(FX_FLOAT)); + FXSYS_memcpy(pvalue->m_Comps, comps, ncomps * sizeof(FX_FLOAT)); } pvalue->m_pCountedPattern = NULL; if (pPattern && pPattern->m_pDocument) @@ -1403,7 +1403,7 @@ void CPDF_Color::Copy(const CPDF_Color* pSrc) return; } m_pBuffer = m_pCS->CreateBuf(); - FXSYS_memcpy32(m_pBuffer, pSrc->m_pBuffer, m_pCS->GetBufSize()); + FXSYS_memcpy(m_pBuffer, pSrc->m_pBuffer, m_pCS->GetBufSize()); if (m_pCS->GetFamily() == PDFCS_PATTERN) { PatternValue* pvalue = (PatternValue*)m_pBuffer; if (pvalue->m_pPattern && pvalue->m_pPattern->m_pDocument) { @@ -1453,5 +1453,5 @@ FX_BOOL CPDF_Color::IsEqual(const CPDF_Color& other) const if (m_pCS != other.m_pCS || m_pCS == NULL) { return FALSE; } - return FXSYS_memcmp32(m_pBuffer, other.m_pBuffer, m_pCS->GetBufSize()) == 0; + return FXSYS_memcmp(m_pBuffer, other.m_pBuffer, m_pCS->GetBufSize()) == 0; } diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp index 2cfb02869c..f1a8433f3c 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp @@ -873,7 +873,7 @@ FX_BOOL CPDF_Function::Init(CPDF_Object* pObj) if (m_pRanges && m_nOutputs > (int)old_outputs) { m_pRanges = FX_Realloc(FX_FLOAT, m_pRanges, m_nOutputs * 2); if (m_pRanges) { - FXSYS_memset32(m_pRanges + (old_outputs * 2), 0, sizeof(FX_FLOAT) * (m_nOutputs - old_outputs) * 2); + FXSYS_memset(m_pRanges + (old_outputs * 2), 0, sizeof(FX_FLOAT) * (m_nOutputs - old_outputs) * 2); } } return ret; diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp index 8752acf536..178db75cf8 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp @@ -61,7 +61,7 @@ CPDF_ClipPathData::CPDF_ClipPathData(const CPDF_ClipPathData& src) m_pPathList[i] = src.m_pPathList[i]; } m_pTypeList = FX_Alloc(uint8_t, alloc_size); - FXSYS_memcpy32(m_pTypeList, src.m_pTypeList, m_PathCount); + FXSYS_memcpy(m_pTypeList, src.m_pTypeList, m_PathCount); } else { m_pPathList = NULL; m_pTypeList = NULL; @@ -156,7 +156,7 @@ void CPDF_ClipPath::AppendPath(CPDF_Path path, int type, FX_BOOL bAutoMerge) } delete[] pData->m_pPathList; uint8_t* pNewType = FX_Alloc(uint8_t, pData->m_PathCount + 8); - FXSYS_memcpy32(pNewType, pData->m_pTypeList, pData->m_PathCount); + FXSYS_memcpy(pNewType, pData->m_pTypeList, pData->m_PathCount); if (pData->m_pTypeList) { FX_Free(pData->m_pTypeList); } @@ -178,7 +178,7 @@ void CPDF_ClipPath::DeletePath(int index) pData->m_pPathList[i] = pData->m_pPathList[i + 1]; } pData->m_pPathList[pData->m_PathCount - 1].SetNull(); - FXSYS_memmove32(pData->m_pTypeList + index, pData->m_pTypeList + index + 1, pData->m_PathCount - index - 1); + FXSYS_memmove(pData->m_pTypeList + index, pData->m_pTypeList + index + 1, pData->m_PathCount - index - 1); pData->m_PathCount --; } #define FPDF_CLIPPATH_MAX_TEXTS 1024 @@ -193,7 +193,7 @@ void CPDF_ClipPath::AppendTexts(CPDF_TextObject** pTexts, int count) } CPDF_TextObject** pNewList = FX_Alloc(CPDF_TextObject*, pData->m_TextCount + count + 1); if (pData->m_pTextList) { - FXSYS_memcpy32(pNewList, pData->m_pTextList, pData->m_TextCount * sizeof(CPDF_TextObject*)); + FXSYS_memcpy(pNewList, pData->m_pTextList, pData->m_TextCount * sizeof(CPDF_TextObject*)); FX_Free(pData->m_pTextList); } pData->m_pTextList = pNewList; @@ -294,7 +294,7 @@ CPDF_TextStateData::CPDF_TextStateData(const CPDF_TextStateData& src) if (this == &src) { return; } - FXSYS_memcpy32(this, &src, sizeof(CPDF_TextStateData)); + FXSYS_memcpy(this, &src, sizeof(CPDF_TextStateData)); if (m_pDocument && m_pFont) { m_pFont = m_pDocument->GetPageData()->GetFont(m_pFont->GetFontDict(), FALSE); } @@ -348,7 +348,7 @@ FX_FLOAT CPDF_TextState::GetShearAngle() const } CPDF_GeneralStateData::CPDF_GeneralStateData() { - FXSYS_memset32(this, 0, sizeof(CPDF_GeneralStateData)); + FXSYS_memset(this, 0, sizeof(CPDF_GeneralStateData)); FXSYS_strcpy((FX_CHAR*)m_BlendMode, "Normal"); m_StrokeAlpha = 1.0f; m_FillAlpha = 1.0f; @@ -357,7 +357,7 @@ CPDF_GeneralStateData::CPDF_GeneralStateData() } CPDF_GeneralStateData::CPDF_GeneralStateData(const CPDF_GeneralStateData& src) { - FXSYS_memcpy32(this, &src, sizeof(CPDF_GeneralStateData)); + FXSYS_memcpy(this, &src, sizeof(CPDF_GeneralStateData)); if (src.m_pTransferFunc && src.m_pTransferFunc->m_pPDFDoc) { CPDF_DocRenderData* pDocCache = src.m_pTransferFunc->m_pPDFDoc->GetRenderData(); if (!pDocCache) { @@ -422,7 +422,7 @@ void CPDF_GeneralStateData::SetBlendMode(const CFX_ByteStringC& blend_mode) if (blend_mode.GetLength() > 15) { return; } - FXSYS_memcpy32(m_BlendMode, blend_mode.GetPtr(), blend_mode.GetLength()); + FXSYS_memcpy(m_BlendMode, blend_mode.GetPtr(), blend_mode.GetLength()); m_BlendMode[blend_mode.GetLength()] = 0; m_BlendType = ::GetBlendType(blend_mode); } @@ -553,7 +553,7 @@ void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS, CPDF_StreamContentParser case FXBSTR_ID('S', 'M', 'a', 's'): if (pObject && pObject->GetType() == PDFOBJ_DICTIONARY) { pGeneralState->m_pSoftMask = pObject; - FXSYS_memcpy32(pGeneralState->m_SMaskMatrix, &pParser->m_pCurStates->m_CTM, sizeof(CPDF_Matrix)); + FXSYS_memcpy(pGeneralState->m_SMaskMatrix, &pParser->m_pCurStates->m_CTM, sizeof(CPDF_Matrix)); } else { pGeneralState->m_pSoftMask = NULL; } diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp index ebe75484e0..87605470b0 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp @@ -20,7 +20,7 @@ CPDF_StreamContentParser::CPDF_StreamContentParser() m_PathCurrentX = m_PathCurrentY = 0.0f; m_bResourceMissing = FALSE; m_bColored = FALSE; - FXSYS_memset32(m_Type3Data, 0, sizeof(FX_FLOAT) * 6); + FXSYS_memset(m_Type3Data, 0, sizeof(FX_FLOAT) * 6); m_ParamCount = 0; m_ParamStartPos = 0; m_bAbort = FALSE; @@ -122,11 +122,11 @@ void CPDF_StreamContentParser::AddNameParam(const FX_CHAR* name, int len) } else { m_ParamBuf1[index].m_Type = PDFOBJ_NAME; if (FXSYS_memchr(name, '#', len) == NULL) { - FXSYS_memcpy32(m_ParamBuf1[index].m_Name.m_Buffer, name, len); + FXSYS_memcpy(m_ParamBuf1[index].m_Name.m_Buffer, name, len); m_ParamBuf1[index].m_Name.m_Len = len; } else { CFX_ByteString str = PDF_NameDecode(CFX_ByteStringC(name, len)); - FXSYS_memcpy32(m_ParamBuf1[index].m_Name.m_Buffer, str.c_str(), str.GetLength()); + FXSYS_memcpy(m_ParamBuf1[index].m_Name.m_Buffer, str.c_str(), str.GetLength()); m_ParamBuf1[index].m_Name.m_Len = str.GetLength(); } } @@ -442,7 +442,7 @@ static CFX_ByteStringC _PDF_FindFullName(const _FX_BSTR* table, int count, const { int i = 0; while (i < count) { - if (abbr.GetLength() == table[i + 1].m_Size && FXSYS_memcmp32(abbr.GetPtr(), table[i + 1].m_Ptr, abbr.GetLength()) == 0) { + if (abbr.GetLength() == table[i + 1].m_Size && FXSYS_memcmp(abbr.GetPtr(), table[i + 1].m_Ptr, abbr.GetLength()) == 0) { return CFX_ByteStringC(table[i].m_Ptr, table[i].m_Size); } i += 2; @@ -500,7 +500,7 @@ static CFX_ByteStringC _PDF_FindAbbrName(const _FX_BSTR* table, int count, const { int i = 0; while (i < count) { - if (fullName.GetLength() == table[i].m_Size && FXSYS_memcmp32(fullName.GetPtr(), table[i].m_Ptr, fullName.GetLength()) == 0) { + if (fullName.GetLength() == table[i].m_Size && FXSYS_memcmp(fullName.GetPtr(), table[i].m_Ptr, fullName.GetLength()) == 0) { return CFX_ByteStringC(table[i + 1].m_Ptr, table[i + 1].m_Size); } i += 2; @@ -1495,7 +1495,7 @@ void CPDF_StreamContentParser::AddPathPoint(FX_FLOAT x, FX_FLOAT y, int flag) int newsize = m_PathPointCount + 256; FX_PATHPOINT* pNewPoints = FX_Alloc(FX_PATHPOINT, newsize); if (m_PathAllocSize) { - FXSYS_memcpy32(pNewPoints, m_pPathPoints, m_PathAllocSize * sizeof(FX_PATHPOINT)); + FXSYS_memcpy(pNewPoints, m_pPathPoints, m_PathAllocSize * sizeof(FX_PATHPOINT)); FX_Free(m_pPathPoints); } m_pPathPoints = pNewPoints; @@ -1524,7 +1524,7 @@ void CPDF_StreamContentParser::AddPathObject(int FillType, FX_BOOL bStroke) CPDF_Path Path; CFX_PathData* pPathData = Path.New(); pPathData->SetPointCount(PathPointCount); - FXSYS_memcpy32(pPathData->GetPoints(), m_pPathPoints, sizeof(FX_PATHPOINT) * PathPointCount); + FXSYS_memcpy(pPathData->GetPoints(), m_pPathPoints, sizeof(FX_PATHPOINT) * PathPointCount); CFX_AffineMatrix matrix = m_pCurStates->m_CTM; matrix.Concat(m_mtContentToUser); if (bStroke || FillType) { diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp index ec2b69f70b..d829acb004 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp @@ -269,7 +269,7 @@ FX_DWORD _DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder, uint8_t*& dest_bu if (pLine == NULL) { break; } - FXSYS_memcpy32(dest_buf + row * pitch, pLine, pitch); + FXSYS_memcpy(dest_buf + row * pitch, pLine, pitch); } FX_DWORD srcoff = pDecoder->GetSrcOffset(); delete pDecoder; @@ -374,7 +374,7 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc, CPDF_Dicti OrigSize = m_Size - m_Pos; } pData = FX_Alloc(uint8_t, OrigSize); - FXSYS_memcpy32(pData, m_pBuf + m_Pos, OrigSize); + FXSYS_memcpy(pData, m_pBuf + m_Pos, OrigSize); dwStreamSize = OrigSize; m_Pos += OrigSize; } else { @@ -422,7 +422,7 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc, CPDF_Dicti } m_Pos = dwSavePos; pData = FX_Alloc(uint8_t, dwStreamSize); - FXSYS_memcpy32(pData, m_pBuf + m_Pos, dwStreamSize); + FXSYS_memcpy(pData, m_pBuf + m_Pos, dwStreamSize); m_Pos += dwStreamSize; } } @@ -1052,7 +1052,7 @@ void CPDF_ContentParser::Continue(IFX_Pause* pPause) m_pData = FX_Alloc(uint8_t, m_Size); FX_DWORD pos = 0; for (i = 0; i < m_nStreams; i ++) { - FXSYS_memcpy32(m_pData + pos, m_pStreamArray[i]->GetData(), m_pStreamArray[i]->GetSize()); + FXSYS_memcpy(m_pData + pos, m_pStreamArray[i]->GetData(), m_pStreamArray[i]->GetSize()); pos += m_pStreamArray[i]->GetSize() + 1; m_pData[pos - 1] = ' '; delete m_pStreamArray[i]; diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp index d23d75a25d..2aa66d725a 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp @@ -217,7 +217,7 @@ void CPDF_MeshStream::GetColor(FX_FLOAT& r, FX_FLOAT& g, FX_FLOAT& b) static const int kMaxResults = 8; FX_FLOAT result[kMaxResults]; int nResults; - FXSYS_memset32(result, 0, sizeof(result)); + FXSYS_memset(result, 0, sizeof(result)); for (FX_DWORD i = 0; i < m_nFuncs; i ++) { if (m_pFuncs[i] && m_pFuncs[i]->CountOutputs() <= kMaxResults) { m_pFuncs[i]->Call(color_value, 1, result, nResults); diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp index bb490636a9..9736c3dc8e 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp @@ -49,7 +49,7 @@ FX_DWORD _A85Decode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_bu continue; } if (ch == 'z') { - FXSYS_memset32(dest_buf + dest_size, 0, 4); + FXSYS_memset(dest_buf + dest_size, 0, 4); state = 0; res = 0; dest_size += 4; @@ -159,9 +159,9 @@ FX_DWORD RunLengthDecode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& de if (buf_left < copy_len) { FX_DWORD delta = copy_len - buf_left; copy_len = buf_left; - FXSYS_memset8(dest_buf + dest_count + copy_len, '\0', delta); + FXSYS_memset(dest_buf + dest_count + copy_len, '\0', delta); } - FXSYS_memcpy32(dest_buf + dest_count, src_buf + i + 1, copy_len); + FXSYS_memcpy(dest_buf + dest_count, src_buf + i + 1, copy_len); dest_count += src_buf[i] + 1; i += src_buf[i] + 2; } else if (src_buf[i] > 128) { @@ -169,7 +169,7 @@ FX_DWORD RunLengthDecode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& de if (i < src_size - 1) { fill = src_buf[i + 1]; } - FXSYS_memset8(dest_buf + dest_count, fill, 257 - src_buf[i]); + FXSYS_memset(dest_buf + dest_count, fill, 257 - src_buf[i]); dest_count += 257 - src_buf[i]; i += 2; } else { diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp index b4366ba277..43a5c5f170 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp @@ -47,8 +47,8 @@ void CalcEncryptKey(CPDF_Dictionary* pEncrypt, const uint8_t* password, FX_DWORD CRYPT_MD5Generate(digest, copy_len, digest); } } - FXSYS_memset32(key, 0, keylen); - FXSYS_memcpy32(key, digest, copy_len); + FXSYS_memset(key, 0, keylen); + FXSYS_memcpy(key, digest, copy_len); } CPDF_CryptoHandler* CPDF_StandardSecurityHandler::CreateCryptoHandler() { @@ -285,7 +285,7 @@ void Revision6_Hash(const uint8_t* password, FX_DWORD size, const uint8_t* salt, } FX_Free(aes); if (hash) { - FXSYS_memcpy32(hash, input, 32); + FXSYS_memcpy(hash, input, 32); } } FX_BOOL CPDF_StandardSecurityHandler::AES256_CheckPassword(const uint8_t* password, FX_DWORD size, @@ -313,7 +313,7 @@ FX_BOOL CPDF_StandardSecurityHandler::AES256_CheckPassword(const uint8_t* passwo } CRYPT_SHA256Finish(sha, digest); } - if (FXSYS_memcmp32(digest, pkey, 32) != 0) { + if (FXSYS_memcmp(digest, pkey, 32) != 0) { return FALSE; } if (key == NULL) { @@ -337,7 +337,7 @@ FX_BOOL CPDF_StandardSecurityHandler::AES256_CheckPassword(const uint8_t* passwo uint8_t* aes = FX_Alloc(uint8_t, 2048); CRYPT_AESSetKey(aes, 16, digest, 32, FALSE); uint8_t iv[16]; - FXSYS_memset32(iv, 0, 16); + FXSYS_memset(iv, 0, 16); CRYPT_AESSetIV(aes, iv); CRYPT_AESDecrypt(aes, key, ekey, 32); CRYPT_AESSetKey(aes, 16, key, 32, FALSE); @@ -347,12 +347,12 @@ FX_BOOL CPDF_StandardSecurityHandler::AES256_CheckPassword(const uint8_t* passwo return FALSE; } uint8_t perms_buf[16]; - FXSYS_memset32(perms_buf, 0, sizeof(perms_buf)); + FXSYS_memset(perms_buf, 0, sizeof(perms_buf)); FX_DWORD copy_len = sizeof(perms_buf); if (copy_len > (FX_DWORD)perms.GetLength()) { copy_len = perms.GetLength(); } - FXSYS_memcpy32(perms_buf, (const uint8_t*)perms, copy_len); + FXSYS_memcpy(perms_buf, (const uint8_t*)perms, copy_len); uint8_t buf[16]; CRYPT_AESDecrypt(aes, buf, perms_buf, 16); FX_Free(aes); @@ -396,7 +396,7 @@ FX_BOOL CPDF_StandardSecurityHandler::CheckUserPassword(const uint8_t* password, } uint8_t ukeybuf[32]; if (m_Revision == 2) { - FXSYS_memcpy32(ukeybuf, defpasscode, 32); + FXSYS_memcpy(ukeybuf, defpasscode, 32); CRYPT_ArcFourCryptBlock(ukeybuf, 32, key, key_len); } else { uint8_t test[32], tmpkey[32]; @@ -404,9 +404,9 @@ FX_BOOL CPDF_StandardSecurityHandler::CheckUserPassword(const uint8_t* password, if (copy_len > (FX_DWORD)ukey.GetLength()) { copy_len = ukey.GetLength(); } - FXSYS_memset32(test, 0, sizeof(test)); - FXSYS_memset32(tmpkey, 0, sizeof(tmpkey)); - FXSYS_memcpy32(test, ukey.c_str(), copy_len); + FXSYS_memset(test, 0, sizeof(test)); + FXSYS_memset(tmpkey, 0, sizeof(tmpkey)); + FXSYS_memcpy(test, ukey.c_str(), copy_len); for (int i = 19; i >= 0; i --) { for (int j = 0; j < key_len; j ++) { tmpkey[j] = key[j] ^ i; @@ -422,9 +422,9 @@ FX_BOOL CPDF_StandardSecurityHandler::CheckUserPassword(const uint8_t* password, CRYPT_MD5Update(md5, (uint8_t*)id.c_str(), id.GetLength()); } CRYPT_MD5Finish(md5, ukeybuf); - return FXSYS_memcmp32(test, ukeybuf, 16) == 0; + return FXSYS_memcmp(test, ukeybuf, 16) == 0; } - if (FXSYS_memcmp32((void*)ukey.c_str(), ukeybuf, 16) == 0) { + if (FXSYS_memcmp((void*)ukey.c_str(), ukeybuf, 16) == 0) { return TRUE; } return FALSE; @@ -449,25 +449,25 @@ CFX_ByteString CPDF_StandardSecurityHandler::GetUserPassword(const uint8_t* owne } } uint8_t enckey[32]; - FXSYS_memset32(enckey, 0, sizeof(enckey)); + FXSYS_memset(enckey, 0, sizeof(enckey)); FX_DWORD copy_len = key_len; if (copy_len > sizeof(digest)) { copy_len = sizeof(digest); } - FXSYS_memcpy32(enckey, digest, copy_len); + FXSYS_memcpy(enckey, digest, copy_len); int okeylen = okey.GetLength(); if (okeylen > 32) { okeylen = 32; } uint8_t okeybuf[64]; - FXSYS_memset32(okeybuf, 0, sizeof(okeybuf)); - FXSYS_memcpy32(okeybuf, okey.c_str(), okeylen); + FXSYS_memset(okeybuf, 0, sizeof(okeybuf)); + FXSYS_memcpy(okeybuf, okey.c_str(), okeylen); if (m_Revision == 2) { CRYPT_ArcFourCryptBlock(okeybuf, okeylen, enckey, key_len); } else { for (int i = 19; i >= 0; i --) { uint8_t tempkey[32]; - FXSYS_memset32(tempkey, 0, sizeof(tempkey)); + FXSYS_memset(tempkey, 0, sizeof(tempkey)); for (int j = 0; j < m_KeyLen; j ++) { tempkey[j] = enckey[j] ^ i; } @@ -538,7 +538,7 @@ void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_ } } uint8_t enckey[32]; - FXSYS_memcpy32(enckey, digest, key_len); + FXSYS_memcpy(enckey, digest, key_len); for (i = 0; i < 32; i ++) { passcode[i] = i < user_size ? user_pass[i] : defpasscode[i - user_size]; } @@ -557,7 +557,7 @@ void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_ CalcEncryptKey(m_pEncryptDict, (uint8_t*)user_pass, user_size, m_EncryptKey, key_len, FALSE, pIdArray); if (m_Revision < 3) { uint8_t tempbuf[32]; - FXSYS_memcpy32(tempbuf, defpasscode, 32); + FXSYS_memcpy(tempbuf, defpasscode, 32); CRYPT_ArcFourCryptBlock(tempbuf, 32, m_EncryptKey, key_len); pEncryptDict->SetAtString(FX_BSTRC("U"), CFX_ByteString(tempbuf, 32)); } else { @@ -613,7 +613,7 @@ void CPDF_StandardSecurityHandler::AES256_SetPassword(CPDF_Dictionary* pEncryptD } CRYPT_SHA256Finish(sha, digest1); } - FXSYS_memcpy32(digest1 + 32, digest, 16); + FXSYS_memcpy(digest1 + 32, digest, 16); pEncryptDict->SetAtString(bOwner ? FX_BSTRC("O") : FX_BSTRC("U"), CFX_ByteString(digest1, 48)); if (m_Revision >= 6) { Revision6_Hash(password, size, digest + 8, (bOwner ? (const uint8_t*)ukey : NULL), digest1); @@ -629,7 +629,7 @@ void CPDF_StandardSecurityHandler::AES256_SetPassword(CPDF_Dictionary* pEncryptD uint8_t* aes = FX_Alloc(uint8_t, 2048); CRYPT_AESSetKey(aes, 16, digest1, 32, TRUE); uint8_t iv[16]; - FXSYS_memset32(iv, 0, 16); + FXSYS_memset(iv, 0, 16); CRYPT_AESSetIV(aes, iv); CRYPT_AESEncrypt(aes, digest1, key, 32); FX_Free(aes); @@ -654,7 +654,7 @@ void CPDF_StandardSecurityHandler::AES256_SetPerms(CPDF_Dictionary* pEncryptDict uint8_t* aes = FX_Alloc(uint8_t, 2048); CRYPT_AESSetKey(aes, 16, key, 32, TRUE); uint8_t iv[16], buf1[16]; - FXSYS_memset32(iv, 0, 16); + FXSYS_memset(iv, 0, 16); CRYPT_AESSetIV(aes, iv); CRYPT_AESEncrypt(aes, buf1, buf, 16); FX_Free(aes); @@ -664,23 +664,23 @@ void CPDF_StandardCryptoHandler::CryptBlock(FX_BOOL bEncrypt, FX_DWORD objnum, F uint8_t* dest_buf, FX_DWORD& dest_size) { if (m_Cipher == FXCIPHER_NONE) { - FXSYS_memcpy32(dest_buf, src_buf, src_size); + FXSYS_memcpy(dest_buf, src_buf, src_size); return; } uint8_t realkey[16]; int realkeylen = 16; if (m_Cipher != FXCIPHER_AES || m_KeyLen != 32) { uint8_t key1[32]; - FXSYS_memcpy32(key1, m_EncryptKey, m_KeyLen); + FXSYS_memcpy(key1, m_EncryptKey, m_KeyLen); key1[m_KeyLen + 0] = (uint8_t)objnum; key1[m_KeyLen + 1] = (uint8_t)(objnum >> 8); key1[m_KeyLen + 2] = (uint8_t)(objnum >> 16); key1[m_KeyLen + 3] = (uint8_t)gennum; key1[m_KeyLen + 4] = (uint8_t)(gennum >> 8); - FXSYS_memcpy32(key1 + m_KeyLen, &objnum, 3); - FXSYS_memcpy32(key1 + m_KeyLen + 3, &gennum, 2); + FXSYS_memcpy(key1 + m_KeyLen, &objnum, 3); + FXSYS_memcpy(key1 + m_KeyLen + 3, &gennum, 2); if (m_Cipher == FXCIPHER_AES) { - FXSYS_memcpy32(key1 + m_KeyLen + 5, "sAlT", 4); + FXSYS_memcpy(key1 + m_KeyLen + 5, "sAlT", 4); } CRYPT_MD5Generate(key1, m_Cipher == FXCIPHER_AES ? m_KeyLen + 9 : m_KeyLen + 5, realkey); realkeylen = m_KeyLen + 5; @@ -696,12 +696,12 @@ void CPDF_StandardCryptoHandler::CryptBlock(FX_BOOL bEncrypt, FX_DWORD objnum, F iv[i] = (uint8_t)rand(); } CRYPT_AESSetIV(m_pAESContext, iv); - FXSYS_memcpy32(dest_buf, iv, 16); + FXSYS_memcpy(dest_buf, iv, 16); int nblocks = src_size / 16; CRYPT_AESEncrypt(m_pAESContext, dest_buf + 16, src_buf, nblocks * 16); uint8_t padding[16]; - FXSYS_memcpy32(padding, src_buf + nblocks * 16, src_size % 16); - FXSYS_memset8(padding + src_size % 16, 16 - src_size % 16, 16 - src_size % 16); + FXSYS_memcpy(padding, src_buf + nblocks * 16, src_size % 16); + FXSYS_memset(padding + src_size % 16, 16 - src_size % 16, 16 - src_size % 16); CRYPT_AESEncrypt(m_pAESContext, dest_buf + nblocks * 16 + 16, padding, 16); dest_size = 32 + nblocks * 16; } else { @@ -713,7 +713,7 @@ void CPDF_StandardCryptoHandler::CryptBlock(FX_BOOL bEncrypt, FX_DWORD objnum, F } else { ASSERT(dest_size == src_size); if (dest_buf != src_buf) { - FXSYS_memcpy32(dest_buf, src_buf, src_size); + FXSYS_memcpy(dest_buf, src_buf, src_size); } CRYPT_ArcFourCryptBlock(dest_buf, dest_size, realkey, realkeylen); } @@ -743,11 +743,11 @@ void* CPDF_StandardCryptoHandler::CryptStart(FX_DWORD objnum, FX_DWORD gennum, F return pContext; } uint8_t key1[48]; - FXSYS_memcpy32(key1, m_EncryptKey, m_KeyLen); - FXSYS_memcpy32(key1 + m_KeyLen, &objnum, 3); - FXSYS_memcpy32(key1 + m_KeyLen + 3, &gennum, 2); + FXSYS_memcpy(key1, m_EncryptKey, m_KeyLen); + FXSYS_memcpy(key1 + m_KeyLen, &objnum, 3); + FXSYS_memcpy(key1 + m_KeyLen + 3, &gennum, 2); if (m_Cipher == FXCIPHER_AES) { - FXSYS_memcpy32(key1 + m_KeyLen + 5, "sAlT", 4); + FXSYS_memcpy(key1 + m_KeyLen + 5, "sAlT", 4); } uint8_t realkey[16]; CRYPT_MD5Generate(key1, m_Cipher == FXCIPHER_AES ? m_KeyLen + 9 : m_KeyLen + 5, realkey); @@ -799,7 +799,7 @@ FX_BOOL CPDF_StandardCryptoHandler::CryptStream(void* context, const uint8_t* sr if (copy_size > src_left) { copy_size = src_left; } - FXSYS_memcpy32(pContext->m_Block + pContext->m_BlockOffset, src_buf + src_off, copy_size); + FXSYS_memcpy(pContext->m_Block + pContext->m_BlockOffset, src_buf + src_off, copy_size); src_off += copy_size; src_left -= copy_size; pContext->m_BlockOffset += copy_size; @@ -845,7 +845,7 @@ FX_BOOL CPDF_StandardCryptoHandler::CryptFinish(void* context, CFX_BinaryBuf& de dest_buf.AppendBlock(block_buf, 16); pContext->m_BlockOffset = 0; } - FXSYS_memset8(pContext->m_Block + pContext->m_BlockOffset, (uint8_t)(16 - pContext->m_BlockOffset), 16 - pContext->m_BlockOffset); + FXSYS_memset(pContext->m_Block + pContext->m_BlockOffset, (uint8_t)(16 - pContext->m_BlockOffset), 16 - pContext->m_BlockOffset); CRYPT_AESEncrypt(pContext->m_Context, block_buf, pContext->m_Block, 16); dest_buf.AppendBlock(block_buf, 16); } else if (pContext->m_BlockOffset == 16) { @@ -876,7 +876,7 @@ FX_BOOL CPDF_StandardCryptoHandler::Init(CPDF_Dictionary* pEncryptDict, CPDF_Sec return FALSE; } if (m_Cipher != FXCIPHER_NONE) { - FXSYS_memcpy32(m_EncryptKey, key, m_KeyLen); + FXSYS_memcpy(m_EncryptKey, key, m_KeyLen); } if (m_Cipher == FXCIPHER_AES) { m_pAESContext = FX_Alloc(uint8_t, 2048); @@ -909,7 +909,7 @@ FX_BOOL CPDF_StandardCryptoHandler::Init(int cipher, const uint8_t* key, int key } m_Cipher = cipher; m_KeyLen = keylen; - FXSYS_memcpy32(m_EncryptKey, key, keylen); + FXSYS_memcpy(m_EncryptKey, key, keylen); if (m_Cipher == FXCIPHER_AES) { m_pAESContext = FX_Alloc(uint8_t, 2048); } diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp index f0cabe5412..c00b193413 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp @@ -255,7 +255,7 @@ FX_DWORD CPDF_StreamFilter::ReadLeftOver(uint8_t* buffer, FX_DWORD buf_size) if (read_size > buf_size) { read_size = buf_size; } - FXSYS_memcpy32(buffer, m_pBuffer->GetBuffer() + m_BufOffset, read_size); + FXSYS_memcpy(buffer, m_pBuffer->GetBuffer() + m_BufOffset, read_size); m_BufOffset += read_size; if (m_BufOffset == (FX_DWORD)m_pBuffer->GetSize()) { delete m_pBuffer; @@ -548,7 +548,7 @@ void CPDF_PredictorFilter::v_FilterIn(const uint8_t* src_buf, FX_DWORD src_size, if (read_size > src_size) { read_size = src_size; } - FXSYS_memcpy32(m_pCurLine + m_LineInSize, src_buf, read_size); + FXSYS_memcpy(m_pCurLine + m_LineInSize, src_buf, read_size); m_LineInSize += read_size; if (m_LineInSize < m_Pitch) { break; @@ -696,7 +696,7 @@ void CPDF_RunLenFilter::v_FilterIn(const uint8_t* src_buf, FX_DWORD src_size, CF break; case 2: { dest_buf.AppendBlock(NULL, m_Count); - FXSYS_memset8(dest_buf.GetBuffer() + dest_buf.GetSize() - m_Count, byte, m_Count); + FXSYS_memset(dest_buf.GetBuffer() + dest_buf.GetSize() - m_Count, byte, m_Count); m_State = 0; break; } @@ -805,8 +805,8 @@ FX_BOOL CPDF_FaxFilter::Initialize(int Encoding, int bEndOfLine, int bByteAlign, m_Pitch = (m_nColumns + 7) / 8; m_pScanlineBuf = FX_Alloc(uint8_t, m_Pitch); m_pRefBuf = FX_Alloc(uint8_t, m_Pitch); - FXSYS_memset8(m_pScanlineBuf, 0xff, m_Pitch); - FXSYS_memset8(m_pRefBuf, 0xff, m_Pitch); + FXSYS_memset(m_pScanlineBuf, 0xff, m_Pitch); + FXSYS_memset(m_pRefBuf, 0xff, m_Pitch); m_iRow = 0; m_InputBitPos = 0; return TRUE; @@ -851,13 +851,13 @@ void CPDF_FaxFilter::ProcessData(const uint8_t* src_buf, FX_DWORD src_size, int& return; } int start_bitpos = bitpos; - FXSYS_memset8(m_pScanlineBuf, 0xff, m_Pitch); + FXSYS_memset(m_pScanlineBuf, 0xff, m_Pitch); if (!ReadLine(src_buf, bitsize, bitpos)) { bitpos = start_bitpos; return; } if (m_Encoding) { - FXSYS_memcpy32(m_pRefBuf, m_pScanlineBuf, m_Pitch); + FXSYS_memcpy(m_pRefBuf, m_pScanlineBuf, m_Pitch); } if (m_bBlack) { for (int i = 0; i < m_Pitch; i ++) { diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp index 8533859bef..cc2cc6f4ad 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp @@ -122,7 +122,7 @@ int CPDF_Object::GetInteger() const case PDFOBJ_REFERENCE: { CPDF_Reference* pRef = (CPDF_Reference*)(void*)this; PARSE_CONTEXT context; - FXSYS_memset32(&context, 0, sizeof(PARSE_CONTEXT)); + FXSYS_memset(&context, 0, sizeof(PARSE_CONTEXT)); if (pRef->m_pObjList == NULL) { return 0; } @@ -898,7 +898,7 @@ void CPDF_Stream::InitStream(uint8_t* pData, FX_DWORD size, CPDF_Dictionary* pDi m_GenNum = (FX_DWORD) - 1; m_pDataBuf = FX_Alloc(uint8_t, size); if (pData) { - FXSYS_memcpy32(m_pDataBuf, pData, size); + FXSYS_memcpy(m_pDataBuf, pData, size); } m_dwSize = size; if (m_pDict) { @@ -920,7 +920,7 @@ void CPDF_Stream::SetData(const uint8_t* pData, FX_DWORD size, FX_BOOL bCompress } else { m_pDataBuf = FX_Alloc(uint8_t, size); if (pData) { - FXSYS_memcpy32(m_pDataBuf, pData, size); + FXSYS_memcpy(m_pDataBuf, pData, size); } } m_dwSize = size; @@ -939,7 +939,7 @@ FX_BOOL CPDF_Stream::ReadRawData(FX_FILESIZE offset, uint8_t* buf, FX_DWORD size return m_pFile->ReadBlock(buf, m_FileOffset + offset, size); } if (m_pDataBuf) { - FXSYS_memcpy32(buf, m_pDataBuf + offset, size); + FXSYS_memcpy(buf, m_pDataBuf + offset, size); } return TRUE; } @@ -982,7 +982,7 @@ FX_BOOL CPDF_Stream::Identical(CPDF_Stream* pOther) const FX_DWORD actualSize = size > 1024 ? 1024 : size; m_pFile->ReadBlock(srcBuf, srcOffset, actualSize); pOther->m_pFile->ReadBlock(destBuf, destOffset, actualSize); - if (FXSYS_memcmp32(srcBuf, destBuf, actualSize) != 0) { + if (FXSYS_memcmp(srcBuf, destBuf, actualSize) != 0) { return FALSE; } size -= actualSize; @@ -1011,9 +1011,9 @@ FX_BOOL CPDF_Stream::Identical(CPDF_Stream* pOther) const uint8_t srcBuf[1024]; FX_DWORD size = m_dwSize; while (size > 0) { - FX_DWORD actualSize = size > 1024 ? 1024 : size; - m_pFile->ReadBlock(srcBuf, offset, actualSize); - if (FXSYS_memcmp32(srcBuf, pBuf, actualSize) != 0) { + FX_DWORD actualSize = std::min(size, 1024U); + pFile->ReadBlock(srcBuf, offset, actualSize); + if (FXSYS_memcmp(srcBuf, pBuf, actualSize) != 0) { return FALSE; } pBuf += actualSize; @@ -1022,7 +1022,7 @@ FX_BOOL CPDF_Stream::Identical(CPDF_Stream* pOther) const } return TRUE; } - return FXSYS_memcmp32(m_pDataBuf, pOther->m_pDataBuf, m_dwSize) == 0; + return FXSYS_memcmp(m_pDataBuf, pOther->m_pDataBuf, m_dwSize) == 0; } CPDF_Stream* CPDF_Stream::Clone(FX_BOOL bDirect, FPDF_LPFCloneStreamCallback lpfCallback, void* pUserData) const { @@ -1166,7 +1166,7 @@ uint8_t* CPDF_StreamAcc::DetachData() return p; } uint8_t* p = FX_Alloc(uint8_t, m_dwSize); - FXSYS_memcpy32(p, m_pData, m_dwSize); + FXSYS_memcpy(p, m_pData, m_dwSize); return p; } void CPDF_Reference::SetRef(CPDF_IndirectObjects* pDoc, FX_DWORD objnum) @@ -1235,7 +1235,7 @@ int CPDF_IndirectObjects::GetIndirectType(FX_DWORD objnum) } if (m_pParser) { PARSE_CONTEXT context; - FXSYS_memset32(&context, 0, sizeof(PARSE_CONTEXT)); + FXSYS_memset(&context, 0, sizeof(PARSE_CONTEXT)); context.m_Flags = PDFPARSE_TYPEONLY; return (int)(uintptr_t)m_pParser->ParseIndirectObject(this, objnum, &context); } diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp index f4fa8ff499..401fc0d5f4 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp @@ -1028,7 +1028,7 @@ FX_BOOL CPDF_Parser::LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, FX_BOOL m_pTrailer = (CPDF_Dictionary*)pStream->GetDict()->Clone(); m_CrossRef.SetSize(size); if (m_V5Type.SetSize(size)) { - FXSYS_memset32(m_V5Type.GetData(), 0, size); + FXSYS_memset(m_V5Type.GetData(), 0, size); } } else { m_Trailers.Add((CPDF_Dictionary*)pStream->GetDict()->Clone()); @@ -1302,7 +1302,7 @@ void CPDF_Parser::GetIndirectBinary(FX_DWORD objnum, uint8_t*& pBuffer, FX_DWORD size = nextoff - thisoff; } pBuffer = FX_Alloc(uint8_t, size); - FXSYS_memcpy32(pBuffer, pData + thisoff + offset, size); + FXSYS_memcpy(pBuffer, pData + thisoff + offset, size); return; } n --; @@ -2449,7 +2449,7 @@ CPDF_Stream* CPDF_SyntaxParser::ReadStream(CPDF_Dictionary* pDict, PARSE_CONTEXT m_Pos = pos.ValueOrDie(); } GetNextWord(); - if (m_WordSize < 9 || FXSYS_memcmp32(m_WordBuffer, "endstream", 9)) { + if (m_WordSize < 9 || FXSYS_memcmp(m_WordBuffer, "endstream", 9)) { m_Pos = StreamStartPos; FX_FILESIZE offset = FindTag(FX_BSTRC("endstream"), 0); if (offset >= 0) { @@ -2500,7 +2500,7 @@ CPDF_Stream* CPDF_SyntaxParser::ReadStream(CPDF_Dictionary* pDict, PARSE_CONTEXT } StreamStartPos = m_Pos; GetNextWord(); - if (m_WordSize == 6 && 0 == FXSYS_memcmp32(m_WordBuffer, "endobj", 6)) { + if (m_WordSize == 6 && 0 == FXSYS_memcmp(m_WordBuffer, "endobj", 6)) { m_Pos = StreamStartPos; } return pStream; diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp index 61134f5df4..0bb0b51907 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp @@ -198,7 +198,7 @@ FX_BOOL CPDF_SimpleParser::SearchToken(const CFX_ByteStringC& token) { int token_len = token.GetLength(); while (m_dwCurPos < m_dwSize - token_len) { - if (FXSYS_memcmp32(m_pData + m_dwCurPos, token.GetPtr(), token_len) == 0) { + if (FXSYS_memcmp(m_pData + m_dwCurPos, token.GetPtr(), token_len) == 0) { break; } m_dwCurPos ++; diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp index a98c57d86c..10d125a87b 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp @@ -843,7 +843,7 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, m_bStopped = bitmap_render.m_bStopped; if (pSMaskDict) { CFX_AffineMatrix smask_matrix; - FXSYS_memcpy32(&smask_matrix, pGeneralState->m_SMaskMatrix, sizeof smask_matrix); + FXSYS_memcpy(&smask_matrix, pGeneralState->m_SMaskMatrix, sizeof smask_matrix); smask_matrix.Concat(*pObj2Device); CFX_DIBSource* pSMaskSource = LoadSMask(pSMaskDict, &rect, &smask_matrix); if (pSMaskSource) { @@ -1217,7 +1217,7 @@ CPDF_TransferFunc* CPDF_DocRenderData::GetTransferFunc(CPDF_Object* pObj) m_TransferFuncMap.SetAt(pObj, pTransferCounter); static const int kMaxOutputs = 16; FX_FLOAT output[kMaxOutputs]; - FXSYS_memset32(output, 0, sizeof(output)); + FXSYS_memset(output, 0, sizeof(output)); FX_FLOAT input; int noutput; for (int v = 0; v < 256; v ++) { diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp index 669ba4da49..1aa1df15d2 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp @@ -1020,7 +1020,7 @@ CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict, if (!num_floats.IsValid()) { return NULL; } - FXSYS_memset32(pFloats, 0, num_floats.ValueOrDie()); + FXSYS_memset(pFloats, 0, num_floats.ValueOrDie()); int count = pBC->GetCount() > 8 ? 8 : pBC->GetCount(); for (int i = 0; i < count; i ++) { pFloats[i] = pBC->GetNumber(i); @@ -1083,7 +1083,7 @@ CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict, dest_buf[i] = pTransfer[src_buf[i]]; } } else { - FXSYS_memcpy32(dest_buf, src_buf, dest_pitch * height); + FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); } if (pFunc) { delete pFunc; diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp index 5851aabbe0..bbb21e2a64 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp @@ -1102,7 +1102,7 @@ const uint8_t* CPDF_DIBSource::GetScanline(int line) const } if (pSrcLine == NULL) { uint8_t* pLineBuf = m_pMaskedLine ? m_pMaskedLine : m_pLineBuf; - FXSYS_memset8(pLineBuf, 0xff, m_Pitch); + FXSYS_memset(pLineBuf, 0xff, m_Pitch); return pLineBuf; } if (m_bpc * m_nComponents == 1) { @@ -1133,13 +1133,13 @@ const uint8_t* CPDF_DIBSource::GetScanline(int line) const } return m_pMaskedLine; } else { - FXSYS_memcpy32(m_pLineBuf, pSrcLine, src_pitch_value); + FXSYS_memcpy(m_pLineBuf, pSrcLine, src_pitch_value); } return m_pLineBuf; } if (m_bpc * m_nComponents <= 8) { if (m_bpc == 8) { - FXSYS_memcpy32(m_pLineBuf, pSrcLine, src_pitch_value); + FXSYS_memcpy(m_pLineBuf, pSrcLine, src_pitch_value); } else { int src_bit_pos = 0; for (int col = 0; col < m_Width; col ++) { @@ -1183,7 +1183,7 @@ const uint8_t* CPDF_DIBSource::GetScanline(int line) const pPixel[2] < m_pCompData[2].m_ColorKeyMin || pPixel[2] > m_pCompData[2].m_ColorKeyMax) ? 0xff : 0; } } else { - FXSYS_memset8(m_pMaskedLine, 0xff, m_Pitch); + FXSYS_memset(m_pMaskedLine, 0xff, m_Pitch); } } if (m_pColorSpace) { @@ -1243,7 +1243,7 @@ void CPDF_DIBSource::DownSampleScanline(int line, uint8_t* dest_scan, int dest_b int orig_Bpp = m_bpc * m_nComponents / 8; int dest_Bpp = dest_bpp / 8; if (pSrcLine == NULL) { - FXSYS_memset32(dest_scan, 0xff, dest_Bpp * clip_width); + FXSYS_memset(dest_scan, 0xff, dest_Bpp * clip_width); return; } diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp index 2243bff979..8a20b46805 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp @@ -53,7 +53,7 @@ static void _DrawAxialShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2B } CFX_FixedBufGrow<FX_FLOAT, 16> result_array(total_results); FX_FLOAT* pResults = result_array; - FXSYS_memset32(pResults, 0, total_results * sizeof(FX_FLOAT)); + FXSYS_memset(pResults, 0, total_results * sizeof(FX_FLOAT)); FX_DWORD rgb_array[SHADING_STEPS]; for (int i = 0; i < SHADING_STEPS; i ++) { FX_FLOAT input = (t_max - t_min) * i / SHADING_STEPS + t_min; @@ -133,7 +133,7 @@ static void _DrawRadialShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2 } CFX_FixedBufGrow<FX_FLOAT, 16> result_array(total_results); FX_FLOAT* pResults = result_array; - FXSYS_memset32(pResults, 0, total_results * sizeof(FX_FLOAT)); + FXSYS_memset(pResults, 0, total_results * sizeof(FX_FLOAT)); FX_DWORD rgb_array[SHADING_STEPS]; for (int i = 0; i < SHADING_STEPS; i ++) { FX_FLOAT input = (t_max - t_min) * i / SHADING_STEPS + t_min; @@ -254,7 +254,7 @@ static void _DrawFuncShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bi } CFX_FixedBufGrow<FX_FLOAT, 16> result_array(total_results); FX_FLOAT* pResults = result_array; - FXSYS_memset32(pResults, 0, total_results * sizeof(FX_FLOAT)); + FXSYS_memset(pResults, 0, total_results * sizeof(FX_FLOAT)); for (int row = 0; row < height; row ++) { FX_DWORD* dib_buf = (FX_DWORD*)(pBitmap->GetBuffer() + row * pitch); for (int column = 0; column < width; column ++) { @@ -386,7 +386,7 @@ static void _DrawFreeGouraudShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pOb return; } CPDF_MeshVertex triangle[3]; - FXSYS_memset32(triangle, 0, sizeof(triangle)); + FXSYS_memset(triangle, 0, sizeof(triangle)); while (!stream.m_BitStream.IsEOF()) { CPDF_MeshVertex vertex; @@ -568,7 +568,7 @@ static int _BiInterpol(int c0, int c1, int c2, int c3, int x, int y, int x_scale struct Coon_Color { Coon_Color() { - FXSYS_memset32(comp, 0, sizeof(int) * 3); + FXSYS_memset(comp, 0, sizeof(int) * 3); } int comp[3]; void BiInterpol(Coon_Color colors[4], int x, int y, int x_scale, int y_scale) @@ -733,11 +733,11 @@ static void _DrawCoonPatchMeshes(FX_BOOL bTensor, CFX_DIBitmap* pBitmap, CFX_Aff for (i = 0; i < 4; i ++) { tempCoords[i] = coords[(flag * 3 + i) % 12]; } - FXSYS_memcpy32(coords, tempCoords, sizeof(CFX_FloatPoint) * 4); + FXSYS_memcpy(coords, tempCoords, sizeof(CFX_FloatPoint) * 4); Coon_Color tempColors[2]; tempColors[0] = patch.patch_colors[flag]; tempColors[1] = patch.patch_colors[(flag + 1) % 4]; - FXSYS_memcpy32(patch.patch_colors, tempColors, sizeof(Coon_Color) * 2); + FXSYS_memcpy(patch.patch_colors, tempColors, sizeof(Coon_Color) * 2); } for (i = iStartPoint; i < point_count; i ++) { stream.GetCoords(coords[i].x, coords[i].y); |