summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-04-03 15:10:29 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-03 20:45:01 +0000
commit6da8ac5053e9ebf7c4ce0d9d67b0443d3f8f6084 (patch)
tree952cc0bec2108191bba09aba6f09b9cf8c22e10e
parent1c5d0b48ec7a6443ba72fec2a58a65fc6d694aca (diff)
downloadpdfium-6da8ac5053e9ebf7c4ce0d9d67b0443d3f8f6084.tar.xz
Drop FXSYS_ from util methods
This Cl drops the FXSYS_ from utility methods which are the same on all platforms. Bug: pdfium:694 Change-Id: I0859b60c5ba7af68c929a519dd76f48c27a6c896 Reviewed-on: https://pdfium-review.googlesource.com/3614 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
-rw-r--r--core/fpdfapi/cmaps/fpdf_cmaps.cpp14
-rw-r--r--core/fpdfapi/font/cpdf_type1font.cpp6
-rw-r--r--core/fpdfapi/font/fpdf_font_cid.cpp7
-rw-r--r--core/fpdfapi/font/ttgsubtable.cpp6
-rw-r--r--core/fpdfapi/render/cpdf_pagerendercache.cpp2
-rw-r--r--core/fxcrt/fx_system.h3
-rw-r--r--core/fxge/ge/cfx_fontmapper.cpp6
7 files changed, 20 insertions, 24 deletions
diff --git a/core/fpdfapi/cmaps/fpdf_cmaps.cpp b/core/fpdfapi/cmaps/fpdf_cmaps.cpp
index ca01d431f4..cb2f09fb3c 100644
--- a/core/fpdfapi/cmaps/fpdf_cmaps.cpp
+++ b/core/fpdfapi/cmaps/fpdf_cmaps.cpp
@@ -76,15 +76,15 @@ uint16_t FPDFAPI_CIDFromCharCode(const FXCMAP_CMap* pMap, uint32_t charcode) {
while (1) {
if (pMap->m_DWordMapType == FXCMAP_CMap::Range) {
uint16_t* found = static_cast<uint16_t*>(
- FXSYS_bsearch(&charcode, pMap->m_pDWordMap, pMap->m_DWordCount, 8,
- compareDWordRange));
+ bsearch(&charcode, pMap->m_pDWordMap, pMap->m_DWordCount, 8,
+ compareDWordRange));
if (found)
return found[3] + (uint16_t)charcode - found[1];
} else if (pMap->m_DWordMapType == FXCMAP_CMap::Single) {
uint16_t* found = static_cast<uint16_t*>(
- FXSYS_bsearch(&charcode, pMap->m_pDWordMap, pMap->m_DWordCount, 6,
- compareDWordSingle));
+ bsearch(&charcode, pMap->m_pDWordMap, pMap->m_DWordCount, 6,
+ compareDWordSingle));
if (found)
return found[2];
}
@@ -101,13 +101,13 @@ uint16_t FPDFAPI_CIDFromCharCode(const FXCMAP_CMap* pMap, uint32_t charcode) {
if (!pMap->m_pWordMap)
return 0;
if (pMap->m_WordMapType == FXCMAP_CMap::Single) {
- uint16_t* found = static_cast<uint16_t*>(FXSYS_bsearch(
- &code, pMap->m_pWordMap, pMap->m_WordCount, 4, compareWord));
+ uint16_t* found = static_cast<uint16_t*>(
+ bsearch(&code, pMap->m_pWordMap, pMap->m_WordCount, 4, compareWord));
if (found)
return found[1];
} else if (pMap->m_WordMapType == FXCMAP_CMap::Range) {
- uint16_t* found = static_cast<uint16_t*>(FXSYS_bsearch(
+ uint16_t* found = static_cast<uint16_t*>(bsearch(
&code, pMap->m_pWordMap, pMap->m_WordCount, 6, compareWordRange));
if (found)
return found[2] + code - found[0];
diff --git a/core/fpdfapi/font/cpdf_type1font.cpp b/core/fpdfapi/font/cpdf_type1font.cpp
index e3d96dad37..ac0aed4050 100644
--- a/core/fpdfapi/font/cpdf_type1font.cpp
+++ b/core/fpdfapi/font/cpdf_type1font.cpp
@@ -35,9 +35,9 @@ int compareString(const void* key, const void* element) {
}
const char* GlyphNameRemap(const char* pStrAdobe) {
- const GlyphNameMap* found = static_cast<const GlyphNameMap*>(FXSYS_bsearch(
- pStrAdobe, g_GlyphNameSubsts, FX_ArraySize(g_GlyphNameSubsts),
- sizeof(GlyphNameMap), compareString));
+ const GlyphNameMap* found = static_cast<const GlyphNameMap*>(
+ bsearch(pStrAdobe, g_GlyphNameSubsts, FX_ArraySize(g_GlyphNameSubsts),
+ sizeof(GlyphNameMap), compareString));
return found ? found->m_pStrUnicode : nullptr;
}
diff --git a/core/fpdfapi/font/fpdf_font_cid.cpp b/core/fpdfapi/font/fpdf_font_cid.cpp
index 64b041738e..434fe62ede 100644
--- a/core/fpdfapi/font/fpdf_font_cid.cpp
+++ b/core/fpdfapi/font/fpdf_font_cid.cpp
@@ -579,8 +579,7 @@ void CPDF_CMap::LoadEmbedded(const uint8_t* pData, uint32_t size) {
*(uint32_t*)m_pAddMapping = parser.m_AddMaps.GetSize() / 8;
memcpy(m_pAddMapping + 4, parser.m_AddMaps.GetBuffer(),
parser.m_AddMaps.GetSize());
- FXSYS_qsort(m_pAddMapping + 4, parser.m_AddMaps.GetSize() / 8, 8,
- CompareDWORD);
+ qsort(m_pAddMapping + 4, parser.m_AddMaps.GetSize() / 8, 8, CompareDWORD);
}
}
@@ -596,8 +595,8 @@ uint16_t CPDF_CMap::CIDFromCharCode(uint32_t charcode) const {
}
if (charcode >> 16) {
if (m_pAddMapping) {
- void* found = FXSYS_bsearch(&charcode, m_pAddMapping + 4,
- *(uint32_t*)m_pAddMapping, 8, CompareCID);
+ void* found = bsearch(&charcode, m_pAddMapping + 4,
+ *(uint32_t*)m_pAddMapping, 8, CompareCID);
if (!found)
return 0;
return (uint16_t)(((uint32_t*)found)[1] % 65536 + charcode -
diff --git a/core/fpdfapi/font/ttgsubtable.cpp b/core/fpdfapi/font/ttgsubtable.cpp
index 4fae5d41d2..d2a6b9ab52 100644
--- a/core/fpdfapi/font/ttgsubtable.cpp
+++ b/core/fpdfapi/font/ttgsubtable.cpp
@@ -49,9 +49,9 @@ void CFX_GlyphMap::SetAt(int key, int value) {
}
bool CFX_GlyphMap::Lookup(int key, int& value) {
- void* pResult = FXSYS_bsearch(&key, m_Buffer.GetBuffer(),
- m_Buffer.GetSize() / sizeof(_IntPair),
- sizeof(_IntPair), _CompareInt);
+ void* pResult =
+ bsearch(&key, m_Buffer.GetBuffer(), m_Buffer.GetSize() / sizeof(_IntPair),
+ sizeof(_IntPair), _CompareInt);
if (!pResult) {
return false;
}
diff --git a/core/fpdfapi/render/cpdf_pagerendercache.cpp b/core/fpdfapi/render/cpdf_pagerendercache.cpp
index 6e6250b1c0..549f466527 100644
--- a/core/fpdfapi/render/cpdf_pagerendercache.cpp
+++ b/core/fpdfapi/render/cpdf_pagerendercache.cpp
@@ -48,7 +48,7 @@ void CPDF_PageRenderCache::CacheOptimization(int32_t dwLimitCacheSize) {
pCACHEINFO[i].time = it.second->GetTimeCount();
pCACHEINFO[i++].pStream = it.second->GetStream();
}
- FXSYS_qsort(pCACHEINFO, nCount, sizeof(CACHEINFO), compare);
+ qsort(pCACHEINFO, nCount, sizeof(CACHEINFO), compare);
uint32_t nTimeCount = m_nTimeCount;
// Check if time value is about to roll over and reset all entries.
diff --git a/core/fxcrt/fx_system.h b/core/fxcrt/fx_system.h
index b52cb6adf3..1ee0d8b601 100644
--- a/core/fxcrt/fx_system.h
+++ b/core/fxcrt/fx_system.h
@@ -171,9 +171,6 @@ extern "C" {
#define FXSYS_wcslen(ptr) ((FX_STRSIZE)wcslen(ptr))
#endif // __cplusplus
-#define FXSYS_qsort qsort
-#define FXSYS_bsearch bsearch
-
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
#define FXSYS_GetACP GetACP
#define FXSYS_itoa _itoa
diff --git a/core/fxge/ge/cfx_fontmapper.cpp b/core/fxge/ge/cfx_fontmapper.cpp
index 9b2e1aa583..e8fb988fdb 100644
--- a/core/fxge/ge/cfx_fontmapper.cpp
+++ b/core/fxge/ge/cfx_fontmapper.cpp
@@ -216,7 +216,7 @@ CFX_ByteString GetFontFamily(CFX_ByteString fontName, int nStyle) {
fontName = "FreeStyleScript";
return fontName;
}
- AltFontFamily* found = reinterpret_cast<AltFontFamily*>(FXSYS_bsearch(
+ AltFontFamily* found = reinterpret_cast<AltFontFamily*>(bsearch(
fontName.c_str(), g_AltFontFamilies, FX_ArraySize(g_AltFontFamilies),
sizeof(AltFontFamily), CompareFontFamilyString));
return found ? CFX_ByteString(found->m_pFontFamily) : fontName;
@@ -809,8 +809,8 @@ FXFT_Face CFX_FontMapper::GetCachedFace(void* hFont,
int PDF_GetStandardFontName(CFX_ByteString* name) {
AltFontName* found = static_cast<AltFontName*>(
- FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames),
- sizeof(AltFontName), CompareString));
+ bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames),
+ sizeof(AltFontName), CompareString));
if (!found)
return -1;