aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2017-12-04 12:01:30 -0700
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-04 19:29:51 +0000
commit1ef80942b3b2414c862eb1e9ae301442b447c089 (patch)
tree27eb42492497d3516a008d1f038ce044d2c16c94
parent364c4c87c1321625ae961d8f2cf315096ccfd462 (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>
-rw-r--r--gn/BUILD.gn161
-rw-r--r--include/core/SkPostConfig.h2
-rw-r--r--samplecode/SampleBigGradient.cpp3
-rw-r--r--src/gpu/GrXferProcessor.h11
-rw-r--r--src/gpu/effects/GrCoverageSetOpXP.h11
-rw-r--r--src/gpu/effects/GrCustomXfermode.cpp11
-rw-r--r--src/gpu/effects/GrDisableColorXP.h11
-rw-r--r--src/gpu/effects/GrPorterDuffXferProcessor.h11
-rw-r--r--src/ports/SkFontHost_win.cpp10
-rw-r--r--src/ports/SkFontMgr_win_dw.cpp2
-rw-r--r--src/ports/SkImageEncoder_WIC.cpp3
-rw-r--r--src/ports/SkOSFile_win.cpp3
-rw-r--r--src/ports/SkScalerContext_win_dw.h2
-rw-r--r--src/utils/win/SkDWriteFontFileStream.h2
-rw-r--r--src/utils/win/SkIStream.cpp20
-rw-r--r--src/utils/win/SkTScopedComPtr.h1
-rw-r--r--src/utils/win/SkWGL_win.cpp4
-rw-r--r--src/xps/SkXPSDevice.h2
-rw-r--r--src/xps/SkXPSDocument.h2
-rw-r--r--tools/sk_app/win/main_win.cpp3
20 files changed, 157 insertions, 118 deletions
diff --git a/gn/BUILD.gn b/gn/BUILD.gn
index 70db37d52b..57cb5dac26 100644
--- a/gn/BUILD.gn
+++ b/gn/BUILD.gn
@@ -288,11 +288,6 @@ config("warnings") {
"/wd4291", # no matching operator delete found;
# memory will not be freed if initialization throws an exception
]
- if (is_clang) {
- # Shouldn't be necessary for local builds. With distributed builds, files may lose
- # their case during copy, causing case-sensitivity mismatch on remote machines.
- cflags += [ "-Wno-nonportable-include-path" ]
- }
} else {
cflags += [
"-Wall",
@@ -306,88 +301,92 @@ config("warnings") {
"-Wno-maybe-uninitialized",
]
cflags_cc += [ "-Wnon-virtual-dtor" ]
+ }
- if (is_clang) {
- cflags += [
- "-Weverything",
- "-Wno-unknown-warning-option", # Let older Clangs ignore newer Clangs' warnings.
- ]
-
- if (target_cpu == "arm" && is_ios) {
- # Clang seems to think new/malloc will only be 4-byte aligned on 32-bit iOS.
- # We're pretty sure it's actually 8-byte alignment.
- cflags += [ "-Wno-over-aligned" ]
- }
+ if (is_clang) {
+ cflags += [
+ "-Weverything",
+ "-Wno-unknown-warning-option", # Let older Clangs ignore newer Clangs' warnings.
+ ]
- # TODO: fix after we're building with Clang 5
- cflags += [
- "-Wno-cast-qual",
- "-Wno-unused-template",
- "-Wno-zero-as-null-pointer-constant",
- ]
-
- cflags += [
- "-Wno-cast-align",
- "-Wno-conditional-uninitialized",
- "-Wno-conversion",
- "-Wno-disabled-macro-expansion",
- "-Wno-documentation",
- "-Wno-documentation-unknown-command",
- "-Wno-double-promotion",
- "-Wno-exit-time-destructors", # TODO: OK outside libskia
- "-Wno-float-conversion",
- "-Wno-float-equal",
- "-Wno-format-nonliteral",
- "-Wno-global-constructors", # TODO: OK outside libskia
- "-Wno-gnu-zero-variadic-macro-arguments",
- "-Wno-missing-prototypes",
- "-Wno-missing-variable-declarations",
- "-Wno-pedantic",
- "-Wno-reserved-id-macro",
- "-Wno-shadow",
- "-Wno-shift-sign-overflow",
- "-Wno-sign-conversion",
- "-Wno-signed-enum-bitfield",
- "-Wno-switch-enum",
- "-Wno-undef",
- "-Wno-unreachable-code",
- "-Wno-unreachable-code-break",
- "-Wno-unreachable-code-return",
- "-Wno-unused-macros",
- "-Wno-unused-member-function",
- ]
- cflags_cc += [
- "-Wno-abstract-vbase-init",
- "-Wno-weak-vtables",
- ]
-
- # We are unlikely to want to fix these.
- cflags += [
- "-Wno-covered-switch-default",
- "-Wno-deprecated",
- "-Wno-implicit-fallthrough",
- "-Wno-missing-noreturn",
- "-Wno-old-style-cast",
- "-Wno-padded",
- ]
- cflags_cc += [
- "-Wno-c++98-compat",
- "-Wno-c++98-compat-pedantic",
- "-Wno-undefined-func-template",
- ]
- cflags_objc += [
- "-Wno-direct-ivar-access",
- "-Wno-objc-interface-ivars",
- ]
- cflags_objcc += [
- "-Wno-direct-ivar-access",
- "-Wno-objcc-interface-ivars",
- ]
+ if (target_cpu == "arm" && is_ios) {
+ # Clang seems to think new/malloc will only be 4-byte aligned on 32-bit iOS.
+ # We're pretty sure it's actually 8-byte alignment.
+ cflags += [ "-Wno-over-aligned" ]
}
+
+ # Shouldn't be necessary for local builds. With distributed Windows builds, files may lose
+ # their case during copy, causing case-sensitivity mismatch on remote machines.
+ cflags += [
+ "-Wno-nonportable-include-path",
+ "-Wno-nonportable-system-include-path",
+ ]
+
+ # TODO: These would all be really great warnings to turn on.
+ cflags += [
+ "-Wno-cast-align",
+ "-Wno-cast-qual",
+ "-Wno-conditional-uninitialized",
+ "-Wno-conversion",
+ "-Wno-disabled-macro-expansion",
+ "-Wno-documentation",
+ "-Wno-documentation-unknown-command",
+ "-Wno-double-promotion",
+ "-Wno-exit-time-destructors", # TODO: OK outside libskia
+ "-Wno-float-conversion",
+ "-Wno-float-equal",
+ "-Wno-format-nonliteral",
+ "-Wno-global-constructors", # TODO: OK outside libskia
+ "-Wno-gnu-zero-variadic-macro-arguments",
+ "-Wno-missing-prototypes",
+ "-Wno-missing-variable-declarations",
+ "-Wno-pedantic",
+ "-Wno-reserved-id-macro",
+ "-Wno-shadow",
+ "-Wno-shift-sign-overflow",
+ "-Wno-sign-conversion",
+ "-Wno-signed-enum-bitfield",
+ "-Wno-switch-enum",
+ "-Wno-undef",
+ "-Wno-unreachable-code",
+ "-Wno-unreachable-code-break",
+ "-Wno-unreachable-code-return",
+ "-Wno-unused-macros",
+ "-Wno-unused-member-function",
+ "-Wno-unused-template",
+ "-Wno-zero-as-null-pointer-constant",
+ ]
+ cflags_cc += [
+ "-Wno-abstract-vbase-init",
+ "-Wno-weak-vtables",
+ ]
+
+ # We are unlikely to want to fix these.
+ cflags += [
+ "-Wno-covered-switch-default",
+ "-Wno-deprecated",
+ "-Wno-implicit-fallthrough",
+ "-Wno-missing-noreturn",
+ "-Wno-old-style-cast",
+ "-Wno-padded",
+ ]
+ cflags_cc += [
+ "-Wno-c++98-compat",
+ "-Wno-c++98-compat-pedantic",
+ "-Wno-undefined-func-template",
+ ]
+ cflags_objc += [
+ "-Wno-direct-ivar-access",
+ "-Wno-objc-interface-ivars",
+ ]
+ cflags_objcc += [
+ "-Wno-direct-ivar-access",
+ "-Wno-objcc-interface-ivars",
+ ]
}
}
config("warnings_except_public_headers") {
- if (!is_win) {
+ if (!is_win || is_clang) {
cflags = [ "-Wno-unused-parameter" ]
}
}
diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h
index ce81904452..ecfcdd5bbf 100644
--- a/include/core/SkPostConfig.h
+++ b/include/core/SkPostConfig.h
@@ -315,7 +315,7 @@
//////////////////////////////////////////////////////////////////////
#ifndef SK_SIZE_T_SPECIFIER
-# if defined(_MSC_VER)
+# if defined(_MSC_VER) && !defined(__clang__)
# define SK_SIZE_T_SPECIFIER "%Iu"
# else
# define SK_SIZE_T_SPECIFIER "%zu"
diff --git a/samplecode/SampleBigGradient.cpp b/samplecode/SampleBigGradient.cpp
index 301c3d8a29..c174f6e83c 100644
--- a/samplecode/SampleBigGradient.cpp
+++ b/samplecode/SampleBigGradient.cpp
@@ -186,7 +186,8 @@ static void DeleteHDCCallback(void*, void* context) {
// required so that we can call the base class' constructor with the pixel
// data.
static bool Create(int width, int height, bool is_opaque, SkRasterHandleAllocator::Rec* rec) {
- BITMAPINFOHEADER hdr = { 0 };
+ BITMAPINFOHEADER hdr;
+ memset(&hdr, 0, sizeof(hdr));
hdr.biSize = sizeof(BITMAPINFOHEADER);
hdr.biWidth = width;
hdr.biHeight = -height; // Minus means top-down bitmap.
diff --git a/src/gpu/GrXferProcessor.h b/src/gpu/GrXferProcessor.h
index 90b0de95df..5ede1ae828 100644
--- a/src/gpu/GrXferProcessor.h
+++ b/src/gpu/GrXferProcessor.h
@@ -244,10 +244,14 @@ private:
// since these objects have no need for destructors. However, GCC and clang throw a warning when a
// class has virtual functions and a non-virtual destructor. We suppress that warning here and
// for the subclasses.
-#if defined(__GNUC__) || defined(__clang)
+#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
#endif
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnon-virtual-dtor"
+#endif
class GrXPFactory {
public:
typedef GrXferProcessor::DstProxy DstProxy;
@@ -316,9 +320,12 @@ private:
const GrCaps&,
GrPixelConfigIsClamped) const = 0;
};
-#if defined(__GNUC__) || defined(__clang)
+#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
GR_MAKE_BITFIELD_CLASS_OPS(GrXPFactory::AnalysisProperties);
diff --git a/src/gpu/effects/GrCoverageSetOpXP.h b/src/gpu/effects/GrCoverageSetOpXP.h
index 72d1b01280..cf91848944 100644
--- a/src/gpu/effects/GrCoverageSetOpXP.h
+++ b/src/gpu/effects/GrCoverageSetOpXP.h
@@ -13,10 +13,14 @@
#include "SkRegion.h"
// See the comment above GrXPFactory's definition about this warning suppression.
-#if defined(__GNUC__) || defined(__clang)
+#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
#endif
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnon-virtual-dtor"
+#endif
/**
* This xfer processor directly blends the the src coverage with the dst using a set operator. It is
@@ -51,8 +55,11 @@ private:
typedef GrXPFactory INHERITED;
};
-#if defined(__GNUC__) || defined(__clang)
+#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
+#if defined(__clang__)
+#pragma clang diagnostic pop
#endif
+#endif
diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp
index 98bda3e5e6..bdeda9467c 100644
--- a/src/gpu/effects/GrCustomXfermode.cpp
+++ b/src/gpu/effects/GrCustomXfermode.cpp
@@ -200,10 +200,14 @@ void CustomXP::onGetBlendInfo(BlendInfo* blendInfo) const {
///////////////////////////////////////////////////////////////////////////////
// See the comment above GrXPFactory's definition about this warning suppression.
-#if defined(__GNUC__) || defined(__clang)
+#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
#endif
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnon-virtual-dtor"
+#endif
class CustomXPFactory : public GrXPFactory {
public:
constexpr CustomXPFactory(SkBlendMode mode)
@@ -228,9 +232,12 @@ private:
typedef GrXPFactory INHERITED;
};
-#if defined(__GNUC__) || defined(__clang)
+#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
sk_sp<const GrXferProcessor> CustomXPFactory::makeXferProcessor(
const GrProcessorAnalysisColor&,
diff --git a/src/gpu/effects/GrDisableColorXP.h b/src/gpu/effects/GrDisableColorXP.h
index f1ac32bb4f..0c4f5cf2bb 100644
--- a/src/gpu/effects/GrDisableColorXP.h
+++ b/src/gpu/effects/GrDisableColorXP.h
@@ -13,10 +13,14 @@
#include "SkRefCnt.h"
// See the comment above GrXPFactory's definition about this warning suppression.
-#if defined(__GNUC__) || defined(__clang)
+#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
#endif
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnon-virtual-dtor"
+#endif
class GrDisableColorXPFactory : public GrXPFactory {
public:
static const GrXPFactory* Get();
@@ -42,9 +46,12 @@ private:
typedef GrXPFactory INHERITED;
};
-#if defined(__GNUC__) || defined(__clang)
+#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
inline const GrXPFactory* GrDisableColorXPFactory::Get() {
// If this is constructed as static constexpr by cl.exe (2015 SP2) the vtable is null.
diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.h b/src/gpu/effects/GrPorterDuffXferProcessor.h
index 37cd6899da..74ae1533bf 100644
--- a/src/gpu/effects/GrPorterDuffXferProcessor.h
+++ b/src/gpu/effects/GrPorterDuffXferProcessor.h
@@ -13,10 +13,14 @@
#include "SkBlendMode.h"
// See the comment above GrXPFactory's definition about this warning suppression.
-#if defined(__GNUC__) || defined(__clang)
+#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
#endif
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnon-virtual-dtor"
+#endif
class GrPorterDuffXPFactory : public GrXPFactory {
public:
static const GrXPFactory* Get(SkBlendMode blendMode);
@@ -62,8 +66,11 @@ private:
friend class GrPorterDuffTest; // for TestGetXPOutputTypes()
typedef GrXPFactory INHERITED;
};
-#if defined(__GNUC__) || defined(__clang)
+#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
#endif
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp
index 9094d7e2a4..ef17ca8af5 100644
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -539,7 +539,7 @@ public:
SkScalerContext_GDI(sk_sp<LogFontTypeface>,
const SkScalerContextEffects&,
const SkDescriptor* desc);
- virtual ~SkScalerContext_GDI();
+ ~SkScalerContext_GDI() override;
// Returns true if the constructor was able to complete all of its
// initializations (which may include calling GDI).
@@ -821,7 +821,8 @@ uint16_t SkScalerContext_GDI::generateCharToGlyph(SkUnichar utf32) {
static const int numWCHAR = 2;
static const int maxItems = 2;
// MSDN states that this can be nullptr, but some things don't work then.
- SCRIPT_CONTROL sc = { 0 };
+ SCRIPT_CONTROL sc;
+ memset(&sc, 0, sizeof(sc));
// Add extra item to SCRIPT_ITEM to work around a bug (now documented).
// https://bugzilla.mozilla.org/show_bug.cgi?id=366643
SCRIPT_ITEM si[maxItems + 1];
@@ -1920,7 +1921,7 @@ SkStreamAsset* LogFontTypeface::onOpenStream(int* ttcIndex) const {
SkMemoryStream* stream = nullptr;
DWORD tables[2] = {kTTCTag, 0};
- for (int i = 0; i < SK_ARRAY_COUNT(tables); i++) {
+ for (size_t i = 0; i < SK_ARRAY_COUNT(tables); i++) {
DWORD bufferSize = GetFontData(hdc, tables[i], 0, nullptr, 0);
if (bufferSize == GDI_ERROR) {
call_ensure_accessible(lf);
@@ -1976,7 +1977,8 @@ static uint16_t nonBmpCharToGlyph(HDC hdc, SCRIPT_CACHE* scriptCache, const WCHA
static const int numWCHAR = 2;
static const int maxItems = 2;
// MSDN states that this can be nullptr, but some things don't work then.
- SCRIPT_CONTROL scriptControl = { 0 };
+ SCRIPT_CONTROL scriptControl;
+ memset(&scriptControl, 0, sizeof(scriptControl));
// Add extra item to SCRIPT_ITEM to work around a bug (now documented).
// https://bugzilla.mozilla.org/show_bug.cgi?id=366643
SCRIPT_ITEM si[maxItems + 1];
diff --git a/src/ports/SkFontMgr_win_dw.cpp b/src/ports/SkFontMgr_win_dw.cpp
index c2d9fefdc5..54de313c3b 100644
--- a/src/ports/SkFontMgr_win_dw.cpp
+++ b/src/ports/SkFontMgr_win_dw.cpp
@@ -911,7 +911,7 @@ sk_sp<SkTypeface> SkFontMgr_DirectWrite::onMakeFromStreamIndex(std::unique_ptr<S
SkTScopedComPtr<IDWriteFontFace> fontFace;
HRN(font->CreateFontFace(&fontFace));
- UINT32 faceIndex = fontFace->GetIndex();
+ int faceIndex = fontFace->GetIndex();
if (faceIndex == ttcIndex) {
return sk_sp<SkTypeface>(DWriteFontTypeface::Create(fFactory.get(),
fontFace.get(), font.get(), fontFamily.get(),
diff --git a/src/ports/SkImageEncoder_WIC.cpp b/src/ports/SkImageEncoder_WIC.cpp
index dc5160413f..2e1dc8c833 100644
--- a/src/ports/SkImageEncoder_WIC.cpp
+++ b/src/ports/SkImageEncoder_WIC.cpp
@@ -156,7 +156,8 @@ bool SkEncodeImageWithWIC(SkWStream* stream, const SkPixmap& pixmap,
}
if (SUCCEEDED(hr)) {
- PROPBAG2 name = { 0 };
+ PROPBAG2 name;
+ memset(&name, 0, sizeof(name));
name.dwType = PROPBAG2_TYPE_DATA;
name.vt = VT_R4;
name.pstrName = const_cast<LPOLESTR>(L"ImageQuality");
diff --git a/src/ports/SkOSFile_win.cpp b/src/ports/SkOSFile_win.cpp
index 7e194cf287..50ca264d19 100644
--- a/src/ports/SkOSFile_win.cpp
+++ b/src/ports/SkOSFile_win.cpp
@@ -132,7 +132,8 @@ size_t sk_qread(FILE* file, void* buffer, size_t count, size_t offset) {
return SIZE_MAX;
}
- OVERLAPPED overlapped = {0};
+ OVERLAPPED overlapped;
+ memset(&overlapped, 0, sizeof(overlapped));
ULARGE_INTEGER winOffset;
winOffset.QuadPart = offset;
overlapped.Offset = winOffset.LowPart;
diff --git a/src/ports/SkScalerContext_win_dw.h b/src/ports/SkScalerContext_win_dw.h
index 9b0f244417..6d09855884 100644
--- a/src/ports/SkScalerContext_win_dw.h
+++ b/src/ports/SkScalerContext_win_dw.h
@@ -24,7 +24,7 @@ public:
SkScalerContext_DW(sk_sp<DWriteFontTypeface>,
const SkScalerContextEffects&,
const SkDescriptor*);
- virtual ~SkScalerContext_DW();
+ ~SkScalerContext_DW() override;
protected:
unsigned generateGlyphCount() override;
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;
diff --git a/src/xps/SkXPSDevice.h b/src/xps/SkXPSDevice.h
index 7aa60a0830..a5ee07634c 100644
--- a/src/xps/SkXPSDevice.h
+++ b/src/xps/SkXPSDevice.h
@@ -39,7 +39,7 @@
class SkXPSDevice : public SkClipStackDevice {
public:
SK_API SkXPSDevice(SkISize);
- SK_API virtual ~SkXPSDevice();
+ SK_API ~SkXPSDevice() override;
bool beginPortfolio(SkWStream* outputStream, IXpsOMObjectFactory*);
/**
diff --git a/src/xps/SkXPSDocument.h b/src/xps/SkXPSDocument.h
index cccfc1f777..f436db1c42 100644
--- a/src/xps/SkXPSDocument.h
+++ b/src/xps/SkXPSDocument.h
@@ -21,7 +21,7 @@
class SkXPSDocument final : public SkDocument {
public:
SkXPSDocument(SkWStream*, SkScalar dpi, SkTScopedComPtr<IXpsOMObjectFactory>);
- virtual ~SkXPSDocument();
+ ~SkXPSDocument() override;
protected:
SkCanvas* onBeginPage(SkScalar w, SkScalar h) override;
diff --git a/tools/sk_app/win/main_win.cpp b/tools/sk_app/win/main_win.cpp
index 4800258973..4765442f96 100644
--- a/tools/sk_app/win/main_win.cpp
+++ b/tools/sk_app/win/main_win.cpp
@@ -62,7 +62,8 @@ static int main_common(HINSTANCE hInstance, int show, int argc, char**argv) {
Application* app = Application::Create(argc, argv, (void*)hInstance);
- MSG msg = { 0 };
+ MSG msg;
+ memset(&msg, 0, sizeof(msg));
// Main message loop
while (WM_QUIT != msg.message) {