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:
parent
945708ad94
commit
929c98d35f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user