Fixed warnings for casting large type to smaller one.
Change-Id: Ib3e2661d0383bf154bc9178dac070dfd910a393c
Reviewed-on: https://skia-review.googlesource.com/115200
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
diff --git a/include/private/SkPathRef.h b/include/private/SkPathRef.h
index b9b52d4..77d031f 100644
--- a/include/private/SkPathRef.h
+++ b/include/private/SkPathRef.h
@@ -495,13 +495,13 @@
void setIsOval(bool isOval, bool isCCW, unsigned start) {
fIsOval = isOval;
fRRectOrOvalIsCCW = isCCW;
- fRRectOrOvalStartIdx = start;
+ fRRectOrOvalStartIdx = SkToU8(start);
}
void setIsRRect(bool isRRect, bool isCCW, unsigned start) {
fIsRRect = isRRect;
fRRectOrOvalIsCCW = isCCW;
- fRRectOrOvalStartIdx = start;
+ fRRectOrOvalStartIdx = SkToU8(start);
}
// called only by the editor. Note that this is not a const function.
diff --git a/include/private/SkSafe32.h b/include/private/SkSafe32.h
index 25058d2..484644b 100644
--- a/include/private/SkSafe32.h
+++ b/include/private/SkSafe32.h
@@ -9,7 +9,7 @@
#define SkSafe32_DEFINED
static constexpr int32_t Sk64_pin_to_s32(int64_t x) {
- return x < SK_MinS32 ? SK_MinS32 : (x > SK_MaxS32 ? SK_MaxS32 : x);
+ return x < SK_MinS32 ? SK_MinS32 : (x > SK_MaxS32 ? SK_MaxS32 : (int32_t)x);
}
static constexpr int32_t Sk32_sat_add(int32_t a, int32_t b) {