summaryrefslogtreecommitdiff
path: root/core/fxcodec
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-04-03 15:05:11 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-03 20:39:56 +0000
commit1c5d0b48ec7a6443ba72fec2a58a65fc6d694aca (patch)
tree315955cce6b29093dcddfc48c0811957a172bedf /core/fxcodec
parent2ae80f52cec81c080515724f99deb06b2fee3cc9 (diff)
downloadpdfium-1c5d0b48ec7a6443ba72fec2a58a65fc6d694aca.tar.xz
Drop FXSYS_ from mem methods
This Cl drops the FXSYS_ from mem methods which are the same on all platforms. Bug: pdfium:694 Change-Id: I9d5ae905997dbaaec5aa0b2ae4c07358ed9c6236 Reviewed-on: https://pdfium-review.googlesource.com/3613 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcodec')
-rw-r--r--core/fxcodec/codec/ccodec_bmpmodule.cpp2
-rw-r--r--core/fxcodec/codec/ccodec_gifmodule.cpp4
-rw-r--r--core/fxcodec/codec/ccodec_pngmodule.cpp10
-rw-r--r--core/fxcodec/codec/ccodec_tiffmodule.cpp8
-rw-r--r--core/fxcodec/codec/fx_codec.cpp10
-rw-r--r--core/fxcodec/codec/fx_codec_fax.cpp16
-rw-r--r--core/fxcodec/codec/fx_codec_flate.cpp25
-rw-r--r--core/fxcodec/codec/fx_codec_jbig.cpp2
-rw-r--r--core/fxcodec/codec/fx_codec_jpeg.cpp9
-rw-r--r--core/fxcodec/codec/fx_codec_jpx_opj.cpp8
-rw-r--r--core/fxcodec/codec/fx_codec_progress.cpp44
-rw-r--r--core/fxcodec/jbig2/JBig2_Define.h6
-rw-r--r--core/fxcodec/lbmp/fx_bmp.cpp41
-rw-r--r--core/fxcodec/lgif/fx_gif.cpp67
14 files changed, 123 insertions, 129 deletions
diff --git a/core/fxcodec/codec/ccodec_bmpmodule.cpp b/core/fxcodec/codec/ccodec_bmpmodule.cpp
index d891a37ee4..660e89c4a0 100644
--- a/core/fxcodec/codec/ccodec_bmpmodule.cpp
+++ b/core/fxcodec/codec/ccodec_bmpmodule.cpp
@@ -56,7 +56,7 @@ FXBMP_Context* CCodec_BmpModule::Start() {
if (!p)
return nullptr;
- FXSYS_memset(p, 0, sizeof(FXBMP_Context));
+ memset(p, 0, sizeof(FXBMP_Context));
if (!p)
return nullptr;
diff --git a/core/fxcodec/codec/ccodec_gifmodule.cpp b/core/fxcodec/codec/ccodec_gifmodule.cpp
index b7352ba53c..caa21e1424 100644
--- a/core/fxcodec/codec/ccodec_gifmodule.cpp
+++ b/core/fxcodec/codec/ccodec_gifmodule.cpp
@@ -88,7 +88,7 @@ FXGIF_Context* CCodec_GifModule::Start() {
if (!p)
return nullptr;
- FXSYS_memset(p, 0, sizeof(FXGIF_Context));
+ memset(p, 0, sizeof(FXGIF_Context));
p->m_AllocFunc = gif_alloc_func;
p->m_FreeFunc = gif_free_func;
p->gif_ptr = nullptr;
@@ -177,7 +177,7 @@ int32_t CCodec_GifModule::LoadFrame(FXGIF_Context* ctx,
buf += size;
size = *buf++;
if (size == 20) {
- FXSYS_memcpy(pAttribute->m_strTime, buf, size);
+ memcpy(pAttribute->m_strTime, buf, size);
}
}
}
diff --git a/core/fxcodec/codec/ccodec_pngmodule.cpp b/core/fxcodec/codec/ccodec_pngmodule.cpp
index 2b8f95799e..ae34b53413 100644
--- a/core/fxcodec/codec/ccodec_pngmodule.cpp
+++ b/core/fxcodec/codec/ccodec_pngmodule.cpp
@@ -55,7 +55,7 @@ static void _png_load_bmp_attribute(png_structp png_ptr,
png_timep t = nullptr;
png_get_tIME(png_ptr, info_ptr, &t);
if (t) {
- FXSYS_memset(pAttribute->m_strTime, 0, sizeof(pAttribute->m_strTime));
+ memset(pAttribute->m_strTime, 0, sizeof(pAttribute->m_strTime));
FXSYS_snprintf((char*)pAttribute->m_strTime,
sizeof(pAttribute->m_strTime), "%4u:%2u:%2u %2u:%2u:%2u",
t->year, t->month, t->day, t->hour, t->minute, t->second);
@@ -73,16 +73,16 @@ static void _png_load_bmp_attribute(png_structp png_ptr,
for (i = 0; i < num_text; i++) {
len = FXSYS_strlen(text[i].key);
buf = "Time";
- if (!FXSYS_memcmp(buf, text[i].key, std::min(len, FXSYS_strlen(buf)))) {
+ if (!memcmp(buf, text[i].key, std::min(len, FXSYS_strlen(buf)))) {
if (!bTime) {
- FXSYS_memset(pAttribute->m_strTime, 0, sizeof(pAttribute->m_strTime));
- FXSYS_memcpy(
+ memset(pAttribute->m_strTime, 0, sizeof(pAttribute->m_strTime));
+ memcpy(
pAttribute->m_strTime, text[i].text,
std::min(sizeof(pAttribute->m_strTime) - 1, text[i].text_length));
}
} else {
buf = "Author";
- if (!FXSYS_memcmp(buf, text[i].key, std::min(len, FXSYS_strlen(buf)))) {
+ if (!memcmp(buf, text[i].key, std::min(len, FXSYS_strlen(buf)))) {
pAttribute->m_strAuthor =
CFX_ByteString(reinterpret_cast<uint8_t*>(text[i].text),
static_cast<FX_STRSIZE>(text[i].text_length));
diff --git a/core/fxcodec/codec/ccodec_tiffmodule.cpp b/core/fxcodec/codec/ccodec_tiffmodule.cpp
index 0a0b56ce94..cc51677abd 100644
--- a/core/fxcodec/codec/ccodec_tiffmodule.cpp
+++ b/core/fxcodec/codec/ccodec_tiffmodule.cpp
@@ -74,15 +74,15 @@ void* _TIFFrealloc(void* ptr, tmsize_t size) {
}
void _TIFFmemset(void* ptr, int val, tmsize_t size) {
- FXSYS_memset(ptr, val, (size_t)size);
+ memset(ptr, val, (size_t)size);
}
void _TIFFmemcpy(void* des, const void* src, tmsize_t size) {
- FXSYS_memcpy(des, src, (size_t)size);
+ memcpy(des, src, (size_t)size);
}
int _TIFFmemcmp(const void* ptr1, const void* ptr2, tmsize_t size) {
- return FXSYS_memcmp(ptr1, ptr2, (size_t)size);
+ return memcmp(ptr1, ptr2, (size_t)size);
}
int _TIFFIfMultiplicationOverflow(tmsize_t op1, tmsize_t op2) {
@@ -199,7 +199,7 @@ void Tiff_Exif_GetStringInfo(TIFF* tif_ctx,
return;
FX_STRSIZE size = FXSYS_strlen(buf);
uint8_t* ptr = FX_Alloc(uint8_t, size + 1);
- FXSYS_memcpy(ptr, buf, size);
+ memcpy(ptr, buf, size);
ptr[size] = 0;
pAttr->m_Exif[tag] = ptr;
}
diff --git a/core/fxcodec/codec/fx_codec.cpp b/core/fxcodec/codec/fx_codec.cpp
index 0d886b43cb..900fed2d87 100644
--- a/core/fxcodec/codec/fx_codec.cpp
+++ b/core/fxcodec/codec/fx_codec.cpp
@@ -254,7 +254,7 @@ CFX_DIBAttribute::CFX_DIBAttribute()
m_pGifLocalPalette(nullptr),
m_nGifLocalPalNum(0),
m_nBmpCompressType(0) {
- FXSYS_memset(m_strTime, 0, sizeof(m_strTime));
+ memset(m_strTime, 0, sizeof(m_strTime));
}
CFX_DIBAttribute::~CFX_DIBAttribute() {
for (const auto& pair : m_Exif)
@@ -361,7 +361,7 @@ bool CCodec_RLScanlineDecoder::Create(const uint8_t* src_buf,
return CheckDestSize();
}
bool CCodec_RLScanlineDecoder::v_Rewind() {
- FXSYS_memset(m_pScanline, 0, m_Pitch);
+ memset(m_pScanline, 0, m_Pitch);
m_SrcOffset = 0;
m_bEOD = false;
m_Operator = 0;
@@ -375,7 +375,7 @@ uint8_t* CCodec_RLScanlineDecoder::v_GetNextLine() {
return nullptr;
}
}
- FXSYS_memset(m_pScanline, 0, m_Pitch);
+ memset(m_pScanline, 0, m_Pitch);
uint32_t col_pos = 0;
bool eol = false;
while (m_SrcOffset < m_SrcSize && !eol) {
@@ -389,7 +389,7 @@ uint8_t* CCodec_RLScanlineDecoder::v_GetNextLine() {
copy_len = m_SrcSize - m_SrcOffset;
m_bEOD = true;
}
- FXSYS_memcpy(m_pScanline + col_pos, m_pSrcBuf + m_SrcOffset, copy_len);
+ memcpy(m_pScanline + col_pos, m_pSrcBuf + m_SrcOffset, copy_len);
col_pos += copy_len;
UpdateOperator((uint8_t)copy_len);
} else if (m_Operator > 128) {
@@ -402,7 +402,7 @@ uint8_t* CCodec_RLScanlineDecoder::v_GetNextLine() {
duplicate_len = m_dwLineBytes - col_pos;
eol = true;
}
- FXSYS_memset(m_pScanline + col_pos, fill, duplicate_len);
+ memset(m_pScanline + col_pos, fill, duplicate_len);
col_pos += duplicate_len;
UpdateOperator((uint8_t)duplicate_len);
} else {
diff --git a/core/fxcodec/codec/fx_codec_fax.cpp b/core/fxcodec/codec/fx_codec_fax.cpp
index 7865da925e..641e0fd9d1 100644
--- a/core/fxcodec/codec/fx_codec_fax.cpp
+++ b/core/fxcodec/codec/fx_codec_fax.cpp
@@ -123,7 +123,7 @@ void FaxFillBits(uint8_t* dest_buf, int columns, int startpos, int endpos) {
dest_buf[last_byte] -= 1 << (7 - i);
if (last_byte > first_byte + 1)
- FXSYS_memset(dest_buf + first_byte + 1, 0, last_byte - first_byte - 1);
+ memset(dest_buf + first_byte + 1, 0, last_byte - first_byte - 1);
}
inline bool NextBit(const uint8_t* src_buf, int* bitpos) {
@@ -502,7 +502,7 @@ CCodec_FaxDecoder::CCodec_FaxDecoder(const uint8_t* src_buf,
CCodec_FaxDecoder::~CCodec_FaxDecoder() {}
bool CCodec_FaxDecoder::v_Rewind() {
- FXSYS_memset(m_RefBuf.data(), 0xff, m_RefBuf.size());
+ memset(m_RefBuf.data(), 0xff, m_RefBuf.size());
m_bitpos = 0;
return true;
}
@@ -513,7 +513,7 @@ uint8_t* CCodec_FaxDecoder::v_GetNextLine() {
if (m_bitpos >= bitsize)
return nullptr;
- FXSYS_memset(m_ScanlineBuf.data(), 0xff, m_ScanlineBuf.size());
+ memset(m_ScanlineBuf.data(), 0xff, m_ScanlineBuf.size());
if (m_Encoding < 0) {
FaxG4GetRow(m_pSrcBuf, bitsize, &m_bitpos, m_ScanlineBuf.data(), m_RefBuf,
m_OrigWidth);
@@ -570,9 +570,9 @@ void FaxG4Decode(const uint8_t* src_buf,
int bitpos = *pbitpos;
for (int iRow = 0; iRow < height; iRow++) {
uint8_t* line_buf = dest_buf + iRow * pitch;
- FXSYS_memset(line_buf, 0xff, pitch);
+ memset(line_buf, 0xff, pitch);
FaxG4GetRow(src_buf, src_size << 3, &bitpos, line_buf, ref_buf, width);
- FXSYS_memcpy(ref_buf.data(), line_buf, pitch);
+ memcpy(ref_buf.data(), line_buf, pitch);
}
*pbitpos = bitpos;
}
@@ -756,7 +756,7 @@ CCodec_FaxEncoder::CCodec_FaxEncoder(const uint8_t* src_buf,
int pitch)
: m_Cols(width), m_Rows(height), m_Pitch(pitch), m_pSrcBuf(src_buf) {
m_RefLine.resize(m_Pitch);
- FXSYS_memset(m_RefLine.data(), 0xff, m_Pitch);
+ memset(m_RefLine.data(), 0xff, m_Pitch);
m_pLineBuf = FX_Alloc2D(uint8_t, m_Pitch, 8);
m_DestBuf.EstimateSize(0, 10240);
}
@@ -772,13 +772,13 @@ void CCodec_FaxEncoder::Encode(
uint8_t last_byte = 0;
for (int i = 0; i < m_Rows; i++) {
const uint8_t* scan_line = m_pSrcBuf + i * m_Pitch;
- FXSYS_memset(m_pLineBuf, 0, m_Pitch * 8);
+ memset(m_pLineBuf, 0, m_Pitch * 8);
m_pLineBuf[0] = last_byte;
FaxEncode2DLine(m_pLineBuf, &dest_bitpos, scan_line, m_RefLine, m_Cols);
m_DestBuf.AppendBlock(m_pLineBuf, dest_bitpos / 8);
last_byte = m_pLineBuf[dest_bitpos / 8];
dest_bitpos %= 8;
- FXSYS_memcpy(m_RefLine.data(), scan_line, m_Pitch);
+ memcpy(m_RefLine.data(), scan_line, m_Pitch);
}
if (dest_bitpos)
m_DestBuf.AppendByte(last_byte);
diff --git a/core/fxcodec/codec/fx_codec_flate.cpp b/core/fxcodec/codec/fx_codec_flate.cpp
index dd9c4c9fa6..2ac316100a 100644
--- a/core/fxcodec/codec/fx_codec_flate.cpp
+++ b/core/fxcodec/codec/fx_codec_flate.cpp
@@ -52,7 +52,7 @@ bool FlateCompress(unsigned char* dest_buf,
void* FlateInit() {
z_stream* p = FX_Alloc(z_stream, 1);
- FXSYS_memset(p, 0, sizeof(z_stream));
+ memset(p, 0, sizeof(z_stream));
p->zalloc = my_alloc_func;
p->zfree = my_free_func;
inflateInit(p);
@@ -80,7 +80,7 @@ uint32_t FlateOutput(void* context,
uint32_t written = post_pos - pre_pos;
if (written < dest_size)
- FXSYS_memset(dest_buf + written, '\0', dest_size - written);
+ memset(dest_buf + written, '\0', dest_size - written);
return ret;
}
@@ -290,7 +290,7 @@ void PNG_PredictLine(uint8_t* pDestData,
int BytesPerPixel = (bpc * nColors + 7) / 8;
uint8_t tag = pSrcData[0];
if (tag == 0) {
- FXSYS_memmove(pDestData, pSrcData + 1, row_size);
+ memmove(pDestData, pSrcData + 1, row_size);
return;
}
for (int byte = 0; byte < row_size; byte++) {
@@ -372,7 +372,7 @@ bool PNG_Predictor(uint8_t*& data_buf,
if ((row + 1) * (move_size + 1) > (int)data_size) {
move_size = last_row_size - 1;
}
- FXSYS_memmove(pDestData, pSrcData + 1, move_size);
+ memmove(pDestData, pSrcData + 1, move_size);
pSrcData += move_size + 1;
pDestData += move_size;
byte_cnt += move_size;
@@ -603,7 +603,7 @@ void FlateUncompress(const uint8_t* src_buf,
tmp_buf_size = last_buf_size;
uint32_t cp_size = std::min(tmp_buf_size, remaining);
- FXSYS_memcpy(result_buf + result_pos, tmp_buf, cp_size);
+ memcpy(result_buf + result_pos, tmp_buf, cp_size);
result_pos += cp_size;
remaining -= cp_size;
@@ -736,7 +736,7 @@ uint8_t* CCodec_FlateScanlineDecoder::v_GetNextLine() {
FlateOutput(m_pFlate, m_pPredictRaw, m_PredictPitch + 1);
PNG_PredictLine(m_pScanline, m_pPredictRaw, m_pLastLine,
m_BitsPerComponent, m_Colors, m_Columns);
- FXSYS_memcpy(m_pLastLine, m_pScanline, m_PredictPitch);
+ memcpy(m_pLastLine, m_pScanline, m_PredictPitch);
} else {
FlateOutput(m_pFlate, m_pScanline, m_Pitch);
TIFF_PredictLine(m_pScanline, m_PredictPitch, m_bpc, m_nComps,
@@ -747,9 +747,8 @@ uint8_t* CCodec_FlateScanlineDecoder::v_GetNextLine() {
size_t read_leftover =
m_LeftOver > bytes_to_go ? bytes_to_go : m_LeftOver;
if (read_leftover) {
- FXSYS_memcpy(m_pScanline,
- m_pPredictBuffer + m_PredictPitch - m_LeftOver,
- read_leftover);
+ memcpy(m_pScanline, m_pPredictBuffer + m_PredictPitch - m_LeftOver,
+ read_leftover);
m_LeftOver -= read_leftover;
bytes_to_go -= read_leftover;
}
@@ -758,7 +757,7 @@ uint8_t* CCodec_FlateScanlineDecoder::v_GetNextLine() {
FlateOutput(m_pFlate, m_pPredictRaw, m_PredictPitch + 1);
PNG_PredictLine(m_pPredictBuffer, m_pPredictRaw, m_pLastLine,
m_BitsPerComponent, m_Colors, m_Columns);
- FXSYS_memcpy(m_pLastLine, m_pPredictBuffer, m_PredictPitch);
+ memcpy(m_pLastLine, m_pPredictBuffer, m_PredictPitch);
} else {
FlateOutput(m_pFlate, m_pPredictBuffer, m_PredictPitch);
TIFF_PredictLine(m_pPredictBuffer, m_PredictPitch, m_BitsPerComponent,
@@ -766,8 +765,8 @@ uint8_t* CCodec_FlateScanlineDecoder::v_GetNextLine() {
}
size_t read_bytes =
m_PredictPitch > bytes_to_go ? bytes_to_go : m_PredictPitch;
- FXSYS_memcpy(m_pScanline + m_Pitch - bytes_to_go, m_pPredictBuffer,
- read_bytes);
+ memcpy(m_pScanline + m_Pitch - bytes_to_go, m_pPredictBuffer,
+ read_bytes);
m_LeftOver += m_PredictPitch - read_bytes;
bytes_to_go -= read_bytes;
}
@@ -873,7 +872,7 @@ bool CCodec_FlateModule::PngEncode(const uint8_t* src_buf,
uint8_t** dest_buf,
uint32_t* dest_size) {
uint8_t* pSrcBuf = FX_Alloc(uint8_t, src_size);
- FXSYS_memcpy(pSrcBuf, src_buf, src_size);
+ memcpy(pSrcBuf, src_buf, src_size);
PNG_PredictorEncode(&pSrcBuf, &src_size);
bool ret = Encode(pSrcBuf, src_size, dest_buf, dest_size);
FX_Free(pSrcBuf);
diff --git a/core/fxcodec/codec/fx_codec_jbig.cpp b/core/fxcodec/codec/fx_codec_jbig.cpp
index 926541f07d..dc82305616 100644
--- a/core/fxcodec/codec/fx_codec_jbig.cpp
+++ b/core/fxcodec/codec/fx_codec_jbig.cpp
@@ -62,7 +62,7 @@ FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(
pJbig2Context->m_dest_buf = dest_buf;
pJbig2Context->m_dest_pitch = dest_pitch;
pJbig2Context->m_pPause = pPause;
- FXSYS_memset(dest_buf, 0, height * dest_pitch);
+ memset(dest_buf, 0, height * dest_pitch);
pJbig2Context->m_pContext = pdfium::MakeUnique<CJBig2_Context>(
global_stream, src_stream, pJBig2DocumentContext->GetSymbolDictCache(),
pPause, false);
diff --git a/core/fxcodec/codec/fx_codec_jpeg.cpp b/core/fxcodec/codec/fx_codec_jpeg.cpp
index 0431560529..584148d148 100644
--- a/core/fxcodec/codec/fx_codec_jpeg.cpp
+++ b/core/fxcodec/codec/fx_codec_jpeg.cpp
@@ -185,9 +185,9 @@ CCodec_JpegDecoder::CCodec_JpegDecoder() {
m_pScanlineBuf = nullptr;
m_bStarted = false;
m_bInited = false;
- FXSYS_memset(&cinfo, 0, sizeof(cinfo));
- FXSYS_memset(&jerr, 0, sizeof(jerr));
- FXSYS_memset(&src, 0, sizeof(src));
+ memset(&cinfo, 0, sizeof(cinfo));
+ memset(&jerr, 0, sizeof(jerr));
+ memset(&src, 0, sizeof(src));
m_nDefaultScaleDenom = 1;
}
@@ -253,8 +253,7 @@ bool CCodec_JpegDecoder::Create(const uint8_t* src_buf,
src.fill_input_buffer = _src_fill_buffer;
src.resync_to_restart = _src_resync;
m_bJpegTransform = ColorTransform;
- if (src_size > 1 &&
- FXSYS_memcmp(src_buf + src_size - 2, "\xFF\xD9", 2) != 0) {
+ if (src_size > 1 && memcmp(src_buf + src_size - 2, "\xFF\xD9", 2) != 0) {
((uint8_t*)src_buf)[src_size - 2] = 0xFF;
((uint8_t*)src_buf)[src_size - 1] = 0xD9;
}
diff --git a/core/fxcodec/codec/fx_codec_jpx_opj.cpp b/core/fxcodec/codec/fx_codec_jpx_opj.cpp
index 4fc3d689f1..30e79deeeb 100644
--- a/core/fxcodec/codec/fx_codec_jpx_opj.cpp
+++ b/core/fxcodec/codec/fx_codec_jpx_opj.cpp
@@ -564,9 +564,9 @@ void color_apply_icc_profile(opj_image_t* image) {
image->comps[1] = image->comps[0];
image->comps[2] = image->comps[0];
image->comps[1].data = FX_Alloc(int, (size_t)max);
- FXSYS_memset(image->comps[1].data, 0, sizeof(int) * (size_t)max);
+ memset(image->comps[1].data, 0, sizeof(int) * (size_t)max);
image->comps[2].data = FX_Alloc(int, (size_t)max);
- FXSYS_memset(image->comps[2].data, 0, sizeof(int) * (size_t)max);
+ memset(image->comps[2].data, 0, sizeof(int) * (size_t)max);
image->numcomps += 2;
r = image->comps[0].data;
for (int i = 0; i < max; ++i) {
@@ -707,7 +707,7 @@ bool CJPX_Decoder::Init(const unsigned char* src_data, uint32_t src_size) {
opj_set_default_decoder_parameters(&parameters);
parameters.decod_format = 0;
parameters.cod_format = 3;
- if (FXSYS_memcmp(m_SrcData, szJP2Header, sizeof(szJP2Header)) == 0) {
+ if (memcmp(m_SrcData, szJP2Header, sizeof(szJP2Header)) == 0) {
l_codec = opj_create_decompress(OPJ_CODEC_JP2);
parameters.decod_format = 1;
} else {
@@ -788,7 +788,7 @@ bool CJPX_Decoder::Decode(uint8_t* dest_buf,
if (pitch<(int)(image->comps[0].w * 8 * image->numcomps + 31)>> 5 << 2)
return false;
- FXSYS_memset(dest_buf, 0xff, image->y1 * pitch);
+ memset(dest_buf, 0xff, image->y1 * pitch);
std::vector<uint8_t*> channel_bufs(image->numcomps);
std::vector<int> adjust_comps(image->numcomps);
for (uint32_t i = 0; i < image->numcomps; i++) {
diff --git a/core/fxcodec/codec/fx_codec_progress.cpp b/core/fxcodec/codec/fx_codec_progress.cpp
index e06c592cdc..d8b123b254 100644
--- a/core/fxcodec/codec/fx_codec_progress.cpp
+++ b/core/fxcodec/codec/fx_codec_progress.cpp
@@ -331,7 +331,7 @@ bool CCodec_ProgressiveDecoder::JpegReadMoreData(CCodec_JpegModule* pJpegModule,
} else {
uint32_t dwConsume = m_SrcSize - dwAvail;
if (dwAvail) {
- FXSYS_memmove(m_pSrcBuf, m_pSrcBuf + dwConsume, dwAvail);
+ memmove(m_pSrcBuf, m_pSrcBuf + dwConsume, dwAvail);
}
if (dwSize > dwConsume) {
dwSize = dwConsume;
@@ -593,7 +593,7 @@ bool CCodec_ProgressiveDecoder::GifReadMoreData(ICodec_GifModule* pGifModule,
} else {
uint32_t dwConsume = m_SrcSize - dwAvail;
if (dwAvail) {
- FXSYS_memmove(m_pSrcBuf, m_pSrcBuf + dwConsume, dwAvail);
+ memmove(m_pSrcBuf, m_pSrcBuf + dwConsume, dwAvail);
}
if (dwSize > dwConsume) {
dwSize = dwConsume;
@@ -682,7 +682,7 @@ bool CCodec_ProgressiveDecoder::GifInputRecordPositionBuf(
case 3: {
uint8_t gray =
FXRGB2GRAY(FXARGB_R(argb), FXARGB_G(argb), FXARGB_B(argb));
- FXSYS_memset(pScanline, gray, sizeX);
+ memset(pScanline, gray, sizeX);
break;
}
case 8: {
@@ -724,11 +724,11 @@ void CCodec_ProgressiveDecoder::GifReadScanline(int32_t row_num,
if (m_GifTransIndex != -1 && m_pDeviceBitmap->HasAlpha()) {
pal_index = m_GifTransIndex;
}
- FXSYS_memset(m_pDecodeBuf, pal_index, m_SrcWidth);
+ memset(m_pDecodeBuf, pal_index, m_SrcWidth);
bool bLastPass = (row_num % 2) == 1;
int32_t line = row_num + m_GifFrameRect.top;
int32_t left = m_GifFrameRect.left;
- FXSYS_memcpy(m_pDecodeBuf + left, row_buf, img_width);
+ memcpy(m_pDecodeBuf + left, row_buf, img_width);
int src_top = m_clipBox.top;
int src_bottom = m_clipBox.bottom;
int des_top = m_startY;
@@ -762,7 +762,7 @@ void CCodec_ProgressiveDecoder::GifReadScanline(int32_t row_num,
uint8_t* scan_des =
(uint8_t*)pDIBitmap->GetScanline(cur_row) + des_ScanOffet;
uint32_t size = m_sizeX * des_Bpp;
- FXSYS_memmove(scan_des, scan_src, size);
+ memmove(scan_des, scan_src, size);
}
}
if (bLastPass)
@@ -872,7 +872,7 @@ bool CCodec_ProgressiveDecoder::BmpReadMoreData(ICodec_BmpModule* pBmpModule,
} else {
uint32_t dwConsume = m_SrcSize - dwAvail;
if (dwAvail) {
- FXSYS_memmove(m_pSrcBuf, m_pSrcBuf + dwConsume, dwAvail);
+ memmove(m_pSrcBuf, m_pSrcBuf + dwConsume, dwAvail);
}
if (dwSize > dwConsume) {
dwSize = dwConsume;
@@ -897,7 +897,7 @@ void CCodec_ProgressiveDecoder::BmpReadScanline(int32_t row_num,
uint8_t* row_buf) {
CFX_RetainPtr<CFX_DIBitmap> pDIBitmap = m_pDeviceBitmap;
ASSERT(pDIBitmap);
- FXSYS_memcpy(m_pDecodeBuf, row_buf, m_ScanlineSize);
+ memcpy(m_pDecodeBuf, row_buf, m_ScanlineSize);
int src_top = m_clipBox.top;
int src_bottom = m_clipBox.bottom;
int des_top = m_startY;
@@ -941,7 +941,7 @@ void CCodec_ProgressiveDecoder::ResampleVertBT(
uint8_t* scan_des =
(uint8_t*)pDeviceBitmap->GetScanline(des_row) + des_ScanOffet;
uint32_t size = m_sizeX * des_Bpp;
- FXSYS_memmove(scan_des, scan_src, size);
+ memmove(scan_des, scan_src, size);
}
return;
}
@@ -1017,7 +1017,7 @@ bool CCodec_ProgressiveDecoder::DetectImageType(FXCODEC_IMAGE_TYPE imageType,
}
FX_Free(m_pSrcBuf);
m_pSrcBuf = FX_Alloc(uint8_t, size);
- FXSYS_memset(m_pSrcBuf, 0, size);
+ memset(m_pSrcBuf, 0, size);
m_SrcSize = size;
switch (imageType) {
case FXCODEC_IMAGE_BMP: {
@@ -1059,8 +1059,8 @@ bool CCodec_ProgressiveDecoder::DetectImageType(FXCODEC_IMAGE_TYPE imageType,
FX_Free(m_pSrcPalette);
if (m_SrcPaletteNumber) {
m_pSrcPalette = FX_Alloc(FX_ARGB, m_SrcPaletteNumber);
- FXSYS_memcpy(m_pSrcPalette, pPalette,
- m_SrcPaletteNumber * sizeof(uint32_t));
+ memcpy(m_pSrcPalette, pPalette,
+ m_SrcPaletteNumber * sizeof(uint32_t));
} else {
m_pSrcPalette = nullptr;
}
@@ -1150,7 +1150,7 @@ bool CCodec_ProgressiveDecoder::DetectImageType(FXCODEC_IMAGE_TYPE imageType,
if (m_pSrcBuf && input_size > m_SrcSize) {
FX_Free(m_pSrcBuf);
m_pSrcBuf = FX_Alloc(uint8_t, input_size);
- FXSYS_memset(m_pSrcBuf, 0, input_size);
+ memset(m_pSrcBuf, 0, input_size);
m_SrcSize = input_size;
}
bResult = m_pFile->ReadBlock(m_pSrcBuf, m_offSet, input_size);
@@ -1531,7 +1531,7 @@ void CCodec_ProgressiveDecoder::ReSampleScanline(
pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
des_g += pixel_weight * src_scan[j];
}
- FXSYS_memset(des_scan, (uint8_t)(des_g >> 16), 3);
+ memset(des_scan, (uint8_t)(des_g >> 16), 3);
des_scan += des_Bpp;
} break;
case 8: {
@@ -1664,7 +1664,7 @@ void CCodec_ProgressiveDecoder::ResampleVert(
uint8_t* scan_des =
(uint8_t*)pDeviceBitmap->GetScanline(des_row) + des_ScanOffet;
uint32_t size = m_sizeX * des_Bpp;
- FXSYS_memmove(scan_des, scan_src, size);
+ memmove(scan_des, scan_src, size);
}
}
return;
@@ -1739,7 +1739,7 @@ void CCodec_ProgressiveDecoder::ResampleVert(
uint8_t* scan_des =
(uint8_t*)pDeviceBitmap->GetScanline(des_row) + des_ScanOffet;
uint32_t size = m_sizeX * des_Bpp;
- FXSYS_memmove(scan_des, scan_src, size);
+ memmove(scan_des, scan_src, size);
}
}
return;
@@ -1755,7 +1755,7 @@ void CCodec_ProgressiveDecoder::ResampleVert(
uint8_t* scan_des =
(uint8_t*)pDeviceBitmap->GetScanline(des_row + i) + des_ScanOffet;
uint32_t size = m_sizeX * des_Bpp;
- FXSYS_memmove(scan_des, scan_src, size);
+ memmove(scan_des, scan_src, size);
}
}
}
@@ -1912,7 +1912,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::StartDecode(
scanline_size = (scanline_size * m_SrcComponents + 3) / 4 * 4;
FX_Free(m_pDecodeBuf);
m_pDecodeBuf = FX_Alloc(uint8_t, scanline_size);
- FXSYS_memset(m_pDecodeBuf, 0, scanline_size);
+ memset(m_pDecodeBuf, 0, scanline_size);
m_WeightHorz.Calc(m_sizeX, 0, m_sizeX, m_clipBox.Width(), 0,
m_clipBox.Width(), m_bInterpol);
m_WeightVert.Calc(m_sizeY, m_clipBox.Height());
@@ -1977,7 +1977,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::StartDecode(
int scanline_size = (m_SrcWidth * m_SrcComponents + 3) / 4 * 4;
FX_Free(m_pDecodeBuf);
m_pDecodeBuf = FX_Alloc(uint8_t, scanline_size);
- FXSYS_memset(m_pDecodeBuf, 0, scanline_size);
+ memset(m_pDecodeBuf, 0, scanline_size);
m_WeightHorzOO.Calc(m_sizeX, m_clipBox.Width(), m_bInterpol);
m_WeightVert.Calc(m_sizeY, m_clipBox.Height());
m_status = FXCODEC_STATUS_DECODE_TOBECONTINUE;
@@ -1996,7 +1996,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::StartDecode(
int scanline_size = (m_SrcWidth + 3) / 4 * 4;
FX_Free(m_pDecodeBuf);
m_pDecodeBuf = FX_Alloc(uint8_t, scanline_size);
- FXSYS_memset(m_pDecodeBuf, 0, scanline_size);
+ memset(m_pDecodeBuf, 0, scanline_size);
m_WeightHorz.Calc(m_sizeX, 0, m_sizeX, m_clipBox.Width(), 0,
m_clipBox.Width(), m_bInterpol);
m_WeightVert.Calc(m_sizeY, m_clipBox.Height());
@@ -2027,7 +2027,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::StartDecode(
m_ScanlineSize = (m_SrcWidth * m_SrcComponents + 3) / 4 * 4;
FX_Free(m_pDecodeBuf);
m_pDecodeBuf = FX_Alloc(uint8_t, m_ScanlineSize);
- FXSYS_memset(m_pDecodeBuf, 0, m_ScanlineSize);
+ memset(m_pDecodeBuf, 0, m_ScanlineSize);
m_WeightHorz.Calc(m_sizeX, 0, m_sizeX, m_clipBox.Width(), 0,
m_clipBox.Width(), m_bInterpol);
m_WeightVert.Calc(m_sizeY, m_clipBox.Height());
@@ -2102,7 +2102,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::ContinueDecode(IFX_Pause* pPause) {
if (m_pSrcBuf && input_size > m_SrcSize) {
FX_Free(m_pSrcBuf);
m_pSrcBuf = FX_Alloc(uint8_t, input_size);
- FXSYS_memset(m_pSrcBuf, 0, input_size);
+ memset(m_pSrcBuf, 0, input_size);
m_SrcSize = input_size;
}
bool bResult = m_pFile->ReadBlock(m_pSrcBuf, m_offSet, input_size);
diff --git a/core/fxcodec/jbig2/JBig2_Define.h b/core/fxcodec/jbig2/JBig2_Define.h
index 86df248786..2934de4e9b 100644
--- a/core/fxcodec/jbig2/JBig2_Define.h
+++ b/core/fxcodec/jbig2/JBig2_Define.h
@@ -9,9 +9,9 @@
#include "core/fxcrt/fx_system.h"
-#define JBIG2_memset FXSYS_memset
-#define JBIG2_memcmp FXSYS_memcmp
-#define JBIG2_memcpy FXSYS_memcpy
+#define JBIG2_memset memset
+#define JBIG2_memcmp memcmp
+#define JBIG2_memcpy memcpy
#define JBIG2_OOB 1
struct JBig2RegionInfo {
diff --git a/core/fxcodec/lbmp/fx_bmp.cpp b/core/fxcodec/lbmp/fx_bmp.cpp
index 73a62d4192..e4fa17dc89 100644
--- a/core/fxcodec/lbmp/fx_bmp.cpp
+++ b/core/fxcodec/lbmp/fx_bmp.cpp
@@ -47,7 +47,7 @@ void bmp_error(bmp_decompress_struct_p bmp_ptr, const char* err_msg) {
}
bmp_decompress_struct_p bmp_create_decompress() {
bmp_decompress_struct_p bmp_ptr = FX_Alloc(bmp_decompress_struct, 1);
- FXSYS_memset(bmp_ptr, 0, sizeof(bmp_decompress_struct));
+ memset(bmp_ptr, 0, sizeof(bmp_decompress_struct));
bmp_ptr->decode_status = BMP_D_STATUS_HEADER;
bmp_ptr->bmp_header_ptr = FX_Alloc(BmpFileHeader, 1);
return bmp_ptr;
@@ -233,7 +233,7 @@ int32_t bmp_read_header(bmp_decompress_struct_p bmp_ptr) {
}
bmp_ptr->out_row_buffer = FX_Alloc(uint8_t, bmp_ptr->out_row_bytes);
- FXSYS_memset(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);
+ memset(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);
bmp_save_decoding_status(bmp_ptr, BMP_D_STATUS_PAL);
}
if (bmp_ptr->decode_status == BMP_D_STATUS_PAL) {
@@ -388,7 +388,7 @@ int32_t bmp_decode_rgb(bmp_decompress_struct_p bmp_ptr) {
case 8:
case 24:
case 32:
- FXSYS_memcpy(bmp_ptr->out_row_buffer, des_buf, bmp_ptr->src_row_bytes);
+ memcpy(bmp_ptr->out_row_buffer, des_buf, bmp_ptr->src_row_bytes);
break;
}
row_buf = bmp_ptr->out_row_buffer;
@@ -429,7 +429,7 @@ int32_t bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr) {
: (bmp_ptr->height - 1 - bmp_ptr->row_num++),
bmp_ptr->out_row_buffer);
bmp_ptr->col_num = 0;
- FXSYS_memset(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);
+ memset(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);
bmp_save_decoding_status(bmp_ptr, BMP_D_STATUS_DATA);
continue;
}
@@ -458,7 +458,7 @@ int32_t bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr) {
return 0;
}
while (bmp_ptr->row_num < bmp_row_num_next) {
- FXSYS_memset(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);
+ memset(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);
bmp_ptr->bmp_get_row_fn(
bmp_ptr, bmp_ptr->imgTB_flag
? bmp_ptr->row_num++
@@ -479,8 +479,8 @@ int32_t bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr) {
bmp_ptr->skip_size = skip_size_org;
return 2;
}
- FXSYS_memcpy(bmp_ptr->out_row_buffer + bmp_ptr->col_num,
- second_byte_ptr, *first_byte_ptr);
+ memcpy(bmp_ptr->out_row_buffer + bmp_ptr->col_num, second_byte_ptr,
+ *first_byte_ptr);
bmp_ptr->col_num += (int32_t)(*first_byte_ptr);
}
}
@@ -495,8 +495,8 @@ int32_t bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr) {
bmp_ptr->skip_size = skip_size_org;
return 2;
}
- FXSYS_memset(bmp_ptr->out_row_buffer + bmp_ptr->col_num,
- *second_byte_ptr, *first_byte_ptr);
+ memset(bmp_ptr->out_row_buffer + bmp_ptr->col_num, *second_byte_ptr,
+ *first_byte_ptr);
bmp_ptr->col_num += (int32_t)(*first_byte_ptr);
}
}
@@ -533,7 +533,7 @@ int32_t bmp_decode_rle4(bmp_decompress_struct_p bmp_ptr) {
: (bmp_ptr->height - 1 - bmp_ptr->row_num++),
bmp_ptr->out_row_buffer);
bmp_ptr->col_num = 0;
- FXSYS_memset(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);
+ memset(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);
bmp_save_decoding_status(bmp_ptr, BMP_D_STATUS_DATA);
continue;
}
@@ -562,7 +562,7 @@ int32_t bmp_decode_rle4(bmp_decompress_struct_p bmp_ptr) {
return 0;
}
while (bmp_ptr->row_num < bmp_row_num_next) {
- FXSYS_memset(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);
+ memset(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);
bmp_ptr->bmp_get_row_fn(
bmp_ptr, bmp_ptr->imgTB_flag
? bmp_ptr->row_num++
@@ -669,7 +669,7 @@ bmp_compress_struct_p bmp_create_compress() {
bmp_compress_struct_p bmp_ptr;
bmp_ptr = FX_Alloc(bmp_compress_struct, 1);
if (bmp_ptr) {
- FXSYS_memset(bmp_ptr, 0, sizeof(bmp_compress_struct));
+ memset(bmp_ptr, 0, sizeof(bmp_compress_struct));
}
return bmp_ptr;
}
@@ -734,7 +734,7 @@ static void bmp_encode_bitfields(bmp_compress_struct_p bmp_ptr,
dst_pos = bmp_ptr->file_header.bfOffBits;
dst_size += size;
dst_buf = FX_Realloc(uint8_t, dst_buf, dst_size);
- FXSYS_memset(&dst_buf[dst_pos], 0, size);
+ memset(&dst_buf[dst_pos], 0, size);
uint32_t mask_red;
uint32_t mask_green;
uint32_t mask_blue;
@@ -818,11 +818,10 @@ static void bmp_encode_rgb(bmp_compress_struct_p bmp_ptr,
dst_pos = bmp_ptr->file_header.bfOffBits;
dst_size += size;
dst_buf = FX_Realloc(uint8_t, dst_buf, dst_size);
- FXSYS_memset(&dst_buf[dst_pos], 0, size);
+ memset(&dst_buf[dst_pos], 0, size);
for (int32_t row_num = bmp_ptr->src_row - 1; row_num > -1; row_num--) {
- FXSYS_memcpy(&dst_buf[dst_pos],
- &bmp_ptr->src_buf[row_num * bmp_ptr->src_pitch],
- bmp_ptr->src_pitch);
+ memcpy(&dst_buf[dst_pos], &bmp_ptr->src_buf[row_num * bmp_ptr->src_pitch],
+ bmp_ptr->src_pitch);
dst_pos += dst_pitch;
}
dst_size = dst_pos;
@@ -847,7 +846,7 @@ static void bmp_encode_rle8(bmp_compress_struct_p bmp_ptr,
dst_pos = bmp_ptr->file_header.bfOffBits;
dst_size += size;
dst_buf = FX_Realloc(uint8_t, dst_buf, dst_size);
- FXSYS_memset(&dst_buf[dst_pos], 0, size);
+ memset(&dst_buf[dst_pos], 0, size);
for (int32_t row_num = bmp_ptr->src_row - 1, i = 0; row_num > -1;) {
index = row_num * bmp_ptr->src_pitch;
rle[0] = bmp_rle8_search(&bmp_ptr->src_buf[index + i], size - index - i);
@@ -892,7 +891,7 @@ static void bmp_encode_rle4(bmp_compress_struct_p bmp_ptr,
dst_pos = bmp_ptr->file_header.bfOffBits;
dst_size += size;
dst_buf = FX_Realloc(uint8_t, dst_buf, dst_size);
- FXSYS_memset(&dst_buf[dst_pos], 0, size);
+ memset(&dst_buf[dst_pos], 0, size);
for (int32_t row_num = bmp_ptr->src_row - 1, i = 0; row_num > -1;
rle[1] = 0) {
index = row_num * bmp_ptr->src_pitch;
@@ -933,10 +932,10 @@ bool bmp_encode_image(bmp_compress_struct_p bmp_ptr,
if (!dst_buf)
return false;
- FXSYS_memset(dst_buf, 0, dst_size);
+ memset(dst_buf, 0, dst_size);
bmp_ptr->file_header.bfOffBits = head_size;
if (bmp_ptr->pal_ptr && pal_size) {
- FXSYS_memcpy(&dst_buf[head_size], bmp_ptr->pal_ptr, pal_size);
+ memcpy(&dst_buf[head_size], bmp_ptr->pal_ptr, pal_size);
bmp_ptr->file_header.bfOffBits += pal_size;
}
WriteInfoHeader(&bmp_ptr->info_header, dst_buf);
diff --git a/core/fxcodec/lgif/fx_gif.cpp b/core/fxcodec/lgif/fx_gif.cpp
index 52cb81bcab..3d5d0e2325 100644
--- a/core/fxcodec/lgif/fx_gif.cpp
+++ b/core/fxcodec/lgif/fx_gif.cpp
@@ -52,8 +52,8 @@ void CGifLZWDecoder::ClearTable() {
code_size_cur = code_size + 1;
code_next = code_end + 1;
code_old = (uint16_t)-1;
- FXSYS_memset(code_table, 0, sizeof(tag_Table) * GIF_MAX_LZW_CODE);
- FXSYS_memset(stack, 0, GIF_MAX_LZW_CODE);
+ memset(code_table, 0, sizeof(tag_Table) * GIF_MAX_LZW_CODE);
+ memset(stack, 0, GIF_MAX_LZW_CODE);
for (uint16_t i = 0; i < code_clear; i++) {
code_table[i].suffix = (uint8_t)i;
}
@@ -90,11 +90,11 @@ int32_t CGifLZWDecoder::Decode(uint8_t* des_buf, uint32_t& des_size) {
uint32_t i = 0;
if (stack_size != 0) {
if (des_size < stack_size) {
- FXSYS_memcpy(des_buf, &stack[GIF_MAX_LZW_CODE - stack_size], des_size);
+ memcpy(des_buf, &stack[GIF_MAX_LZW_CODE - stack_size], des_size);
stack_size -= (uint16_t)des_size;
return 3;
}
- FXSYS_memcpy(des_buf, &stack[GIF_MAX_LZW_CODE - stack_size], stack_size);
+ memcpy(des_buf, &stack[GIF_MAX_LZW_CODE - stack_size], stack_size);
des_buf += stack_size;
i += stack_size;
stack_size = 0;
@@ -161,13 +161,11 @@ int32_t CGifLZWDecoder::Decode(uint8_t* des_buf, uint32_t& des_size) {
}
code_old = code;
if (i + stack_size > des_size) {
- FXSYS_memcpy(des_buf, &stack[GIF_MAX_LZW_CODE - stack_size],
- des_size - i);
+ memcpy(des_buf, &stack[GIF_MAX_LZW_CODE - stack_size], des_size - i);
stack_size -= (uint16_t)(des_size - i);
return 3;
}
- FXSYS_memcpy(des_buf, &stack[GIF_MAX_LZW_CODE - stack_size],
- stack_size);
+ memcpy(des_buf, &stack[GIF_MAX_LZW_CODE - stack_size], stack_size);
des_buf += stack_size;
i += stack_size;
stack_size = 0;
@@ -192,7 +190,7 @@ static bool gif_grow_buf(uint8_t*& dst_buf, uint32_t& dst_len, uint32_t size) {
dst_len = size;
dst_buf = FX_Realloc(uint8_t, dst_buf, dst_len);
}
- FXSYS_memset(dst_buf + len_org, 0, dst_len - len_org);
+ memset(dst_buf + len_org, 0, dst_len - len_org);
return !!dst_buf;
}
return true;
@@ -229,7 +227,7 @@ static inline uint8_t gif_cut_buf(const uint8_t* buf,
return buf[offset++];
}
CGifLZWEncoder::CGifLZWEncoder() {
- FXSYS_memset(this, 0, sizeof(CGifLZWEncoder));
+ memset(this, 0, sizeof(CGifLZWEncoder));
}
CGifLZWEncoder::~CGifLZWEncoder() {}
void CGifLZWEncoder::ClearTable() {
@@ -272,9 +270,9 @@ void CGifLZWEncoder::WriteBlock(uint8_t*& dst_buf,
longjmp(jmp, 1);
}
dst_buf[offset++] = index_buf_len;
- FXSYS_memcpy(&dst_buf[offset], index_buf, index_buf_len);
+ memcpy(&dst_buf[offset], index_buf, index_buf_len);
offset += index_buf_len;
- FXSYS_memset(index_buf, 0, GIF_DATA_BLOCK);
+ memset(index_buf, 0, GIF_DATA_BLOCK);
index_buf_len = 0;
}
void CGifLZWEncoder::EncodeString(uint32_t index,
@@ -391,7 +389,7 @@ void CGifLZWEncoder::Finish(uint8_t*& dst_buf,
}
gif_decompress_struct_p gif_create_decompress() {
gif_decompress_struct_p gif_ptr = FX_Alloc(gif_decompress_struct, 1);
- FXSYS_memset(gif_ptr, 0, sizeof(gif_decompress_struct));
+ memset(gif_ptr, 0, sizeof(gif_decompress_struct));
gif_ptr->decode_status = GIF_D_STATUS_SIG;
gif_ptr->img_ptr_arr_ptr = new std::vector<GifImage*>;
gif_ptr->cmt_data_ptr = new CFX_ByteString;
@@ -439,7 +437,7 @@ void gif_destroy_decompress(gif_decompress_struct_pp gif_ptr_ptr) {
}
gif_compress_struct_p gif_create_compress() {
gif_compress_struct_p gif_ptr = FX_Alloc(gif_compress_struct, 1);
- FXSYS_memset(gif_ptr, 0, sizeof(gif_compress_struct));
+ memset(gif_ptr, 0, sizeof(gif_compress_struct));
gif_ptr->img_encoder_ptr = new CGifLZWEncoder;
gif_ptr->header_ptr = FX_Alloc(GifHeader, 1);
if (!gif_ptr->header_ptr) {
@@ -447,8 +445,8 @@ gif_compress_struct_p gif_create_compress() {
FX_Free(gif_ptr);
return nullptr;
}
- FXSYS_memcpy(gif_ptr->header_ptr->signature, GIF_SIGNATURE, 3);
- FXSYS_memcpy(gif_ptr->header_ptr->version, "89a", 3);
+ memcpy(gif_ptr->header_ptr->signature, GIF_SIGNATURE, 3);
+ memcpy(gif_ptr->header_ptr->version, "89a", 3);
gif_ptr->lsd_ptr = FX_Alloc(GifLSD, 1);
if (!gif_ptr->lsd_ptr) {
FX_Free(gif_ptr->header_ptr);
@@ -456,7 +454,7 @@ gif_compress_struct_p gif_create_compress() {
FX_Free(gif_ptr);
return nullptr;
}
- FXSYS_memset(gif_ptr->lsd_ptr, 0, sizeof(GifLSD));
+ memset(gif_ptr->lsd_ptr, 0, sizeof(GifLSD));
gif_ptr->image_info_ptr = FX_Alloc(GifImageInfo, 1);
if (!gif_ptr->image_info_ptr) {
FX_Free(gif_ptr->lsd_ptr);
@@ -465,7 +463,7 @@ gif_compress_struct_p gif_create_compress() {
FX_Free(gif_ptr);
return nullptr;
}
- FXSYS_memset(gif_ptr->image_info_ptr, 0, sizeof(GifImageInfo));
+ memset(gif_ptr->image_info_ptr, 0, sizeof(GifImageInfo));
gif_ptr->gce_ptr = FX_Alloc(GifGCE, 1);
if (!gif_ptr->gce_ptr) {
FX_Free(gif_ptr->image_info_ptr);
@@ -485,7 +483,7 @@ gif_compress_struct_p gif_create_compress() {
FX_Free(gif_ptr);
return nullptr;
}
- FXSYS_memset(gif_ptr->pte_ptr, 0, sizeof(GifPTE));
+ memset(gif_ptr->pte_ptr, 0, sizeof(GifPTE));
gif_ptr->pte_ptr->block_size = 12;
return gif_ptr;
}
@@ -548,7 +546,7 @@ int32_t gif_read_header(gif_decompress_struct_p gif_ptr) {
((GifGF*)&gif_lsd_ptr->global_flag)->color_resolution;
FX_Free(gif_ptr->global_pal_ptr);
gif_ptr->global_pal_ptr = (GifPalette*)FX_Alloc(uint8_t, global_pal_size);
- FXSYS_memcpy(gif_ptr->global_pal_ptr, global_pal_ptr, global_pal_size);
+ memcpy(gif_ptr->global_pal_ptr, global_pal_ptr, global_pal_size);
}
gif_ptr->width = (int)GetWord_LSBFirst((uint8_t*)&gif_lsd_ptr->width);
gif_ptr->height = (int)GetWord_LSBFirst((uint8_t*)&gif_lsd_ptr->height);
@@ -690,7 +688,7 @@ int32_t gif_decode_extension(gif_decompress_struct_p gif_ptr) {
return 2;
}
GifPlainText* gif_pt_ptr = FX_Alloc(GifPlainText, 1);
- FXSYS_memset(gif_pt_ptr, 0, sizeof(GifPlainText));
+ memset(gif_pt_ptr, 0, sizeof(GifPlainText));
gif_takeover_gce_ptr(gif_ptr, &gif_pt_ptr->gce_ptr);
gif_pt_ptr->pte_ptr = FX_Alloc(GifPTE, 1);
gif_pt_ptr->string_ptr = new CFX_ByteString;
@@ -781,7 +779,7 @@ int32_t gif_decode_image_info(gif_decompress_struct_p gif_ptr) {
return 2;
GifImage* gif_image_ptr = FX_Alloc(GifImage, 1);
- FXSYS_memset(gif_image_ptr, 0, sizeof(GifImage));
+ memset(gif_image_ptr, 0, sizeof(GifImage));
gif_image_ptr->image_info_ptr = FX_Alloc(GifImageInfo, 1);
gif_image_ptr->image_info_ptr->left =
GetWord_LSBFirst((uint8_t*)&gif_img_info_ptr->left);
@@ -819,8 +817,7 @@ int32_t gif_decode_image_info(gif_decompress_struct_p gif_ptr) {
gif_image_ptr->local_pal_ptr =
(GifPalette*)gif_ptr->gif_ask_buf_for_pal_fn(gif_ptr, loc_pal_size);
if (gif_image_ptr->local_pal_ptr) {
- FXSYS_memcpy((uint8_t*)gif_image_ptr->local_pal_ptr, loc_pal_ptr,
- loc_pal_size);
+ memcpy((uint8_t*)gif_image_ptr->local_pal_ptr, loc_pal_ptr, loc_pal_size);
}
}
uint8_t* code_size_ptr = nullptr;
@@ -1065,8 +1062,8 @@ static bool gif_write_header(gif_compress_struct_p gif_ptr,
if (!dst_buf)
return false;
- FXSYS_memset(dst_buf, 0, dst_len);
- FXSYS_memcpy(dst_buf, gif_ptr->header_ptr, sizeof(GifHeader));
+ memset(dst_buf, 0, dst_len);
+ memcpy(dst_buf, gif_ptr->header_ptr, sizeof(GifHeader));
gif_ptr->cur_offset += sizeof(GifHeader);
SetWord_LSBFirst(dst_buf + gif_ptr->cur_offset, gif_ptr->lsd_ptr->width);
gif_ptr->cur_offset += 2;
@@ -1080,7 +1077,7 @@ static bool gif_write_header(gif_compress_struct_p gif_ptr,
if (!gif_grow_buf(dst_buf, dst_len, gif_ptr->cur_offset + size)) {
return false;
}
- FXSYS_memcpy(&dst_buf[gif_ptr->cur_offset], gif_ptr->global_pal, size);
+ memcpy(&dst_buf[gif_ptr->cur_offset], gif_ptr->global_pal, size);
gif_ptr->cur_offset += size;
}
return true;
@@ -1101,13 +1098,13 @@ void interlace_buf(const uint8_t* buf, uint32_t pitch, uint32_t height) {
j = 3;
}
temp = FX_Alloc(uint8_t, pitch);
- FXSYS_memcpy(temp, &buf[pitch * row], pitch);
+ memcpy(temp, &buf[pitch * row], pitch);
pass[j].push_back(temp);
row++;
}
for (size_t i = 0, row = 0; i < 4; i++) {
for (size_t j = 0; j < pass[i].size(); j++, row++) {
- FXSYS_memcpy((uint8_t*)&buf[pitch * row], pass[i][j], pitch);
+ memcpy((uint8_t*)&buf[pitch * row], pass[i][j], pitch);
FX_Free(pass[i][j]);
}
}
@@ -1120,13 +1117,13 @@ static void gif_write_block_data(const uint8_t* src_buf,
uint32_t src_offset = 0;
while (src_len > GIF_DATA_BLOCK) {
dst_buf[dst_offset++] = GIF_DATA_BLOCK;
- FXSYS_memcpy(&dst_buf[dst_offset], &src_buf[src_offset], GIF_DATA_BLOCK);
+ memcpy(&dst_buf[dst_offset], &src_buf[src_offset], GIF_DATA_BLOCK);
dst_offset += GIF_DATA_BLOCK;
src_offset += GIF_DATA_BLOCK;
src_len -= GIF_DATA_BLOCK;
}
dst_buf[dst_offset++] = (uint8_t)src_len;
- FXSYS_memcpy(&dst_buf[dst_offset], &src_buf[src_offset], src_len);
+ memcpy(&dst_buf[dst_offset], &src_buf[src_offset], src_len);
dst_offset += src_len;
}
static bool gif_write_data(gif_compress_struct_p gif_ptr,
@@ -1135,7 +1132,7 @@ static bool gif_write_data(gif_compress_struct_p gif_ptr,
if (!gif_grow_buf(dst_buf, dst_len, gif_ptr->cur_offset + GIF_DATA_BLOCK)) {
return false;
}
- if (FXSYS_memcmp(gif_ptr->header_ptr->version, "89a", 3) == 0) {
+ if (memcmp(gif_ptr->header_ptr->version, "89a", 3) == 0) {
dst_buf[gif_ptr->cur_offset++] = GIF_SIG_EXTENSION;
dst_buf[gif_ptr->cur_offset++] = GIF_BLOCK_GCE;
gif_ptr->gce_ptr->block_size = 4;
@@ -1169,7 +1166,7 @@ static bool gif_write_data(gif_compress_struct_p gif_ptr,
if (!gif_grow_buf(dst_buf, dst_len, pal_size + gif_ptr->cur_offset)) {
return false;
}
- FXSYS_memcpy(&dst_buf[gif_ptr->cur_offset], gif_ptr->local_pal, pal_size);
+ memcpy(&dst_buf[gif_ptr->cur_offset], gif_ptr->local_pal, pal_size);
gif_ptr->cur_offset += pal_size;
}
if (lf.interlace) {
@@ -1196,7 +1193,7 @@ static bool gif_write_data(gif_compress_struct_p gif_ptr,
}
gif_ptr->img_encoder_ptr->Finish(dst_buf, dst_len, gif_ptr->cur_offset);
dst_buf[gif_ptr->cur_offset++] = 0;
- if (FXSYS_memcmp(gif_ptr->header_ptr->version, "89a", 3) == 0 &&
+ if (memcmp(gif_ptr->header_ptr->version, "89a", 3) == 0 &&
gif_ptr->cmt_data_ptr) {
dst_buf[gif_ptr->cur_offset++] = GIF_SIG_EXTENSION;
dst_buf[gif_ptr->cur_offset++] = GIF_BLOCK_CE;
@@ -1204,7 +1201,7 @@ static bool gif_write_data(gif_compress_struct_p gif_ptr,
dst_len, gif_ptr->cur_offset);
dst_buf[gif_ptr->cur_offset++] = 0;
}
- if (FXSYS_memcmp(gif_ptr->header_ptr->version, "89a", 3) == 0 &&
+ if (memcmp(gif_ptr->header_ptr->version, "89a", 3) == 0 &&
gif_ptr->pte_data_ptr) {
dst_buf[gif_ptr->cur_offset++] = GIF_SIG_EXTENSION;
dst_buf[gif_ptr->cur_offset++] = GIF_BLOCK_PTE;