* if we're on a 32bit or 64bit arch, since we use sizeof(uintptr_t)
* to compute how much to shift-down the size.
*/
- int n4 = size / (sizeof(uintptr_t) << 2);
- for (int i = 0; i < n4; ++i) {
+ size_t n4 = size / (sizeof(uintptr_t) << 2);
+ for (size_t i = 0; i < n4; ++i) {
result = Mash(result, *ptr++);
result = Mash(result, *ptr++);
result = Mash(result, *ptr++);
fStop = (const char*)data + size;
}
- uint32_t size() const { return fStop - fBase; }
- uint32_t offset() const { return fCurr - fBase; }
+ uint32_t size() const { return SkToU32(fStop - fBase); }
+ uint32_t offset() const { return SkToU32(fCurr - fBase); }
bool eof() const { return fCurr >= fStop; }
const void* base() const { return fBase; }
const void* peek() const { return fCurr; }
- uint32_t available() const { return fStop - fCurr; }
+ uint32_t available() const { return SkToU32(fStop - fCurr); }
bool isAvailable(uint32_t size) const { return fCurr + size <= fStop; }
void rewind() { fCurr = fBase; }
/**
* Return the number of elements in the array
*/
- int count() const { return fCount; }
+ int count() const { return (int)fCount; }
/**
* return the number of bytes in the array: count * sizeof(T)