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 | |
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')
-rw-r--r-- | core/src/fpdfapi/fpdf_font/ttgsubtable.h | 5 | ||||
-rw-r--r-- | core/src/fxcodec/codec/codec_int.h | 123 | ||||
-rw-r--r-- | core/src/fxcodec/codec/fx_codec_jbig.cpp | 2 | ||||
-rw-r--r-- | core/src/fxcrt/extension.h | 40 |
4 files changed, 87 insertions, 83 deletions
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.h b/core/src/fpdfapi/fpdf_font/ttgsubtable.h index 7dd8cce36c..e3c9965654 100644 --- a/core/src/fpdfapi/fpdf_font/ttgsubtable.h +++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.h @@ -260,7 +260,7 @@ class CFX_CTTGSUBTable { TSingleSubstFormat2() : Coverage(NULL), GlyphCount(0), Substitute(NULL) { SubstFormat = 2; } - ~TSingleSubstFormat2() { + ~TSingleSubstFormat2() override { delete Coverage; delete[] Substitute; } @@ -356,8 +356,7 @@ class CFX_CTTGSUBTable { class CFX_GSUBTable final : public IFX_GSUBTable { public: ~CFX_GSUBTable() override {} - virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, - FX_DWORD* vglyphnum) override; + FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) override; CFX_CTTGSUBTable m_GsubImp; }; diff --git a/core/src/fxcodec/codec/codec_int.h b/core/src/fxcodec/codec/codec_int.h index 7778eeef0b..c76413c1da 100644 --- a/core/src/fxcodec/codec/codec_int.h +++ b/core/src/fxcodec/codec/codec_int.h @@ -21,20 +21,21 @@ class CFX_IccTransformCache; class CCodec_BasicModule : public ICodec_BasicModule { public: - virtual FX_BOOL RunLengthEncode(const uint8_t* src_buf, - FX_DWORD src_size, - uint8_t*& dest_buf, - FX_DWORD& dest_size); - virtual FX_BOOL A85Encode(const uint8_t* src_buf, - FX_DWORD src_size, - uint8_t*& dest_buf, - FX_DWORD& dest_size); - virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(const uint8_t* src_buf, - FX_DWORD src_size, - int width, - int height, - int nComps, - int bpc); + // ICodec_BasicModule: + FX_BOOL RunLengthEncode(const uint8_t* src_buf, + FX_DWORD src_size, + uint8_t*& dest_buf, + FX_DWORD& dest_size) override; + FX_BOOL A85Encode(const uint8_t* src_buf, + FX_DWORD src_size, + uint8_t*& dest_buf, + FX_DWORD& dest_size) override; + ICodec_ScanlineDecoder* CreateRunLengthDecoder(const uint8_t* src_buf, + FX_DWORD src_size, + int width, + int height, + int nComps, + int bpc) override; }; class CCodec_ScanlineDecoder : public ICodec_ScanlineDecoder { @@ -101,22 +102,23 @@ class CCodec_ScanlineDecoder : public ICodec_ScanlineDecoder { class CCodec_FaxModule : public ICodec_FaxModule { public: - virtual ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf, - FX_DWORD src_size, - int width, - int height, - int K, - FX_BOOL EndOfLine, - FX_BOOL EncodedByteAlign, - FX_BOOL BlackIs1, - int Columns, - int Rows); + // ICodec_FaxModule: + ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf, + FX_DWORD src_size, + int width, + int height, + int K, + FX_BOOL EndOfLine, + FX_BOOL EncodedByteAlign, + FX_BOOL BlackIs1, + int Columns, + int Rows) override; FX_BOOL Encode(const uint8_t* src_buf, int width, int height, int pitch, uint8_t*& dest_buf, - FX_DWORD& dest_size); + FX_DWORD& dest_size) override; }; class CCodec_FlateModule : public ICodec_FlateModule { @@ -192,42 +194,45 @@ class CCodec_JpegModule : public ICodec_JpegModule { }; class CCodec_IccModule : public ICodec_IccModule { public: - virtual IccCS GetProfileCS(const uint8_t* pProfileData, - unsigned int dwProfileSize); - virtual IccCS GetProfileCS(IFX_FileRead* pFile); - virtual void* CreateTransform( - ICodec_IccModule::IccParam* pInputParam, - ICodec_IccModule::IccParam* pOutputParam, - ICodec_IccModule::IccParam* pProofParam = NULL, - FX_DWORD dwIntent = Icc_INTENT_PERCEPTUAL, - FX_DWORD dwFlag = Icc_FLAGS_DEFAULT, - FX_DWORD dwPrfIntent = Icc_INTENT_ABSOLUTE_COLORIMETRIC, - FX_DWORD dwPrfFlag = Icc_FLAGS_SOFTPROOFING); - virtual void* CreateTransform_sRGB(const uint8_t* pProfileData, - FX_DWORD dwProfileSize, - int32_t& nComponents, - int32_t intent = 0, - FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT); - virtual void* CreateTransform_CMYK(const uint8_t* pSrcProfileData, - FX_DWORD dwSrcProfileSize, - int32_t& nSrcComponents, - const uint8_t* pDstProfileData, - FX_DWORD dwDstProfileSize, - int32_t intent = 0, - FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT, - FX_DWORD dwDstFormat = Icc_FORMAT_DEFAULT); - virtual void DestroyTransform(void* pTransform); - virtual void Translate(void* pTransform, - FX_FLOAT* pSrcValues, - FX_FLOAT* pDestValues); - virtual void TranslateScanline(void* pTransform, - uint8_t* pDest, - const uint8_t* pSrc, - int pixels); - virtual void SetComponents(FX_DWORD nComponents) { + ~CCodec_IccModule() override; + + // ICodec_IccModule: + IccCS GetProfileCS(const uint8_t* pProfileData, + unsigned int dwProfileSize) override; + IccCS GetProfileCS(IFX_FileRead* pFile) override; + void* CreateTransform(ICodec_IccModule::IccParam* pInputParam, + ICodec_IccModule::IccParam* pOutputParam, + ICodec_IccModule::IccParam* pProofParam = NULL, + FX_DWORD dwIntent = Icc_INTENT_PERCEPTUAL, + FX_DWORD dwFlag = Icc_FLAGS_DEFAULT, + FX_DWORD dwPrfIntent = Icc_INTENT_ABSOLUTE_COLORIMETRIC, + FX_DWORD dwPrfFlag = Icc_FLAGS_SOFTPROOFING) override; + void* CreateTransform_sRGB( + const uint8_t* pProfileData, + FX_DWORD dwProfileSize, + int32_t& nComponents, + int32_t intent = 0, + FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT) override; + void* CreateTransform_CMYK( + const uint8_t* pSrcProfileData, + FX_DWORD dwSrcProfileSize, + int32_t& nSrcComponents, + const uint8_t* pDstProfileData, + FX_DWORD dwDstProfileSize, + int32_t intent = 0, + FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT, + FX_DWORD dwDstFormat = Icc_FORMAT_DEFAULT) override; + void DestroyTransform(void* pTransform) override; + void Translate(void* pTransform, + FX_FLOAT* pSrcValues, + FX_FLOAT* pDestValues) override; + void TranslateScanline(void* pTransform, + uint8_t* pDest, + const uint8_t* pSrc, + int pixels) override; + void SetComponents(FX_DWORD nComponents) override { m_nComponents = nComponents; } - virtual ~CCodec_IccModule(); protected: enum Icc_CLASS { diff --git a/core/src/fxcodec/codec/fx_codec_jbig.cpp b/core/src/fxcodec/codec/fx_codec_jbig.cpp index aa9f1811b7..8c7f1bcc7a 100644 --- a/core/src/fxcodec/codec/fx_codec_jbig.cpp +++ b/core/src/fxcodec/codec/fx_codec_jbig.cpp @@ -14,7 +14,7 @@ class JBig2DocumentContext : public CFX_DestructObject { return &m_SymbolDictCache; } - ~JBig2DocumentContext() { + ~JBig2DocumentContext() override { for (auto it : m_SymbolDictCache) { delete it.second; } 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; } |