diff options
author | Lei Zhang <thestig@chromium.org> | 2015-11-19 22:09:27 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-11-19 22:09:27 -0800 |
commit | 126ba519bdd489ec6c285d1410dcae773e8ef673 (patch) | |
tree | 61390a37589c06ce01810bca631a2a7003748a91 /core/src/fxcrt | |
parent | 814000d7876df07a03a320f9eae8af5da7b340c5 (diff) | |
download | pdfium-126ba519bdd489ec6c285d1410dcae773e8ef673.tar.xz |
Add more overrides.
Using Chromium's clang + build options, there's more override warnings.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1453643002 .
Diffstat (limited to 'core/src/fxcrt')
-rw-r--r-- | core/src/fxcrt/extension.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/core/src/fxcrt/extension.h b/core/src/fxcrt/extension.h index 808c247e8a..a23eab5c58 100644 --- a/core/src/fxcrt/extension.h +++ b/core/src/fxcrt/extension.h @@ -104,23 +104,23 @@ class CFX_MemoryStream final : public IFX_MemoryStream { } m_Blocks.RemoveAll(); } - virtual IFX_FileStream* Retain() override { + + // IFX_MemoryStream: + IFX_FileStream* Retain() override { m_dwCount++; return this; } - virtual void Release() override { + void Release() override { FX_DWORD nCount = --m_dwCount; if (nCount) { return; } delete this; } - virtual FX_FILESIZE GetSize() override { return (FX_FILESIZE)m_nCurSize; } - virtual FX_BOOL IsEOF() override { return m_nCurPos >= (size_t)GetSize(); } - virtual FX_FILESIZE GetPosition() override { return (FX_FILESIZE)m_nCurPos; } - virtual FX_BOOL ReadBlock(void* buffer, - FX_FILESIZE offset, - size_t size) override { + FX_FILESIZE GetSize() override { return (FX_FILESIZE)m_nCurSize; } + FX_BOOL IsEOF() override { return m_nCurPos >= (size_t)GetSize(); } + FX_FILESIZE GetPosition() override { return (FX_FILESIZE)m_nCurPos; } + FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override { if (!buffer || !size) { return FALSE; } @@ -153,7 +153,7 @@ class CFX_MemoryStream final : public IFX_MemoryStream { } return TRUE; } - virtual size_t ReadBlock(void* buffer, size_t size) override { + size_t ReadBlock(void* buffer, size_t size) override { if (m_nCurPos >= m_nCurSize) { return 0; } @@ -163,9 +163,9 @@ class CFX_MemoryStream final : public IFX_MemoryStream { } return nRead; } - virtual FX_BOOL WriteBlock(const void* buffer, - FX_FILESIZE offset, - size_t size) override { + FX_BOOL WriteBlock(const void* buffer, + FX_FILESIZE offset, + size_t size) override { if (!buffer || !size) { return FALSE; } @@ -223,11 +223,11 @@ class CFX_MemoryStream final : public IFX_MemoryStream { } return TRUE; } - virtual FX_BOOL Flush() override { return TRUE; } - virtual FX_BOOL IsConsecutive() const override { + FX_BOOL Flush() override { return TRUE; } + FX_BOOL IsConsecutive() const override { return m_dwFlags & FX_MEMSTREAM_Consecutive; } - virtual void EstimateSize(size_t nInitSize, size_t nGrowSize) override { + void EstimateSize(size_t nInitSize, size_t nGrowSize) override { if (m_dwFlags & FX_MEMSTREAM_Consecutive) { if (m_Blocks.GetSize() < 1) { uint8_t* pBlock = FX_Alloc(uint8_t, FX_MAX(nInitSize, 4096)); @@ -238,12 +238,12 @@ class CFX_MemoryStream final : public IFX_MemoryStream { m_nGrowSize = FX_MAX(nGrowSize, 4096); } } - virtual uint8_t* GetBuffer() const override { + uint8_t* GetBuffer() const override { return m_Blocks.GetSize() ? (uint8_t*)m_Blocks[0] : NULL; } - virtual void AttachBuffer(uint8_t* pBuffer, - size_t nSize, - FX_BOOL bTakeOver = FALSE) override { + void AttachBuffer(uint8_t* pBuffer, + size_t nSize, + FX_BOOL bTakeOver = FALSE) override { if (!(m_dwFlags & FX_MEMSTREAM_Consecutive)) { return; } @@ -254,7 +254,7 @@ class CFX_MemoryStream final : public IFX_MemoryStream { m_dwFlags = FX_MEMSTREAM_Consecutive | (bTakeOver ? FX_MEMSTREAM_TakeOver : 0); } - virtual void DetachBuffer() override { + void DetachBuffer() override { if (!(m_dwFlags & FX_MEMSTREAM_Consecutive)) { return; } |