diff options
author | Hal Canary <halcanary@google.com> | 2018-06-13 15:01:39 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-14 14:10:47 +0000 |
commit | e1bc7de7c07686b28b00b850e44e0722189f3592 (patch) | |
tree | 827ddab1abd7f6df76287bdab1ed65ccf6801e36 /include | |
parent | b6b5b7a8082eddc6b198817ab0ea7d9c9f5dd4e4 (diff) |
Remove SK_MaxSizeT, SK_M{in|ax}U{16|32}, #defines.
sed 's/SK_MaxSizeT/SIZE_MAX/g'
sed 's/SK_MaxU32/UINT32_MAX/g'
sed 's/SK_MaxU16/UINT16_MAX/g'
SK_MinU32 and SK_MinU16 were unused
Change-Id: I6b6c824df47b05bde7e73b13a58e851a5f63fe0e
Reviewed-on: https://skia-review.googlesource.com/134607
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkImageInfo.h | 10 | ||||
-rw-r--r-- | include/core/SkTypes.h | 15 |
2 files changed, 10 insertions, 15 deletions
diff --git a/include/core/SkImageInfo.h b/include/core/SkImageInfo.h index f09b8d6b03..42491de5e7 100644 --- a/include/core/SkImageInfo.h +++ b/include/core/SkImageInfo.h @@ -553,7 +553,7 @@ public: and rowBytes. rowBytes is assumed to be at least as large as minRowBytes(). Returns zero if height is zero. - Returns SK_MaxSizeT if answer exceeds the range of size_t. + Returns SIZE_MAX if answer exceeds the range of size_t. @param rowBytes size of pixel row or larger @return memory required by pixel buffer @@ -564,7 +564,7 @@ public: SkColorType. Uses minRowBytes() to compute bytes for pixel row. Returns zero if height is zero. - Returns SK_MaxSizeT if answer exceeds the range of size_t. + Returns SIZE_MAX if answer exceeds the range of size_t. @return least memory required by pixel buffer */ @@ -572,14 +572,14 @@ public: return this->computeByteSize(this->minRowBytes()); } - /** Returns true if byteSize equals SK_MaxSizeT. computeByteSize() and - computeMinByteSize() return SK_MaxSizeT if size_t can not hold buffer size. + /** Returns true if byteSize equals SIZE_MAX. computeByteSize() and + computeMinByteSize() return SIZE_MAX if size_t can not hold buffer size. @param byteSize result of computeByteSize() or computeMinByteSize() @return true if computeByteSize() or computeMinByteSize() result exceeds size_t */ static bool ByteSizeOverflowed(size_t byteSize) { - return SK_MaxSizeT == byteSize; + return SIZE_MAX == byteSize; } /** Returns true if rowBytes is smaller than width times pixel size. diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h index 75146341fe..2fe28fc6ce 100644 --- a/include/core/SkTypes.h +++ b/include/core/SkTypes.h @@ -115,17 +115,12 @@ template <typename D, typename S> constexpr D SkTo(S s) { */ #define SkToBool(cond) ((cond) != 0) -#define SK_MaxS16 32767 -#define SK_MinS16 -32767 -#define SK_MaxU16 0xFFFF -#define SK_MinU16 0 -#define SK_MaxS32 0x7FFFFFFF +#define SK_MaxS16 INT16_MAX +#define SK_MinS16 -SK_MaxS16 +#define SK_MaxS32 INT32_MAX #define SK_MinS32 -SK_MaxS32 -#define SK_MaxU32 0xFFFFFFFF -#define SK_MinU32 0 -#define SK_NaN32 ((int) (1U << 31)) -#define SK_MaxSizeT SIZE_MAX -static constexpr int64_t SK_MaxS64 = 0x7FFFFFFFFFFFFFFF; +#define SK_NaN32 INT32_MIN +static constexpr int64_t SK_MaxS64 = INT64_MAX; static constexpr int64_t SK_MinS64 = -SK_MaxS64; static inline constexpr int32_t SkLeftShift(int32_t value, int32_t shift) { |