diff options
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkTemplates.h | 12 | ||||
-rw-r--r-- | include/core/SkWriter32.h | 8 |
2 files changed, 10 insertions, 10 deletions
diff --git a/include/core/SkTemplates.h b/include/core/SkTemplates.h index c63a1140d1..8317b24717 100644 --- a/include/core/SkTemplates.h +++ b/include/core/SkTemplates.h @@ -231,7 +231,7 @@ private: /** Wraps SkAutoTArray, with room for up to N elements preallocated */ -template <size_t N, typename T> class SkAutoSTArray : SkNoncopyable { +template <int N, typename T> class SkAutoSTArray : SkNoncopyable { public: /** Initialize with no objects */ SkAutoSTArray() { @@ -241,7 +241,7 @@ public: /** Allocate count number of T elements */ - SkAutoSTArray(size_t count) { + SkAutoSTArray(int count) { fArray = NULL; fCount = 0; this->reset(count); @@ -252,7 +252,7 @@ public: } /** Destroys previous objects in the array and default constructs count number of objects */ - void reset(size_t count) { + void reset(int count) { T* start = fArray; T* iter = start + fCount; while (iter > start) { @@ -286,7 +286,7 @@ public: /** Return the number of T elements in the array */ - size_t count() const { return fCount; } + int count() const { return fCount; } /** Return the array of T elements. Will be NULL if count == 0 */ @@ -295,12 +295,12 @@ public: /** Return the nth element in the array */ T& operator[](int index) const { - SkASSERT((unsigned)index < fCount); + SkASSERT(index < fCount); return fArray[index]; } private: - size_t fCount; + int fCount; T* fArray; // since we come right after fArray, fStorage should be properly aligned char fStorage[N * sizeof(T)]; diff --git a/include/core/SkWriter32.h b/include/core/SkWriter32.h index 0db6540a9f..ba8893eab9 100644 --- a/include/core/SkWriter32.h +++ b/include/core/SkWriter32.h @@ -45,9 +45,9 @@ public: ~SkWriter32(); // return the current offset (will always be a multiple of 4) - uint32_t bytesWritten() const { return fSize; } + size_t bytesWritten() const { return fSize; } // DEPRECATED: use bytesWritten instead TODO(mtklein): clean up - uint32_t size() const { return this->bytesWritten(); } + size_t size() const { return this->bytesWritten(); } // Returns true if we've written only into the storage passed into constructor or reset. // (You may be able to use this to avoid a call to flatten.) @@ -268,9 +268,9 @@ private: Block* fHead; Block* fTail; size_t fMinSize; - uint32_t fSize; + size_t fSize; // sum of bytes written in all blocks *before* fTail - uint32_t fWrittenBeforeLastBlock; + size_t fWrittenBeforeLastBlock; bool isHeadExternallyAllocated() const { return fHead == &fExternalBlock; |