Start cleaning up 64bit Win warnings
https://codereview.chromium.org/27192003/
git-svn-id: http://skia.googlecode.com/svn/trunk/include@11764 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/core/SkTemplates.h b/core/SkTemplates.h
index c63a114..8317b24 100644
--- a/core/SkTemplates.h
+++ b/core/SkTemplates.h
@@ -231,7 +231,7 @@
/** 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 @@
/** Allocate count number of T elements
*/
- SkAutoSTArray(size_t count) {
+ SkAutoSTArray(int count) {
fArray = NULL;
fCount = 0;
this->reset(count);
@@ -252,7 +252,7 @@
}
/** 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 @@
/** 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 @@
/** 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/core/SkWriter32.h b/core/SkWriter32.h
index 0db6540..ba8893e 100644
--- a/core/SkWriter32.h
+++ b/core/SkWriter32.h
@@ -45,9 +45,9 @@
~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 @@
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;
diff --git a/utils/SkMeshUtils.h b/utils/SkMeshUtils.h
index 564df67..7e0e8f4 100644
--- a/utils/SkMeshUtils.h
+++ b/utils/SkMeshUtils.h
@@ -27,14 +27,14 @@
bool init(SkPoint tex[], uint16_t indices[],
int texW, int texH, int rows, int cols);
- size_t indexCount() const { return fIndexCount; }
+ int indexCount() const { return fIndexCount; }
const uint16_t* indices() const { return fIndices; }
size_t texCount() const { return fTexCount; }
const SkPoint* tex() const { return fTex; }
private:
- size_t fIndexCount, fTexCount;
+ int fIndexCount, fTexCount;
SkPoint* fTex;
uint16_t* fIndices;
void* fStorage; // may be null