summaryrefslogtreecommitdiff
path: root/core/src/fxcrt/extension.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-08 17:25:42 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-08 17:25:42 -0700
commitbf6c2a4873f8cc12ad910fb904218a78087a3735 (patch)
tree80a54fa87004f3aa065c451f1fb830734b3a6d2d /core/src/fxcrt/extension.h
parent2a824f1c0ed786aed0dd15a0ea60dc90999e2b2c (diff)
downloadpdfium-bf6c2a4873f8cc12ad910fb904218a78087a3735.tar.xz
Remove more cruft from fx_system.h
- include system headers first and alphabetize. - remove unsupported FX_WIN32_MOBILE symbol. - actually define a FX_WIN64 symbol and make consistent. - use final/override, not FX_FINAL. - let stdint.h resolve FX_WORDSIZE concerns. - unused FX_ERR and FX_SUCCESS() macros. - unused FX_LSB_FIRST macro. - outline FX type deprecation plan. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1169963003
Diffstat (limited to 'core/src/fxcrt/extension.h')
-rw-r--r--core/src/fxcrt/extension.h58
1 files changed, 29 insertions, 29 deletions
diff --git a/core/src/fxcrt/extension.h b/core/src/fxcrt/extension.h
index a59f81e08f..ce66e26402 100644
--- a/core/src/fxcrt/extension.h
+++ b/core/src/fxcrt/extension.h
@@ -28,7 +28,7 @@ public:
virtual FX_BOOL Truncate(FX_FILESIZE szFile) = 0;
};
IFXCRT_FileAccess* FXCRT_FileAccess_Create();
-class CFX_CRTFileStream FX_FINAL : public IFX_FileStream
+class CFX_CRTFileStream final : public IFX_FileStream
{
public:
CFX_CRTFileStream(IFXCRT_FileAccess* pFA) : m_pFile(pFA), m_dwCount(1), m_bUseRange(FALSE), m_nOffset(0), m_nSize(0) {}
@@ -38,27 +38,27 @@ public:
m_pFile->Release();
}
}
- virtual IFX_FileStream* Retain() FX_OVERRIDE
+ virtual IFX_FileStream* Retain() override
{
m_dwCount ++;
return this;
}
- virtual void Release() FX_OVERRIDE
+ virtual void Release() override
{
FX_DWORD nCount = -- m_dwCount;
if (!nCount) {
delete this;
}
}
- virtual FX_FILESIZE GetSize() FX_OVERRIDE
+ virtual FX_FILESIZE GetSize() override
{
return m_bUseRange ? m_nSize : m_pFile->GetSize();
}
- virtual FX_BOOL IsEOF() FX_OVERRIDE
+ virtual FX_BOOL IsEOF() override
{
return GetPosition() >= GetSize();
}
- virtual FX_FILESIZE GetPosition() FX_OVERRIDE
+ virtual FX_FILESIZE GetPosition() override
{
FX_FILESIZE pos = m_pFile->GetPosition();
if (m_bUseRange) {
@@ -66,7 +66,7 @@ public:
}
return pos;
}
- virtual FX_BOOL SetRange(FX_FILESIZE offset, FX_FILESIZE size) FX_OVERRIDE
+ virtual FX_BOOL SetRange(FX_FILESIZE offset, FX_FILESIZE size) override
{
if (offset < 0 || size < 0) {
return FALSE;
@@ -84,11 +84,11 @@ public:
m_pFile->SetPosition(m_nOffset);
return TRUE;
}
- virtual void ClearRange() FX_OVERRIDE
+ virtual void ClearRange() override
{
m_bUseRange = FALSE;
}
- virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) FX_OVERRIDE
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override
{
if (m_bUseRange && offset < 0) {
return FALSE;
@@ -103,7 +103,7 @@ public:
}
return (FX_BOOL)m_pFile->ReadPos(buffer, size, pos.ValueOrDie());
}
- virtual size_t ReadBlock(void* buffer, size_t size) FX_OVERRIDE
+ virtual size_t ReadBlock(void* buffer, size_t size) override
{
if (m_bUseRange) {
FX_FILESIZE availSize = m_nOffset + m_nSize - m_pFile->GetPosition();
@@ -113,14 +113,14 @@ public:
}
return m_pFile->Read(buffer, size);
}
- virtual FX_BOOL WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size) FX_OVERRIDE
+ virtual FX_BOOL WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size) override
{
if (m_bUseRange) {
offset += m_nOffset;
}
return (FX_BOOL)m_pFile->WritePos(buffer, size, offset);
}
- virtual FX_BOOL Flush() FX_OVERRIDE
+ virtual FX_BOOL Flush() override
{
return m_pFile->Flush();
}
@@ -133,7 +133,7 @@ public:
#define FX_MEMSTREAM_BlockSize (64 * 1024)
#define FX_MEMSTREAM_Consecutive 0x01
#define FX_MEMSTREAM_TakeOver 0x02
-class CFX_MemoryStream FX_FINAL : public IFX_MemoryStream
+class CFX_MemoryStream final : public IFX_MemoryStream
{
public:
CFX_MemoryStream(FX_BOOL bConsecutive)
@@ -166,12 +166,12 @@ public:
}
m_Blocks.RemoveAll();
}
- virtual IFX_FileStream* Retain() FX_OVERRIDE
+ virtual IFX_FileStream* Retain() override
{
m_dwCount ++;
return this;
}
- virtual void Release() FX_OVERRIDE
+ virtual void Release() override
{
FX_DWORD nCount = -- m_dwCount;
if (nCount) {
@@ -179,15 +179,15 @@ public:
}
delete this;
}
- virtual FX_FILESIZE GetSize() FX_OVERRIDE
+ virtual FX_FILESIZE GetSize() override
{
return m_bUseRange ? (FX_FILESIZE) m_nSize : (FX_FILESIZE)m_nCurSize;
}
- virtual FX_BOOL IsEOF() FX_OVERRIDE
+ virtual FX_BOOL IsEOF() override
{
return m_nCurPos >= (size_t)GetSize();
}
- virtual FX_FILESIZE GetPosition() FX_OVERRIDE
+ virtual FX_FILESIZE GetPosition() override
{
FX_FILESIZE pos = (FX_FILESIZE)m_nCurPos;
if (m_bUseRange) {
@@ -195,7 +195,7 @@ public:
}
return pos;
}
- virtual FX_BOOL SetRange(FX_FILESIZE offset, FX_FILESIZE size) FX_OVERRIDE
+ virtual FX_BOOL SetRange(FX_FILESIZE offset, FX_FILESIZE size) override
{
if (offset < 0 || size < 0) {
return FALSE;
@@ -211,11 +211,11 @@ public:
m_nCurPos = m_nOffset;
return TRUE;
}
- virtual void ClearRange() FX_OVERRIDE
+ virtual void ClearRange() override
{
m_bUseRange = FALSE;
}
- virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) FX_OVERRIDE
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override
{
if (!buffer || !size) {
return FALSE;
@@ -258,7 +258,7 @@ public:
}
return TRUE;
}
- virtual size_t ReadBlock(void* buffer, size_t size) FX_OVERRIDE
+ virtual size_t ReadBlock(void* buffer, size_t size) override
{
if (m_nCurPos >= m_nCurSize) {
return 0;
@@ -275,7 +275,7 @@ public:
}
return nRead;
}
- virtual FX_BOOL WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size) FX_OVERRIDE
+ virtual FX_BOOL WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size) override
{
if (!buffer || !size) {
return FALSE;
@@ -335,15 +335,15 @@ public:
}
return TRUE;
}
- virtual FX_BOOL Flush() FX_OVERRIDE
+ virtual FX_BOOL Flush() override
{
return TRUE;
}
- virtual FX_BOOL IsConsecutive() const FX_OVERRIDE
+ virtual FX_BOOL IsConsecutive() const override
{
return m_dwFlags & FX_MEMSTREAM_Consecutive;
}
- virtual void EstimateSize(size_t nInitSize, size_t nGrowSize) FX_OVERRIDE
+ virtual void EstimateSize(size_t nInitSize, size_t nGrowSize) override
{
if (m_dwFlags & FX_MEMSTREAM_Consecutive) {
if (m_Blocks.GetSize() < 1) {
@@ -355,11 +355,11 @@ public:
m_nGrowSize = FX_MAX(nGrowSize, 4096);
}
}
- virtual FX_LPBYTE GetBuffer() const FX_OVERRIDE
+ virtual FX_LPBYTE GetBuffer() const override
{
return m_Blocks.GetSize() ? (FX_LPBYTE)m_Blocks[0] : NULL;
}
- virtual void AttachBuffer(FX_LPBYTE pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE) FX_OVERRIDE
+ virtual void AttachBuffer(FX_LPBYTE pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE) override
{
if (!(m_dwFlags & FX_MEMSTREAM_Consecutive)) {
return;
@@ -371,7 +371,7 @@ public:
m_dwFlags = FX_MEMSTREAM_Consecutive | (bTakeOver ? FX_MEMSTREAM_TakeOver : 0);
ClearRange();
}
- virtual void DetachBuffer() FX_OVERRIDE
+ virtual void DetachBuffer() override
{
if (!(m_dwFlags & FX_MEMSTREAM_Consecutive)) {
return;