aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2018-06-15 17:10:25 -0400
committerGravatar Ben Wagner <bungeman@google.com>2018-06-15 21:17:42 +0000
commit1adfbd594c5d66ba069c8538b2e7923679a22a08 (patch)
tree9478b65984f480ddfbf86e897dec06a48e8c2b7f /src
parent0052a318680af83242d7af67acd3b055bde740c5 (diff)
Work around signed-unsigned comparison warning.
Change-Id: I35d2c3430dbf071dcbbb73e408115d9204e5908b Reviewed-on: https://skia-review.googlesource.com/135327 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/SkDraw.cpp4
-rw-r--r--src/pdf/SkPDFFont.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index 58489b9ec8..2c8eb84845 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -1426,9 +1426,9 @@ public:
// Comparisons written a little weirdly so that NaN coordinates are treated safely.
auto gt = [](float a, int b) { return !(a <= (float)b); };
auto lt = [](float a, int b) { return !(a >= (float)b); };
- if (gt(position.fX, INT_MAX - (INT16_MAX + UINT16_MAX)) ||
+ if (gt(position.fX, INT_MAX - (INT16_MAX + SkTo<int>(UINT16_MAX))) ||
lt(position.fX, INT_MIN - (INT16_MIN + 0 /*UINT16_MIN*/)) ||
- gt(position.fY, INT_MAX - (INT16_MAX + UINT16_MAX)) ||
+ gt(position.fY, INT_MAX - (INT16_MAX + SkTo<int>(UINT16_MAX))) ||
lt(position.fY, INT_MIN - (INT16_MIN + 0 /*UINT16_MIN*/))) {
return;
}
diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp
index 022e214057..e9976506d5 100644
--- a/src/pdf/SkPDFFont.cpp
+++ b/src/pdf/SkPDFFont.cpp
@@ -149,7 +149,7 @@ const SkAdvancedTypefaceMetrics* SkPDFFont::GetMetrics(SkTypeface* typeface,
return ptr->get(); // canon retains ownership.
}
int count = typeface->countGlyphs();
- if (count <= 0 || count > 1 + UINT16_MAX) {
+ if (count <= 0 || count > 1 + SkTo<int>(UINT16_MAX)) {
// Cache nullptr to skip this check. Use SkSafeUnref().
canon->fTypefaceMetrics.set(id, nullptr);
return nullptr;