Cast the result of SK_OFFSETOF to size_t to match offsetof() and avoid narrowing conversion errors

git-svn-id: http://skia.googlecode.com/svn/trunk@3446 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2012-03-21 12:25:48 +00:00
parent 599445130c
commit 56d3a23c3e

View File

@ -204,7 +204,7 @@ static inline bool SkIsU16(long x) {
//////////////////////////////////////////////////////////////////////////////
#ifndef SK_OFFSETOF
#define SK_OFFSETOF(type, field) ((char*)&(((type*)1)->field) - (char*)1)
#define SK_OFFSETOF(type, field) (size_t)((char*)&(((type*)1)->field) - (char*)1)
#endif
/** Returns the number of entries in an array (not a pointer)