Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Unified Diff: include/core/SkTDArray.h

Issue 27487003: Third wave of Win64 warning cleanup (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Got compiling on linux Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/texteffects.cpp ('k') | src/gpu/gl/GrGLBufferImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkTDArray.h
===================================================================
--- include/core/SkTDArray.h (revision 11815)
+++ include/core/SkTDArray.h (working copy)
@@ -21,7 +21,7 @@
fData = NULL;
#endif
}
- SkTDArray(const T src[], size_t count) {
+ SkTDArray(const T src[], int count) {
SkASSERT(src || count == 0);
fReserve = fCount = 0;
@@ -98,7 +98,7 @@
/**
* Return the number of elements in the array
*/
- int count() const { return (int)fCount; }
+ int count() const { return fCount; }
/**
* return the number of bytes in the array: count * sizeof(T)
@@ -111,11 +111,11 @@
const T* end() const { return fArray ? fArray + fCount : NULL; }
T& operator[](int index) {
- SkASSERT((unsigned)index < fCount);
+ SkASSERT(index < fCount);
return fArray[index];
}
const T& operator[](int index) const {
- SkASSERT((unsigned)index < fCount);
+ SkASSERT(index < fCount);
return fArray[index];
}
@@ -144,7 +144,7 @@
fCount = 0;
}
- void setCount(size_t count) {
+ void setCount(int count) {
if (count > fReserve) {
this->growBy(count - fCount);
} else {
@@ -152,10 +152,10 @@
}
}
- void setReserve(size_t reserve) {
+ void setReserve(int reserve) {
if (reserve > fReserve) {
SkASSERT(reserve > fCount);
- size_t count = fCount;
+ int count = fCount;
this->growBy(reserve - fCount);
fCount = count;
}
@@ -170,8 +170,8 @@
T* append() {
return this->append(1, NULL);
}
- T* append(size_t count, const T* src = NULL) {
- size_t oldCount = fCount;
+ T* append(int count, const T* src = NULL) {
+ int oldCount = fCount;
if (count) {
SkASSERT(src == NULL || fArray == NULL ||
src + count <= fArray || fArray + oldCount <= src);
@@ -190,10 +190,10 @@
return result;
}
- T* insert(size_t index) {
+ T* insert(int index) {
return this->insert(index, 1, NULL);
}
- T* insert(size_t index, size_t count, const T* src = NULL) {
+ T* insert(int index, int count, const T* src = NULL) {
SkASSERT(count);
SkASSERT(index <= fCount);
size_t oldCount = fCount;
@@ -206,15 +206,15 @@
return dst;
}
- void remove(size_t index, size_t count = 1) {
+ void remove(int index, int count = 1) {
SkASSERT(index + count <= fCount);
fCount = fCount - count;
memmove(fArray + index, fArray + index + count, sizeof(T) * (fCount - index));
}
- void removeShuffle(size_t index) {
+ void removeShuffle(int index) {
SkASSERT(index < fCount);
- size_t newCount = fCount - 1;
+ int newCount = fCount - 1;
fCount = newCount;
if (index != newCount) {
memcpy(fArray + index, fArray + newCount, sizeof(T));
@@ -256,7 +256,7 @@
* Copies up to max elements into dst. The number of items copied is
* capped by count - index. The actual number copied is returned.
*/
- int copyRange(T* dst, size_t index, int max) const {
+ int copyRange(T* dst, int index, int max) const {
SkASSERT(max >= 0);
SkASSERT(!max || dst);
if (index >= fCount) {
@@ -346,13 +346,14 @@
ArrayT* fData;
#endif
T* fArray;
- size_t fReserve, fCount;
+ int fReserve;
+ int fCount;
- void growBy(size_t extra) {
+ void growBy(int extra) {
SkASSERT(extra);
if (fCount + extra > fReserve) {
- size_t size = fCount + extra + 4;
+ int size = fCount + extra + 4;
size += size >> 2;
fArray = (T*)sk_realloc_throw(fArray, size * sizeof(T));
« no previous file with comments | « gm/texteffects.cpp ('k') | src/gpu/gl/GrGLBufferImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698