speculative fix for signed-unsinged compare warning

git-svn-id: http://skia.googlecode.com/svn/trunk@9876 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2013-07-02 20:02:06 +00:00
parent 945708ad94
commit 929c98d35f

View File

@ -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