diff options
author | Chris Dalton <csmartdalton@google.com> | 2017-12-04 12:01:30 -0700 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-04 19:29:51 +0000 |
commit | 1ef80942b3b2414c862eb1e9ae301442b447c089 (patch) | |
tree | 27eb42492497d3516a008d1f038ce044d2c16c94 /src/utils/win | |
parent | 364c4c87c1321625ae961d8f2cf315096ccfd462 (diff) |
turn on extended Clang warnings on Windows too
Plus some small rearrangements of the various warning lists.
Change-Id: Ied58f940341d69ddab971a529fd01b1e96b65641
Reviewed-on: https://skia-review.googlesource.com/67720
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/utils/win')
-rw-r--r-- | src/utils/win/SkDWriteFontFileStream.h | 2 | ||||
-rw-r--r-- | src/utils/win/SkIStream.cpp | 20 | ||||
-rw-r--r-- | src/utils/win/SkTScopedComPtr.h | 1 | ||||
-rw-r--r-- | src/utils/win/SkWGL_win.cpp | 4 |
4 files changed, 13 insertions, 14 deletions
diff --git a/src/utils/win/SkDWriteFontFileStream.h b/src/utils/win/SkDWriteFontFileStream.h index 680b3ab8a8..bdc66c79b9 100644 --- a/src/utils/win/SkDWriteFontFileStream.h +++ b/src/utils/win/SkDWriteFontFileStream.h @@ -23,7 +23,7 @@ class SkDWriteFontFileStream : public SkStreamMemory { public: explicit SkDWriteFontFileStream(IDWriteFontFileStream* fontFileStream); - virtual ~SkDWriteFontFileStream(); + ~SkDWriteFontFileStream() override; size_t read(void* buffer, size_t size) override; bool isAtEnd() const override; diff --git a/src/utils/win/SkIStream.cpp b/src/utils/win/SkIStream.cpp index 560a947fcf..161206fc08 100644 --- a/src/utils/win/SkIStream.cpp +++ b/src/utils/win/SkIStream.cpp @@ -153,22 +153,20 @@ HRESULT STDMETHODCALLTYPE SkIStream::Seek(LARGE_INTEGER liDistanceToMove if (!this->fSkStream->rewind()) { hr = E_FAIL; } else { - size_t skipped = this->fSkStream->skip( - static_cast<size_t>(liDistanceToMove.QuadPart) - ); + size_t skip = static_cast<size_t>(liDistanceToMove.QuadPart); + size_t skipped = this->fSkStream->skip(skip); this->fLocation.QuadPart = skipped; - if (skipped != liDistanceToMove.QuadPart) { + if (skipped != skip) { hr = E_FAIL; } } break; } case STREAM_SEEK_CUR: { - size_t skipped = this->fSkStream->skip( - static_cast<size_t>(liDistanceToMove.QuadPart) - ); + size_t skip = static_cast<size_t>(liDistanceToMove.QuadPart); + size_t skipped = this->fSkStream->skip(skip); this->fLocation.QuadPart += skipped; - if (skipped != liDistanceToMove.QuadPart) { + if (skipped != skip) { hr = E_FAIL; } break; @@ -179,9 +177,9 @@ HRESULT STDMETHODCALLTYPE SkIStream::Seek(LARGE_INTEGER liDistanceToMove } else { // FIXME: Should not depend on getLength. // See https://code.google.com/p/skia/issues/detail?id=1570 - LONGLONG skip = this->fSkStream->getLength() - + liDistanceToMove.QuadPart; - size_t skipped = this->fSkStream->skip(static_cast<size_t>(skip)); + size_t skip = static_cast<size_t>(this->fSkStream->getLength() + + liDistanceToMove.QuadPart); + size_t skipped = this->fSkStream->skip(skip); this->fLocation.QuadPart = skipped; if (skipped != skip) { hr = E_FAIL; diff --git a/src/utils/win/SkTScopedComPtr.h b/src/utils/win/SkTScopedComPtr.h index f44740ff44..8b12c07e5a 100644 --- a/src/utils/win/SkTScopedComPtr.h +++ b/src/utils/win/SkTScopedComPtr.h @@ -17,6 +17,7 @@ class SkBlockComRef : public T { private: virtual ULONG STDMETHODCALLTYPE AddRef(void) = 0; virtual ULONG STDMETHODCALLTYPE Release(void) = 0; + virtual ~SkBlockComRef() {} }; template<typename T> T* SkRefComPtr(T* ptr) { diff --git a/src/utils/win/SkWGL_win.cpp b/src/utils/win/SkWGL_win.cpp index 016b61b2bf..0c1752a06a 100644 --- a/src/utils/win/SkWGL_win.cpp +++ b/src/utils/win/SkWGL_win.cpp @@ -381,7 +381,7 @@ static HGLRC create_gl_context(HDC dc, const SkWGLExtensions& extensions, SK_WGL_CONTEXT_PROFILE_MASK, SK_WGL_CONTEXT_CORE_PROFILE_BIT, 0, }; - for (int v = 0; v < SK_ARRAY_COUNT(kCoreGLVersions) / 2; ++v) { + for (size_t v = 0; v < SK_ARRAY_COUNT(kCoreGLVersions) / 2; ++v) { coreProfileAttribs[1] = kCoreGLVersions[2 * v]; coreProfileAttribs[3] = kCoreGLVersions[2 * v + 1]; glrc = extensions.createContextAttribs(dc, shareContext, coreProfileAttribs); @@ -423,7 +423,7 @@ HGLRC SkCreateWGLContext(HDC dc, int msaaSampleCount, bool deepColor, int pixelFormatsToTry[] = { -1, -1 }; get_pixel_formats_to_try(dc, extensions, true, msaaSampleCount, deepColor, pixelFormatsToTry); - for (int f = 0; + for (size_t f = 0; !set && -1 != pixelFormatsToTry[f] && f < SK_ARRAY_COUNT(pixelFormatsToTry); ++f) { PIXELFORMATDESCRIPTOR pfd; |