aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkTemplates.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/core/SkTemplates.h')
-rw-r--r--include/core/SkTemplates.h12
1 files changed, 6 insertions, 6 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)];