diff options
author | 2013-07-02 20:02:06 +0000 | |
---|---|---|
committer | 2013-07-02 20:02:06 +0000 | |
commit | 929c98d35ff8133af765180552715b04ec177ad3 (patch) | |
tree | ee8d9ffc109aebf2c78cbcf0169af89ae1595da4 | |
parent | 945708ad9494322e2bc26776ccb741776205b4b8 (diff) |
speculative fix for signed-unsinged compare warning
git-svn-id: http://skia.googlecode.com/svn/trunk@9876 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | include/core/SkTemplates.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/core/SkTemplates.h b/include/core/SkTemplates.h index 3060f9ef27..a06c856a32 100644 --- a/include/core/SkTemplates.h +++ b/include/core/SkTemplates.h @@ -66,7 +66,9 @@ template <typename D, typename S> static D* SkTAddOffset(S* ptr, size_t byteOffs /** Returns true if the source value 's' will fit in the destination type 'D'. */ template <typename D, typename S> inline bool SkTFitsIn(S s) { - return static_cast<D>(s) == s; + // the cast to <S> is just to restore the signedness of S, to avoid + // sign-unsigned comparison warnings. + return static_cast<S>(static_cast<D>(s)) == s; } /** \class SkAutoTCallVProc |