From 677b8fffb0c76c009ad808ed91a27738e5420254 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 11 Jun 2015 12:05:04 -0700 Subject: 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. --- core/src/fpdfapi/fpdf_render/fpdf_render.cpp | 4 ++-- core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp | 4 ++-- core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp | 10 +++++----- core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp | 14 +++++++------- 4 files changed, 16 insertions(+), 16 deletions(-) (limited to 'core/src/fpdfapi/fpdf_render') 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 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 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 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); -- cgit v1.2.3