From bf6c2a4873f8cc12ad910fb904218a78087a3735 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 8 Jun 2015 17:25:42 -0700 Subject: 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 --- core/src/fxge/apple/apple_int.h | 14 +++++++------- core/src/fxge/ge/fx_ge_fontmap.cpp | 4 +++- core/src/fxge/win32/fx_win32_device.cpp | 4 ++-- core/src/fxge/win32/fx_win32_dib.cpp | 2 +- core/src/fxge/win32/fx_win32_dwrite.cpp | 6 +++--- core/src/fxge/win32/fx_win32_gdipext.cpp | 4 ++-- core/src/fxge/win32/fx_win32_print.cpp | 2 +- 7 files changed, 19 insertions(+), 17 deletions(-) (limited to 'core/src/fxge') diff --git a/core/src/fxge/apple/apple_int.h b/core/src/fxge/apple/apple_int.h index 5b083d83eb..2466ecbc9a 100644 --- a/core/src/fxge/apple/apple_int.h +++ b/core/src/fxge/apple/apple_int.h @@ -186,28 +186,28 @@ protected: FX_INT32 _horzSize; FX_INT32 _vertSize; }; -class CFX_FontProvider FX_FINAL : public IFX_FileRead +class CFX_FontProvider final : public IFX_FileRead { public: - virtual void Release() FX_OVERRIDE + virtual void Release() override { delete this; } - virtual FX_FILESIZE GetSize() FX_OVERRIDE + virtual FX_FILESIZE GetSize() override { return (FX_FILESIZE)_totalSize; } - 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; - virtual FX_BOOL IsEOF() FX_OVERRIDE + virtual FX_BOOL IsEOF() override { return _offSet == _totalSize; } - virtual FX_FILESIZE GetPosition() FX_OVERRIDE + virtual FX_FILESIZE GetPosition() override { return (FX_FILESIZE)_offSet; } - virtual size_t ReadBlock(void* buffer, size_t size) FX_OVERRIDE; + virtual size_t ReadBlock(void* buffer, size_t size) override; public: CFX_FontProvider(CGFontRef cgFont); ~CFX_FontProvider(); diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp index 74f97d1b2e..c1ea5906ff 100644 --- a/core/src/fxge/ge/fx_ge_fontmap.cpp +++ b/core/src/fxge/ge/fx_ge_fontmap.cpp @@ -4,6 +4,8 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com +#include + #include "../../../include/fxge/fx_ge.h" #include "../../../include/fxge/fx_freetype.h" #include "text_int.h" @@ -1365,7 +1367,7 @@ void CFX_FolderFontInfo::ScanFile(CFX_ByteString& path) if (GET_TT_LONG(buffer) == 0x74746366) { FX_DWORD nFaces = GET_TT_LONG(buffer + 8); - if (nFaces > FX_DWORD_MAX / 4) { + if (nFaces > std::numeric_limits::max() / 4) { FXSYS_fclose(pFile); return; } diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp index 0717fb1528..4bef988885 100644 --- a/core/src/fxge/win32/fx_win32_device.cpp +++ b/core/src/fxge/win32/fx_win32_device.cpp @@ -5,7 +5,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../../include/fxge/fx_ge.h" -#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ +#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ #include "../../../include/fxge/fx_ge_win32.h" #include #include "../agg/include/fxfx_agg_clip_liang_barsky.h" @@ -16,7 +16,7 @@ #include "../agg/include/fx_agg_driver.h" #include "../../../include/fxge/fx_freetype.h" #include "../../../include/fxcodec/fx_codec.h" -class CWin32FontInfo FX_FINAL : public IFX_SystemFontInfo +class CWin32FontInfo final : public IFX_SystemFontInfo { public: CWin32FontInfo(); diff --git a/core/src/fxge/win32/fx_win32_dib.cpp b/core/src/fxge/win32/fx_win32_dib.cpp index 46abdb366c..47da880680 100644 --- a/core/src/fxge/win32/fx_win32_dib.cpp +++ b/core/src/fxge/win32/fx_win32_dib.cpp @@ -5,7 +5,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../../include/fxge/fx_ge.h" -#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ +#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ #include #include "../../../include/fxge/fx_ge_win32.h" #include "win32_int.h" diff --git a/core/src/fxge/win32/fx_win32_dwrite.cpp b/core/src/fxge/win32/fx_win32_dwrite.cpp index 7a17c4ad09..0849583384 100644 --- a/core/src/fxge/win32/fx_win32_dwrite.cpp +++ b/core/src/fxge/win32/fx_win32_dwrite.cpp @@ -5,7 +5,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../../include/fxge/fx_ge.h" -#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ +#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ #include "../../../include/fxge/fx_ge_win32.h" #include "dwrite_int.h" #include @@ -26,7 +26,7 @@ inline InterfaceType* SafeAcquire(InterfaceType* newObject) } return newObject; } -class CDwFontFileStream FX_FINAL : public IDWriteFontFileStream +class CDwFontFileStream final : public IDWriteFontFileStream { public: explicit CDwFontFileStream(void const* fontFileReferenceKey, UINT32 fontFileReferenceKeySize); @@ -46,7 +46,7 @@ private: void const* resourcePtr_; DWORD resourceSize_; }; -class CDwFontFileLoader FX_FINAL : public IDWriteFontFileLoader +class CDwFontFileLoader final : public IDWriteFontFileLoader { public: virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void** ppvObject); diff --git a/core/src/fxge/win32/fx_win32_gdipext.cpp b/core/src/fxge/win32/fx_win32_gdipext.cpp index 67aa16242b..e36d283115 100644 --- a/core/src/fxge/win32/fx_win32_gdipext.cpp +++ b/core/src/fxge/win32/fx_win32_gdipext.cpp @@ -5,7 +5,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../../include/fxge/fx_ge.h" -#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ +#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ #include #include namespace Gdiplus { @@ -995,7 +995,7 @@ BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData, CallFunc(GdipDeleteGraphics)(pGraphics); return TRUE; } -class GpStream FX_FINAL : public IStream +class GpStream final : public IStream { LONG m_RefCount; int m_ReadPos; diff --git a/core/src/fxge/win32/fx_win32_print.cpp b/core/src/fxge/win32/fx_win32_print.cpp index 670622a5fb..d6a44b490f 100644 --- a/core/src/fxge/win32/fx_win32_print.cpp +++ b/core/src/fxge/win32/fx_win32_print.cpp @@ -5,7 +5,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../../include/fxge/fx_ge.h" -#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ +#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ #include #include "../../../include/fxge/fx_ge_win32.h" #include "win32_int.h" -- cgit v1.2.3